History

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.

Dave Hansen committed 7 years ago

Commit f2406521 parent e28df792 files · +3 −15Browse files

Unified · Split

2 files
  1. include/uapi/linux/prctl.h +1 −1
  2. kernel/sys.c +2 −14
include/uapi/linux/prctl.h+1−1
@@ -181,7 +181,7 @@ struct prctl_mm_map { · 180 unmodified lines
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+2−14
@@ -103,12 +103,6 @@ · 102 unmodified lines
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, · 2341 unmodified lines
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;