From: Nicolas Viennot Date: Sun, 19 Jul 2020 10:04:16 +0000 (+0200) Subject: prctl: exe link permission error changed from -EINVAL to -EPERM X-Git-Tag: v5.9-rc1~161^2~1 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=227175b2c914bfa4a9aa5b210c7cabd42c5858ac;p=thirdparty%2Fkernel%2Flinux.git prctl: exe link permission error changed from -EINVAL to -EPERM This brings consistency with the rest of the prctl() syscall where -EPERM is returned when failing a capability check. Signed-off-by: Nicolas Viennot Signed-off-by: Adrian Reber Reviewed-by: Serge Hallyn Link: https://lore.kernel.org/r/20200719100418.2112740-7-areber@redhat.com Signed-off-by: Christian Brauner --- diff --git a/kernel/sys.c b/kernel/sys.c index a3f4ef0bbda33..ca11af9d815d9 100644 --- a/kernel/sys.c +++ b/kernel/sys.c @@ -2015,7 +2015,7 @@ static int prctl_set_mm_map(int opt, const void __user *addr, unsigned long data * This may have implications in the tomoyo subsystem. */ if (!checkpoint_restore_ns_capable(current_user_ns())) - return -EINVAL; + return -EPERM; error = prctl_set_mm_exe_file(mm, prctl_map.exe_fd); if (error)