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