Commit e67eee86 authored by Andi Kleen's avatar Andi Kleen Committed by Linus Torvalds

[PATCH] Fix error checking in IPC_SET

The LSM changes broke the error checking for queue lengths in IPC_SET. The LSM check would
set set err to 0, but the next check expected it to still be -EPERM. Result was that
no error was reported, but the new parameters weren't correctly set.
parent 76c403c4
...@@ -557,6 +557,7 @@ asmlinkage long sys_msgctl (int msqid, int cmd, struct msqid_ds *buf) ...@@ -557,6 +557,7 @@ asmlinkage long sys_msgctl (int msqid, int cmd, struct msqid_ds *buf)
switch (cmd) { switch (cmd) {
case IPC_SET: case IPC_SET:
{ {
err = -EPERM;
if (setbuf.qbytes > msg_ctlmnb && !capable(CAP_SYS_RESOURCE)) if (setbuf.qbytes > msg_ctlmnb && !capable(CAP_SYS_RESOURCE))
goto out_unlock_up; goto out_unlock_up;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment