diff options
Diffstat (limited to 'ipc/msg.c')
-rw-r--r-- | ipc/msg.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -429,8 +429,6 @@ asmlinkage long sys_msgctl (int msqid, int cmd, struct msqid_ds __user *buf) | |||
429 | return -EFAULT; | 429 | return -EFAULT; |
430 | if (copy_msqid_from_user (&setbuf, buf, version)) | 430 | if (copy_msqid_from_user (&setbuf, buf, version)) |
431 | return -EFAULT; | 431 | return -EFAULT; |
432 | if ((err = audit_ipc_perms(setbuf.qbytes, setbuf.uid, setbuf.gid, setbuf.mode))) | ||
433 | return err; | ||
434 | break; | 432 | break; |
435 | case IPC_RMID: | 433 | case IPC_RMID: |
436 | break; | 434 | break; |
@@ -461,6 +459,9 @@ asmlinkage long sys_msgctl (int msqid, int cmd, struct msqid_ds __user *buf) | |||
461 | switch (cmd) { | 459 | switch (cmd) { |
462 | case IPC_SET: | 460 | case IPC_SET: |
463 | { | 461 | { |
462 | if ((err = audit_ipc_perms(setbuf.qbytes, setbuf.uid, setbuf.gid, setbuf.mode, ipcp))) | ||
463 | goto out_unlock_up; | ||
464 | |||
464 | err = -EPERM; | 465 | err = -EPERM; |
465 | if (setbuf.qbytes > msg_ctlmnb && !capable(CAP_SYS_RESOURCE)) | 466 | if (setbuf.qbytes > msg_ctlmnb && !capable(CAP_SYS_RESOURCE)) |
466 | goto out_unlock_up; | 467 | goto out_unlock_up; |