aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/sys.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/sys.c')
-rw-r--r--kernel/sys.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/kernel/sys.c b/kernel/sys.c
index a8c9f5a7dda6..a03d9cd23ed7 100644
--- a/kernel/sys.c
+++ b/kernel/sys.c
@@ -97,6 +97,12 @@
97#ifndef MPX_DISABLE_MANAGEMENT 97#ifndef MPX_DISABLE_MANAGEMENT
98# define MPX_DISABLE_MANAGEMENT(a) (-EINVAL) 98# define MPX_DISABLE_MANAGEMENT(a) (-EINVAL)
99#endif 99#endif
100#ifndef GET_FP_MODE
101# define GET_FP_MODE(a) (-EINVAL)
102#endif
103#ifndef SET_FP_MODE
104# define SET_FP_MODE(a,b) (-EINVAL)
105#endif
100 106
101/* 107/*
102 * this is where the system-wide overflow UID and GID are defined, for 108 * this is where the system-wide overflow UID and GID are defined, for
@@ -1102,6 +1108,7 @@ DECLARE_RWSEM(uts_sem);
1102/* 1108/*
1103 * Work around broken programs that cannot handle "Linux 3.0". 1109 * Work around broken programs that cannot handle "Linux 3.0".
1104 * Instead we map 3.x to 2.6.40+x, so e.g. 3.0 would be 2.6.40 1110 * Instead we map 3.x to 2.6.40+x, so e.g. 3.0 would be 2.6.40
1111 * And we map 4.x to 2.6.60+x, so 4.0 would be 2.6.60.
1105 */ 1112 */
1106static int override_release(char __user *release, size_t len) 1113static int override_release(char __user *release, size_t len)
1107{ 1114{
@@ -1121,7 +1128,7 @@ static int override_release(char __user *release, size_t len)
1121 break; 1128 break;
1122 rest++; 1129 rest++;
1123 } 1130 }
1124 v = ((LINUX_VERSION_CODE >> 8) & 0xff) + 40; 1131 v = ((LINUX_VERSION_CODE >> 8) & 0xff) + 60;
1125 copy = clamp_t(size_t, len, 1, sizeof(buf)); 1132 copy = clamp_t(size_t, len, 1, sizeof(buf));
1126 copy = scnprintf(buf, copy, "2.6.%u%s", v, rest); 1133 copy = scnprintf(buf, copy, "2.6.%u%s", v, rest);
1127 ret = copy_to_user(release, buf, copy + 1); 1134 ret = copy_to_user(release, buf, copy + 1);
@@ -2210,11 +2217,21 @@ SYSCALL_DEFINE5(prctl, int, option, unsigned long, arg2, unsigned long, arg3,
2210 up_write(&me->mm->mmap_sem); 2217 up_write(&me->mm->mmap_sem);
2211 break; 2218 break;
2212 case PR_MPX_ENABLE_MANAGEMENT: 2219 case PR_MPX_ENABLE_MANAGEMENT:
2220 if (arg2 || arg3 || arg4 || arg5)
2221 return -EINVAL;
2213 error = MPX_ENABLE_MANAGEMENT(me); 2222 error = MPX_ENABLE_MANAGEMENT(me);
2214 break; 2223 break;
2215 case PR_MPX_DISABLE_MANAGEMENT: 2224 case PR_MPX_DISABLE_MANAGEMENT:
2225 if (arg2 || arg3 || arg4 || arg5)
2226 return -EINVAL;
2216 error = MPX_DISABLE_MANAGEMENT(me); 2227 error = MPX_DISABLE_MANAGEMENT(me);
2217 break; 2228 break;
2229 case PR_SET_FP_MODE:
2230 error = SET_FP_MODE(me, arg2);
2231 break;
2232 case PR_GET_FP_MODE:
2233 error = GET_FP_MODE(me);
2234 break;
2218 default: 2235 default:
2219 error = -EINVAL; 2236 error = -EINVAL;
2220 break; 2237 break;