diff options
Diffstat (limited to 'ipc/msg.c')
-rw-r--r-- | ipc/msg.c | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -421,7 +421,7 @@ static int msgctl_down(struct ipc_namespace *ns, int msqid, int cmd, | |||
421 | return -EFAULT; | 421 | return -EFAULT; |
422 | } | 422 | } |
423 | 423 | ||
424 | ipcp = ipcctl_pre_down(&msg_ids(ns), msqid, cmd, | 424 | ipcp = ipcctl_pre_down(ns, &msg_ids(ns), msqid, cmd, |
425 | &msqid64.msg_perm, msqid64.msg_qbytes); | 425 | &msqid64.msg_perm, msqid64.msg_qbytes); |
426 | if (IS_ERR(ipcp)) | 426 | if (IS_ERR(ipcp)) |
427 | return PTR_ERR(ipcp); | 427 | return PTR_ERR(ipcp); |
@@ -539,7 +539,7 @@ SYSCALL_DEFINE3(msgctl, int, msqid, int, cmd, struct msqid_ds __user *, buf) | |||
539 | success_return = 0; | 539 | success_return = 0; |
540 | } | 540 | } |
541 | err = -EACCES; | 541 | err = -EACCES; |
542 | if (ipcperms(&msq->q_perm, S_IRUGO)) | 542 | if (ipcperms(ns, &msq->q_perm, S_IRUGO)) |
543 | goto out_unlock; | 543 | goto out_unlock; |
544 | 544 | ||
545 | err = security_msg_queue_msgctl(msq, cmd); | 545 | err = security_msg_queue_msgctl(msq, cmd); |
@@ -664,7 +664,7 @@ long do_msgsnd(int msqid, long mtype, void __user *mtext, | |||
664 | struct msg_sender s; | 664 | struct msg_sender s; |
665 | 665 | ||
666 | err = -EACCES; | 666 | err = -EACCES; |
667 | if (ipcperms(&msq->q_perm, S_IWUGO)) | 667 | if (ipcperms(ns, &msq->q_perm, S_IWUGO)) |
668 | goto out_unlock_free; | 668 | goto out_unlock_free; |
669 | 669 | ||
670 | err = security_msg_queue_msgsnd(msq, msg, msgflg); | 670 | err = security_msg_queue_msgsnd(msq, msg, msgflg); |
@@ -704,7 +704,7 @@ long do_msgsnd(int msqid, long mtype, void __user *mtext, | |||
704 | msq->q_stime = get_seconds(); | 704 | msq->q_stime = get_seconds(); |
705 | 705 | ||
706 | if (!pipelined_send(msq, msg)) { | 706 | if (!pipelined_send(msq, msg)) { |
707 | /* noone is waiting for this message, enqueue it */ | 707 | /* no one is waiting for this message, enqueue it */ |
708 | list_add_tail(&msg->m_list, &msq->q_messages); | 708 | list_add_tail(&msg->m_list, &msq->q_messages); |
709 | msq->q_cbytes += msgsz; | 709 | msq->q_cbytes += msgsz; |
710 | msq->q_qnum++; | 710 | msq->q_qnum++; |
@@ -774,7 +774,7 @@ long do_msgrcv(int msqid, long *pmtype, void __user *mtext, | |||
774 | struct list_head *tmp; | 774 | struct list_head *tmp; |
775 | 775 | ||
776 | msg = ERR_PTR(-EACCES); | 776 | msg = ERR_PTR(-EACCES); |
777 | if (ipcperms(&msq->q_perm, S_IRUGO)) | 777 | if (ipcperms(ns, &msq->q_perm, S_IRUGO)) |
778 | goto out_unlock; | 778 | goto out_unlock; |
779 | 779 | ||
780 | msg = ERR_PTR(-EAGAIN); | 780 | msg = ERR_PTR(-EAGAIN); |
@@ -842,7 +842,7 @@ long do_msgrcv(int msqid, long *pmtype, void __user *mtext, | |||
842 | * Disable preemption. We don't hold a reference to the queue | 842 | * Disable preemption. We don't hold a reference to the queue |
843 | * and getting a reference would defeat the idea of a lockless | 843 | * and getting a reference would defeat the idea of a lockless |
844 | * operation, thus the code relies on rcu to guarantee the | 844 | * operation, thus the code relies on rcu to guarantee the |
845 | * existance of msq: | 845 | * existence of msq: |
846 | * Prior to destruction, expunge_all(-EIRDM) changes r_msg. | 846 | * Prior to destruction, expunge_all(-EIRDM) changes r_msg. |
847 | * Thus if r_msg is -EAGAIN, then the queue not yet destroyed. | 847 | * Thus if r_msg is -EAGAIN, then the queue not yet destroyed. |
848 | * rcu_read_lock() prevents preemption between reading r_msg | 848 | * rcu_read_lock() prevents preemption between reading r_msg |