Skip to content

Commit f240652

Browse files
hansendcKAGA-KOKO
authored andcommitted
x86/mpx: Remove MPX APIs
MPX is being removed from the kernel due to a lack of support in the toolchain going forward (gcc). The first step is to remove the userspace-visible ABIs so that applications will stop using it. The most visible one are the enable/disable prctl()s. Remove them first. This is the most minimal and least invasive change needed to ensure that apps stop using MPX with new kernels. Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Link: https://lkml.kernel.org/r/20190705175321.DB42F0AD@viggo.jf.intel.com
1 parent e28df79 commit f240652

File tree

2 files changed

+3
-15
lines changed

2 files changed

+3
-15
lines changed

include/uapi/linux/prctl.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ struct prctl_mm_map {
181181
#define PR_GET_THP_DISABLE 42
182182

183183
/*
184-
* Tell the kernel to start/stop helping userspace manage bounds tables.
184+
* No longer implemented, but left here to ensure the numbers stay reserved:
185185
*/
186186
#define PR_MPX_ENABLE_MANAGEMENT 43
187187
#define PR_MPX_DISABLE_MANAGEMENT 44

kernel/sys.c

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -103,12 +103,6 @@
103103
#ifndef SET_TSC_CTL
104104
# define SET_TSC_CTL(a) (-EINVAL)
105105
#endif
106-
#ifndef MPX_ENABLE_MANAGEMENT
107-
# define MPX_ENABLE_MANAGEMENT() (-EINVAL)
108-
#endif
109-
#ifndef MPX_DISABLE_MANAGEMENT
110-
# define MPX_DISABLE_MANAGEMENT() (-EINVAL)
111-
#endif
112106
#ifndef GET_FP_MODE
113107
# define GET_FP_MODE(a) (-EINVAL)
114108
#endif
@@ -2456,15 +2450,9 @@ SYSCALL_DEFINE5(prctl, int, option, unsigned long, arg2, unsigned long, arg3,
24562450
up_write(&me->mm->mmap_sem);
24572451
break;
24582452
case PR_MPX_ENABLE_MANAGEMENT:
2459-
if (arg2 || arg3 || arg4 || arg5)
2460-
return -EINVAL;
2461-
error = MPX_ENABLE_MANAGEMENT();
2462-
break;
24632453
case PR_MPX_DISABLE_MANAGEMENT:
2464-
if (arg2 || arg3 || arg4 || arg5)
2465-
return -EINVAL;
2466-
error = MPX_DISABLE_MANAGEMENT();
2467-
break;
2454+
/* No longer implemented: */
2455+
return -EINVAL;
24682456
case PR_SET_FP_MODE:
24692457
error = SET_FP_MODE(me, arg2);
24702458
break;

0 commit comments

Comments
 (0)