[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200421090426.GA6787@redhat.com>
Date: Tue, 21 Apr 2020 11:04:27 +0200
From: Oleg Nesterov <oleg@...hat.com>
To: "Eric W. Biederman" <ebiederm@...ssion.com>
Cc: linux-kernel@...r.kernel.org,
Christof Meerwald <cmeerw@...erw.org>,
Linux Containers <containers@...ts.linux-foundation.org>
Subject: Re: [PATCH] signal: Avoid corrupting si_pid and si_uid in
do_notify_parent
On 04/20, Eric W. Biederman wrote:
>
> The immediate problem is as Christof noticed that "pid_alive(current) == false".
this is slightly offtopic, but we can probably remove this "pid_alive" check,
pid_nr_ns() checks pid != NULL anyway.
> Inspecting the code it appears this problem has existed since the pid
> namespace support started handling this case
Agreed...
> @@ -1993,8 +1993,12 @@ bool do_notify_parent(struct task_struct *tsk, int sig)
> if (psig->action[SIGCHLD-1].sa.sa_handler == SIG_IGN)
> sig = 0;
> }
> + /*
> + * Bypass send_signal as the si_pid and si_uid values have
> + * been generated 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);
Acked-by: Oleg Nesterov <oleg@...hat.com>
Powered by blists - more mailing lists