diff options
Diffstat (limited to 'ipc/mqueue.c')
-rw-r--r-- | ipc/mqueue.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/ipc/mqueue.c b/ipc/mqueue.c index 9a142a290749..9b7c8ab7d75c 100644 --- a/ipc/mqueue.c +++ b/ipc/mqueue.c | |||
@@ -32,6 +32,7 @@ | |||
32 | #include <linux/nsproxy.h> | 32 | #include <linux/nsproxy.h> |
33 | #include <linux/pid.h> | 33 | #include <linux/pid.h> |
34 | #include <linux/ipc_namespace.h> | 34 | #include <linux/ipc_namespace.h> |
35 | #include <linux/user_namespace.h> | ||
35 | #include <linux/slab.h> | 36 | #include <linux/slab.h> |
36 | 37 | ||
37 | #include <net/sock.h> | 38 | #include <net/sock.h> |
@@ -542,9 +543,13 @@ static void __do_notify(struct mqueue_inode_info *info) | |||
542 | sig_i.si_errno = 0; | 543 | sig_i.si_errno = 0; |
543 | sig_i.si_code = SI_MESGQ; | 544 | sig_i.si_code = SI_MESGQ; |
544 | sig_i.si_value = info->notify.sigev_value; | 545 | sig_i.si_value = info->notify.sigev_value; |
546 | /* map current pid/uid into info->owner's namespaces */ | ||
547 | rcu_read_lock(); | ||
545 | sig_i.si_pid = task_tgid_nr_ns(current, | 548 | sig_i.si_pid = task_tgid_nr_ns(current, |
546 | ns_of_pid(info->notify_owner)); | 549 | ns_of_pid(info->notify_owner)); |
547 | sig_i.si_uid = current_uid(); | 550 | sig_i.si_uid = user_ns_map_uid(info->user->user_ns, |
551 | current_cred(), current_uid()); | ||
552 | rcu_read_unlock(); | ||
548 | 553 | ||
549 | kill_pid_info(info->notify.sigev_signo, | 554 | kill_pid_info(info->notify.sigev_signo, |
550 | &sig_i, info->notify_owner); | 555 | &sig_i, info->notify_owner); |