aboutsummaryrefslogtreecommitdiffstats
path: root/ipc/msg.c
diff options
context:
space:
mode:
Diffstat (limited to 'ipc/msg.c')
-rw-r--r--ipc/msg.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/ipc/msg.c b/ipc/msg.c
index 7385de25788a..a71af5a65abf 100644
--- a/ipc/msg.c
+++ b/ipc/msg.c
@@ -443,9 +443,12 @@ static int msgctl_down(struct ipc_namespace *ns, int msqid, int cmd,
443 goto out_unlock; 443 goto out_unlock;
444 } 444 }
445 445
446 err = ipc_update_perm(&msqid64.msg_perm, ipcp);
447 if (err)
448 goto out_unlock;
449
446 msq->q_qbytes = msqid64.msg_qbytes; 450 msq->q_qbytes = msqid64.msg_qbytes;
447 451
448 ipc_update_perm(&msqid64.msg_perm, ipcp);
449 msq->q_ctime = get_seconds(); 452 msq->q_ctime = get_seconds();
450 /* sleeping receivers might be excluded by 453 /* sleeping receivers might be excluded by
451 * stricter permissions. 454 * stricter permissions.
@@ -922,6 +925,7 @@ out:
922#ifdef CONFIG_PROC_FS 925#ifdef CONFIG_PROC_FS
923static int sysvipc_msg_proc_show(struct seq_file *s, void *it) 926static int sysvipc_msg_proc_show(struct seq_file *s, void *it)
924{ 927{
928 struct user_namespace *user_ns = seq_user_ns(s);
925 struct msg_queue *msq = it; 929 struct msg_queue *msq = it;
926 930
927 return seq_printf(s, 931 return seq_printf(s,
@@ -933,10 +937,10 @@ static int sysvipc_msg_proc_show(struct seq_file *s, void *it)
933 msq->q_qnum, 937 msq->q_qnum,
934 msq->q_lspid, 938 msq->q_lspid,
935 msq->q_lrpid, 939 msq->q_lrpid,
936 msq->q_perm.uid, 940 from_kuid_munged(user_ns, msq->q_perm.uid),
937 msq->q_perm.gid, 941 from_kgid_munged(user_ns, msq->q_perm.gid),
938 msq->q_perm.cuid, 942 from_kuid_munged(user_ns, msq->q_perm.cuid),
939 msq->q_perm.cgid, 943 from_kgid_munged(user_ns, msq->q_perm.cgid),
940 msq->q_stime, 944 msq->q_stime,
941 msq->q_rtime, 945 msq->q_rtime,
942 msq->q_ctime); 946 msq->q_ctime);