aboutsummaryrefslogtreecommitdiffstats
path: root/ipc/msg.c
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-10-19 16:05:38 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-10-19 16:05:38 -0400
commita7204d72db251784808b0c050220992d7f833a2c (patch)
tree3491452ea74b039f3278fd95bb7ad7c88b6b3631 /ipc/msg.c
parentba6857b2d49646f2d4c245ff58d95d145f380177 (diff)
parent31d141e3a666269a3b6fcccddb0351caf7454240 (diff)
Merge 3.12-rc6 into driver-core-next
We want these fixes here too. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'ipc/msg.c')
-rw-r--r--ipc/msg.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/ipc/msg.c b/ipc/msg.c
index 9e4310c546ae..558aa91186b6 100644
--- a/ipc/msg.c
+++ b/ipc/msg.c
@@ -695,6 +695,12 @@ long do_msgsnd(int msqid, long mtype, void __user *mtext,
695 if (ipcperms(ns, &msq->q_perm, S_IWUGO)) 695 if (ipcperms(ns, &msq->q_perm, S_IWUGO))
696 goto out_unlock0; 696 goto out_unlock0;
697 697
698 /* raced with RMID? */
699 if (msq->q_perm.deleted) {
700 err = -EIDRM;
701 goto out_unlock0;
702 }
703
698 err = security_msg_queue_msgsnd(msq, msg, msgflg); 704 err = security_msg_queue_msgsnd(msq, msg, msgflg);
699 if (err) 705 if (err)
700 goto out_unlock0; 706 goto out_unlock0;
@@ -901,6 +907,13 @@ long do_msgrcv(int msqid, void __user *buf, size_t bufsz, long msgtyp, int msgfl
901 goto out_unlock1; 907 goto out_unlock1;
902 908
903 ipc_lock_object(&msq->q_perm); 909 ipc_lock_object(&msq->q_perm);
910
911 /* raced with RMID? */
912 if (msq->q_perm.deleted) {
913 msg = ERR_PTR(-EIDRM);
914 goto out_unlock0;
915 }
916
904 msg = find_msg(msq, &msgtyp, mode); 917 msg = find_msg(msq, &msgtyp, mode);
905 if (!IS_ERR(msg)) { 918 if (!IS_ERR(msg)) {
906 /* 919 /*