c/r: prctl: Return -EFAULT instead of -EINVAL in case if underlied VMA is not found
PATCH 1/1 c/r: prctl: Return -EFAULT instead of -EINVAL in case if underlied VMA is not found
In case if underlied VMA is not found prctl_set_mm will return -EINVAL, but Michael proposed to return -EFAULT and Kosaki seconded. Make it so.
--- kernel/sys.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
kernel/sys.c +3 -1
@@ -1838,8 +1838,10 @@ static int prctl_set_mm(int opt, unsignecase PR_SET_MM_ARG_END :case PR_SET_MM_ENV_START :case PR_SET_MM_ENV_END : -if (!vma) +if (!vma) { + error = -EFAULT ; goto out; + }#ifdef CONFIG_STACK_GROWSUP if (vma_flags_mismatch (vma,VM_READ |VM_WRITE |VM_GROWSUP ,0 )) #else
Quoted 6 lines · Cyrill Gorcunov
In case if underlied VMA is not found
prctl_set_mmwill return-EINVAL, but Michael proposed to return-EFAULTand Kosaki seconded. Make it so.Signed-off-by Cyrill Gorcunov <[email protected]>
-Kees
Signature · 2 lines
Kees Cook Chrome OS Security
KOSAKI Motohiro
Acked-byQuoted 9 lines · Kees Cook
Quoted 6 lines · Cyrill Gorcunov
In case if underlied VMA is not found
prctl_set_mmwill return-EINVAL, but Michael proposed to return-EFAULTand Kosaki seconded. Make it so.Signed-off-by Cyrill Gorcunov <[email protected]>Acked-by Kees Cook <[email protected]>
Michael Kerrisk (man-pages)
Acked-byQuoted 6 lines · KOSAKI Motohiro
Quoted 5 lines · Kees Cook
Quoted 4 lines · Cyrill Gorcunov
In case if underlied VMA is not found
prctl_set_mmwill return-EINVAL, but Michael proposed to return-EFAULTand Kosaki seconded. Make it so.
Quoted 6 lines
Quoted 4 lines
Quoted 2 lines
Signed-off-by Cyrill Gorcunov <[email protected]>Acked-by Kees Cook <[email protected]>Acked-by KOSAKI Motohiro <[email protected]>
Signature · 3 lines
Michael Kerrisk Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/ Author of "The Linux Programming Interface"; http://man7.org/tlpi/
Quoted 4 lines · Cyrill Gorcunov
In case if underlied VMA is not found
prctl_set_mmwill return-EINVAL, but Michael proposed to return-EFAULTand Kosaki seconded. Make it so.
Quoted 9 lines
Signed-off-by Cyrill Gorcunov <[email protected]>Cc KOSAKI Motohiro <[email protected]>Cc Pavel Emelyanov <[email protected]>,Cc Tejun Heo <[email protected]>Cc Kees Cook <[email protected]>Cc Serge Hallyn <[email protected]>Cc KAMEZAWA Hiroyuki <[email protected]>Cc Andrew Morton <[email protected]>