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
181#define PR_GET_THP_DISABLE 42181#define PR_GET_THP_DISABLE 42
182 182
183/*183/*
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:
185 */185 */
186#define PR_MPX_ENABLE_MANAGEMENT 43186#define PR_MPX_ENABLE_MANAGEMENT 43
187#define PR_MPX_DISABLE_MANAGEMENT 44187#define PR_MPX_DISABLE_MANAGEMENT 44
kernel/sys.c+2−14
@@ -103,12 +103,6 @@ · 102 unmodified lines
103#ifndef SET_TSC_CTL103#ifndef SET_TSC_CTL
104# define SET_TSC_CTL(a) (-EINVAL)104# define SET_TSC_CTL(a) (-EINVAL)
105#endif105#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
112#ifndef GET_FP_MODE106#ifndef GET_FP_MODE
113# define GET_FP_MODE(a) (-EINVAL)107# define GET_FP_MODE(a) (-EINVAL)
114#endif108#endif
@@ -2456,15 +2450,9 @@ SYSCALL_DEFINE5(prctl, int, option, unsigned long, arg2, unsigned long, arg3, · 2341 unmodified lines
2456 up_write(&me->mm->mmap_sem);2450 up_write(&me->mm->mmap_sem);
2457 break;2451 break;
2458 case PR_MPX_ENABLE_MANAGEMENT:2452 case PR_MPX_ENABLE_MANAGEMENT:
2459 if (arg2 || arg3 || arg4 || arg5)
2460 return -EINVAL;
2461 error = MPX_ENABLE_MANAGEMENT();
2462 break;
2463 case PR_MPX_DISABLE_MANAGEMENT:2453 case PR_MPX_DISABLE_MANAGEMENT:
2464 if (arg2 || arg3 || arg4 || arg5)2454 /* No longer implemented: */
2465 return -EINVAL;2455 return -EINVAL;
2466 error = MPX_DISABLE_MANAGEMENT();
2467 break;
2468 case PR_SET_FP_MODE:2456 case PR_SET_FP_MODE:
2469 error = SET_FP_MODE(me, arg2);2457 error = SET_FP_MODE(me, arg2);
2470 break;2458 break;