Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 305986
b: refs/heads/master
c: 6f9ac6d
h: refs/heads/master
v: v3
  • Loading branch information
Eric W. Biederman committed Apr 7, 2012
1 parent 1fc87ba commit 2deb57d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: aeb3ae9da9b50a386b22af786d19b623e8d9f0fa
refs/heads/master: 6f9ac6d93a0916de09d11b0a247ade8f4347728b
9 changes: 8 additions & 1 deletion trunk/ipc/mqueue.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ struct mqueue_inode_info {

struct sigevent notify;
struct pid* notify_owner;
struct user_namespace *notify_user_ns;
struct user_struct *user; /* user who created, for accounting */
struct sock *notify_sock;
struct sk_buff *notify_cookie;
Expand Down Expand Up @@ -139,6 +140,7 @@ static struct inode *mqueue_get_inode(struct super_block *sb,
INIT_LIST_HEAD(&info->e_wait_q[0].list);
INIT_LIST_HEAD(&info->e_wait_q[1].list);
info->notify_owner = NULL;
info->notify_user_ns = NULL;
info->qsize = 0;
info->user = NULL; /* set when all is ok */
memset(&info->attr, 0, sizeof(info->attr));
Expand Down Expand Up @@ -536,7 +538,7 @@ static void __do_notify(struct mqueue_inode_info *info)
rcu_read_lock();
sig_i.si_pid = task_tgid_nr_ns(current,
ns_of_pid(info->notify_owner));
sig_i.si_uid = user_ns_map_uid(info->user->user_ns,
sig_i.si_uid = user_ns_map_uid(info->notify_user_ns,
current_cred(), current_uid());
rcu_read_unlock();

Expand All @@ -550,7 +552,9 @@ static void __do_notify(struct mqueue_inode_info *info)
}
/* after notification unregisters process */
put_pid(info->notify_owner);
put_user_ns(info->notify_user_ns);
info->notify_owner = NULL;
info->notify_user_ns = NULL;
}
wake_up(&info->wait_q);
}
Expand All @@ -575,7 +579,9 @@ static void remove_notification(struct mqueue_inode_info *info)
netlink_sendskb(info->notify_sock, info->notify_cookie);
}
put_pid(info->notify_owner);
put_user_ns(info->notify_user_ns);
info->notify_owner = NULL;
info->notify_user_ns = NULL;
}

static int mq_attr_ok(struct ipc_namespace *ipc_ns, struct mq_attr *attr)
Expand Down Expand Up @@ -1140,6 +1146,7 @@ SYSCALL_DEFINE2(mq_notify, mqd_t, mqdes,
}

info->notify_owner = get_pid(task_tgid(current));
info->notify_user_ns = get_user_ns(current_user_ns());
inode->i_atime = inode->i_ctime = CURRENT_TIME;
}
spin_unlock(&info->lock);
Expand Down

0 comments on commit 2deb57d

Please sign in to comment.