Skip to content

Commit 636e348

Browse files
ojedaakpm00
authored andcommitted
prctl: move PR_GET_AUXV out of PR_MCE_KILL
Somehow PR_GET_AUXV got added into PR_MCE_KILL's switch when the patch was applied [1]. Thus move it out of the switch, to the place the patch added it. In the recently released v6.4 kernel some user could, in principle, be already using this feature by mapping the right page and passing the PR_GET_AUXV constant as a pointer: prctl(PR_MCE_KILL, PR_GET_AUXV, ...) So this does change the behavior for users. We could keep the bug since the other subcases in PR_MCE_KILL (PR_MCE_KILL_CLEAR and PR_MCE_KILL_SET) do not overlap. However, v6.4 may be recent enough (2 weeks old) that moving the lines (rather than just adding a new case) does not break anybody? Moreover, the documentation in man-pages was just committed today [2]. Link: https://lkml.kernel.org/r/[email protected] Fixes: ddc6597 ("prctl: add PR_GET_AUXV to copy auxv to userspace") Link: https://lore.kernel.org/all/d81864a7f7f43bca6afa2a09fc2e850e4050ab42.1680611394.git.josh@joshtriplett.org/ [1] Link: https://git.kernel.org/pub/scm/docs/man-pages/man-pages.git/commit/?id=8cf0c06bfd3c2b219b044d4151c96f0da50af9ad [2] Signed-off-by: Miguel Ojeda <[email protected]> Cc: Josh Triplett <[email protected]> Cc: <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
1 parent f13be0a commit 636e348

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

kernel/sys.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2535,11 +2535,6 @@ SYSCALL_DEFINE5(prctl, int, option, unsigned long, arg2, unsigned long, arg3,
25352535
else
25362536
return -EINVAL;
25372537
break;
2538-
case PR_GET_AUXV:
2539-
if (arg4 || arg5)
2540-
return -EINVAL;
2541-
error = prctl_get_auxv((void __user *)arg2, arg3);
2542-
break;
25432538
default:
25442539
return -EINVAL;
25452540
}
@@ -2694,6 +2689,11 @@ SYSCALL_DEFINE5(prctl, int, option, unsigned long, arg2, unsigned long, arg3,
26942689
case PR_SET_VMA:
26952690
error = prctl_set_vma(arg2, arg3, arg4, arg5);
26962691
break;
2692+
case PR_GET_AUXV:
2693+
if (arg4 || arg5)
2694+
return -EINVAL;
2695+
error = prctl_get_auxv((void __user *)arg2, arg3);
2696+
break;
26972697
#ifdef CONFIG_KSM
26982698
case PR_SET_MEMORY_MERGE:
26992699
if (arg3 || arg4 || arg5)

0 commit comments

Comments
 (0)