lkml.org 
[lkml]   [2020]   [Mar]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH -mm] ipc-mqueuec-change-__do_notify-to-bypass-check_kill_permission-fix
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);
\
 
 \ /
  Last update: 2020-03-27 20:57    [W:0.058 / U:0.024 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site