From: Oleg Nesterov <oleg@redhat.com>
To: "Eric W. Biederman" <ebiederm@xmission.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
Davidlohr Bueso <dave@stgolabs.net>,
Manfred Spraul <manfred@colorfullife.com>,
Markus Elfring <elfring@users.sourceforge.net>,
Yoji <yoji.fujihar.min@gmail.com>,
linux-kernel@vger.kernel.org
Subject: [PATCH -mm] ipc-mqueuec-change-__do_notify-to-bypass-check_kill_permission-fix
Date: Fri, 27 Mar 2020 20:56:43 +0100 [thread overview]
Message-ID: <20200327195643.GA9366@redhat.com> (raw)
In-Reply-To: <87v9mr1dlf.fsf@x220.int.ebiederm.org>
On 03/26, Eric W. Biederman wrote:
>
> > + task = pid_task(info->notify_owner, PIDTYPE_PID);
> ^^^^^^^^^^^^
> Minor nit: If we are doing the task lookup ourselves that can and
> should be PIDTYPE_TGID.
I think this shouldn't make any difference, in particular because
do_mq_notify() does "notify_owner = task_tgid()" and we do not care
about exec.
But I agree, pid_task(PIDTYPE_TGID) looks better, thanks.
diff --git a/ipc/mqueue.c b/ipc/mqueue.c
index 63b164932ffd..9a44dcb04e13 100644
--- a/ipc/mqueue.c
+++ b/ipc/mqueue.c
@@ -801,7 +801,7 @@ static void __do_notify(struct mqueue_inode_info *info)
* bypass check_kill_permission(). It is from kernel
* but si_fromuser() can't know this.
*/
- task = pid_task(info->notify_owner, PIDTYPE_PID);
+ task = pid_task(info->notify_owner, PIDTYPE_TGID);
if (task)
do_send_sig_info(info->notify.sigev_signo,
&sig_i, task, PIDTYPE_TGID);
prev parent reply other threads:[~2020-03-27 19:56 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-22 11:09 [PATCH] ipc/mqueue.c: change __do_notify() to bypass check_kill_permission() Oleg Nesterov
2020-03-22 14:17 ` Eric W. Biederman
2020-03-22 14:59 ` Eric W. Biederman
2020-03-22 20:29 ` Oleg Nesterov
2020-03-23 16:47 ` Eric W. Biederman
2020-03-24 2:12 ` Andrew Morton
2020-03-24 2:57 ` Eric W. Biederman
2020-03-24 11:52 ` Oleg Nesterov
2020-03-24 20:08 ` Oleg Nesterov
2020-03-24 10:35 ` Oleg Nesterov
2020-03-24 20:09 ` [PATCH V2] " Oleg Nesterov
2020-03-26 12:54 ` Eric W. Biederman
2020-03-27 19:56 ` Oleg Nesterov [this message]
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=20200327195643.GA9366@redhat.com \
--to=oleg@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=dave@stgolabs.net \
--cc=ebiederm@xmission.com \
--cc=elfring@users.sourceforge.net \
--cc=linux-kernel@vger.kernel.org \
--cc=manfred@colorfullife.com \
--cc=yoji.fujihar.min@gmail.com \
/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;
as well as URLs for NNTP newsgroup(s).