diff options
| author | 2020-08-18 14:14:25 +0200 | |
|---|---|---|
| committer | 2020-08-18 14:14:25 +0200 | |
| commit | d85ddd1318e66c0c2665dbfcbc21a8b66c9152aa (patch) | |
| tree | e49e401abd2468b398d4bc84c7e05c2c2c3b0966 /kernel/sys.c | |
| parent | MAINTAINERS: Change maintainer for hisilicon DRM driver (diff) | |
| parent | Linux 5.9-rc1 (diff) | |
| download | wireguard-linux-d85ddd1318e66c0c2665dbfcbc21a8b66c9152aa.tar.xz wireguard-linux-d85ddd1318e66c0c2665dbfcbc21a8b66c9152aa.zip | |
Merge v5.9-rc1 into drm-misc-next
Sam needs 5.9-rc1 to have dev_err_probe in to merge some patches.
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
Diffstat (limited to 'kernel/sys.c')
| -rw-r--r-- | kernel/sys.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/kernel/sys.c b/kernel/sys.c index 00a96746e28a..ca11af9d815d 100644 --- a/kernel/sys.c +++ b/kernel/sys.c @@ -2007,12 +2007,15 @@ static int prctl_set_mm_map(int opt, const void __user *addr, unsigned long data if (prctl_map.exe_fd != (u32)-1) { /* - * Make sure the caller has the rights to - * change /proc/pid/exe link: only local sys admin should - * be allowed to. + * Check if the current user is checkpoint/restore capable. + * At the time of this writing, it checks for CAP_SYS_ADMIN + * or CAP_CHECKPOINT_RESTORE. + * Note that a user with access to ptrace can masquerade an + * arbitrary program as any executable, even setuid ones. + * This may have implications in the tomoyo subsystem. */ - if (!ns_capable(current_user_ns(), CAP_SYS_ADMIN)) - return -EINVAL; + if (!checkpoint_restore_ns_capable(current_user_ns())) + return -EPERM; error = prctl_set_mm_exe_file(mm, prctl_map.exe_fd); if (error) |
