Blob Blame History Raw
From: Borislav Petkov <bp@suse.de>
Date: Fri Dec  3 19:30:46 CET 2021
Subject: x86/mpx: Disable MPX for 32-bit userland
Patch-mainline: never, this code is gone upstream
References: bsc#1193139

This code has been removed from mainline and from Intel hw so disable MPX 32-bit
userland support instead of trying to fix it. It is unlikely that anyone is
using this.

Signed-off-by: Borislav Petkov <bp@suse.de>
---
diff --git a/arch/x86/mm/mpx.c b/arch/x86/mm/mpx.c
index 895fb7a9294d..253bc325ecf7 100644
--- a/arch/x86/mm/mpx.c
+++ b/arch/x86/mm/mpx.c
@@ -215,6 +215,9 @@ int mpx_enable_management(void)
 	struct mm_struct *mm = current->mm;
 	int ret = 0;
 
+	if (!is_64bit_mm(mm))
+		return -EINVAL;
+
 	/*
 	 * runtime in the userspace will be responsible for allocation of
 	 * the bounds directory. Then, it will save the base of the bounds