[Devel] [PATCH RHEL7 COMMIT] Improve vps_dumpable check in __ptrace_may_access()
Vasily Averin
vvs at virtuozzo.com
Wed Jan 13 13:25:20 MSK 2021
The commit is pushed to "branch-rh7-3.10.0-1160.11.1.vz7.172.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-1160.11.1.vz7.172.9
------>
commit 9c9eb0f3b907a14875ab307466721a81b68bf3ee
Author: Vasily Averin <vvs at virtuozzo.com>
Date: Wed Jan 13 13:25:20 2021 +0300
Improve vps_dumpable check in __ptrace_may_access()
__ptrace_may_access() is used when someone tries to
readlink /proc/$PID/ns/$SOMENS and gets -EPERM for kthreads
because they lack task->mm and thus "vps_dumpable" field.
Let's return error only for non-kernel threads and follow usual
restrictions for kernel threads.
https://jira.sw.ru/browse/PSBM-92107
Signed-off-by: Vasily Averin <vvs at virtuozzo.com>
---
kernel/ptrace.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/ptrace.c b/kernel/ptrace.c
index 4b7dd80..a3622fe 100644
--- a/kernel/ptrace.c
+++ b/kernel/ptrace.c
@@ -294,7 +294,7 @@ ok:
rcu_read_unlock();
return -EPERM;
}
- if (!vps_dumpable && !ve_is_super(get_exec_env())) {
+ if (task->mm && !vps_dumpable && !ve_is_super(get_exec_env())) {
rcu_read_unlock();
return -EPERM;
}
More information about the Devel
mailing list