Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 309758
b: refs/heads/master
c: 02967ea
h: refs/heads/master
v: v3
  • Loading branch information
Doug Ledford authored and Linus Torvalds committed Jun 1, 2012
1 parent bc99c5e commit abace4d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 858ee3784e8105467f1f3017f4ece51cb51d4830
refs/heads/master: 02967ea08ede0f8cc7e0526aedffdae65a099b07
8 changes: 5 additions & 3 deletions trunk/ipc/mqueue.c
Original file line number Diff line number Diff line change
Expand Up @@ -301,8 +301,9 @@ static int mqueue_create(struct inode *dir, struct dentry *dentry,
error = -EACCES;
goto out_unlock;
}
if (ipc_ns->mq_queues_count >= ipc_ns->mq_queues_max &&
!capable(CAP_SYS_RESOURCE)) {
if (ipc_ns->mq_queues_count >= HARD_QUEUESMAX ||
(ipc_ns->mq_queues_count >= ipc_ns->mq_queues_max &&
!capable(CAP_SYS_RESOURCE))) {
error = -ENOSPC;
goto out_unlock;
}
Expand Down Expand Up @@ -589,7 +590,8 @@ static int mq_attr_ok(struct ipc_namespace *ipc_ns, struct mq_attr *attr)
if (attr->mq_maxmsg <= 0 || attr->mq_msgsize <= 0)
return 0;
if (capable(CAP_SYS_RESOURCE)) {
if (attr->mq_maxmsg > HARD_MSGMAX)
if (attr->mq_maxmsg > HARD_MSGMAX ||
attr->mq_msgsize > HARD_MSGSIZEMAX)
return 0;
} else {
if (attr->mq_maxmsg > ipc_ns->mq_msg_max ||
Expand Down

0 comments on commit abace4d

Please sign in to comment.