From: Christian Brauner <christian@brauner.io>
To: Oleg Nesterov <oleg@redhat.com>
Cc: Jann Horn <jannh@google.com>,
"Eric W. Biederman" <ebiederm@xmission.com>,
Arnd Bergmann <arnd@arndb.de>,
Thomas Gleixner <tglx@linutronix.de>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] signal: don't silently convert SI_USER signals to non-current pidfd
Date: Wed, 17 Apr 2019 15:03:37 +0200 [thread overview]
Message-ID: <20190417130336.i55vmf3x6cby2mvi@brauner.io> (raw)
In-Reply-To: <20190408131315.GA24111@redhat.com>
On Mon, Apr 08, 2019 at 03:13:16PM +0200, Oleg Nesterov wrote:
> On 03/30, Jann Horn wrote:
> >
> > --- a/kernel/signal.c
> > +++ b/kernel/signal.c
> > @@ -3605,16 +3605,11 @@ SYSCALL_DEFINE4(pidfd_send_signal, int, pidfd, int, sig,
> > if (unlikely(sig != kinfo.si_signo))
> > goto err;
> >
> > + /* Only allow sending arbitrary signals to yourself. */
> > + ret = -EPERM;
> > if ((task_pid(current) != pid) &&
> > - (kinfo.si_code >= 0 || kinfo.si_code == SI_TKILL)) {
> > - /* Only allow sending arbitrary signals to yourself. */
> > - ret = -EPERM;
> > - if (kinfo.si_code != SI_USER)
> > - goto err;
> > -
> > - /* Turn this into a regular kill signal. */
> > - prepare_kill_siginfo(sig, &kinfo);
> > - }
> > + (kinfo.si_code >= 0 || kinfo.si_code == SI_TKILL))
> > + goto err;
>
> ACK.
>
Sorry Oleg. I missed that message somehow.
>
> but perhaps it should always fail, even if task_pid(current) == pid.
>
> sys_rt_sigqueueinfo() allows to send any siginfo to yourself, but this is only needed
> for checkpoint/restart.
Yes, that's why this was added. I would leave it in exactly because of
checkpoint/restart. I have sympathies for "this [...] project by various
mad Russians" [1] and it doesn't really hurt us. :)
[1]: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=099469502f62fbe0d7e4f0b83a2f22538367f734
Christian
next prev parent reply other threads:[~2019-04-17 13:03 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-03-30 2:12 Jann Horn
2019-03-30 2:17 ` Christian Brauner
2019-04-08 13:13 ` Oleg Nesterov
2019-04-17 13:03 ` Christian Brauner [this message]
2019-04-17 13:16 ` Oleg Nesterov
2019-04-17 13:19 ` Christian Brauner
2019-04-17 13:50 ` Oleg Nesterov
2019-04-17 14:13 ` Christian Brauner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190417130336.i55vmf3x6cby2mvi@brauner.io \
--to=christian@brauner.io \
--cc=arnd@arndb.de \
--cc=ebiederm@xmission.com \
--cc=jannh@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=oleg@redhat.com \
--cc=tglx@linutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®