diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2020-04-23 13:30:18 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2020-04-23 13:30:18 -0700 |
commit | b4f633221f0aeac102e463a4be46a643b2e3b819 (patch) | |
tree | 5ef3585fcdf16c913d4ae0229c61f9cb2ee8e4bb | |
parent | 25b1fa8dfb3fe2578c04a077953b13c534f30902 (diff) | |
parent | 61e713bdca3678e84815f2427f7a063fc353a1fc (diff) |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace
Pull SIGCHLD fix from Eric Biederman:
"Christof Meerwald reported that do_notify_parent has not been
successfully populating si_pid and si_uid for multi-threaded
processes.
This is the one-liner fix. Strictly speaking a one-liner plus
comment"
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace:
signal: Avoid corrupting si_pid and si_uid in do_notify_parent
-rw-r--r-- | kernel/signal.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/kernel/signal.c b/kernel/signal.c index 713104884414..284fc1600063 100644 --- a/kernel/signal.c +++ b/kernel/signal.c @@ -1989,8 +1989,12 @@ bool do_notify_parent(struct task_struct *tsk, int sig) if (psig->action[SIGCHLD-1].sa.sa_handler == SIG_IGN) sig = 0; } + /* + * Send with __send_signal as si_pid and si_uid are in the + * parent's namespaces. + */ if (valid_signal(sig) && sig) - __group_send_sig_info(sig, &info, tsk->parent); + __send_signal(sig, &info, tsk->parent, PIDTYPE_TGID, false); __wake_up_parent(tsk, tsk->parent); spin_unlock_irqrestore(&psig->siglock, flags); |