From: Oleg Nesterov Date: Sun, 8 Jan 2006 09:03:59 +0000 (-0800) Subject: [PATCH] setpgid: should not accept ptraced childs X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=f7dd795e913656c390b6bde27790c518973feea1;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git [PATCH] setpgid: should not accept ptraced childs sys_setpgid() allows to change ->pgrp of ptraced childs. 'man setpgid' does not tell anything about that, so I consider this behaviour is a bug. Signed-off-by: Oleg Nesterov Cc: Oren Laadan Cc: Roland McGrath Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/kernel/sys.c b/kernel/sys.c index f497bf56ada1..218937e837dc 100644 --- a/kernel/sys.c +++ b/kernel/sys.c @@ -1114,7 +1114,7 @@ asmlinkage long sys_setpgid(pid_t pid, pid_t pgid) if (!thread_group_leader(p)) goto out; - if (p->parent == current || p->real_parent == group_leader) { + if (p->real_parent == group_leader) { err = -EPERM; if (p->signal->session != group_leader->signal->session) goto out;