From abace4d09e010df885b6558698421931a4d9d872 Mon Sep 17 00:00:00 2001 From: Doug Ledford Date: Thu, 31 May 2012 16:26:29 -0700 Subject: [PATCH] --- yaml --- r: 309758 b: refs/heads/master c: 02967ea08ede0f8cc7e0526aedffdae65a099b07 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/ipc/mqueue.c | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/[refs] b/[refs] index 83f795800b6d..9e3a272eb139 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 858ee3784e8105467f1f3017f4ece51cb51d4830 +refs/heads/master: 02967ea08ede0f8cc7e0526aedffdae65a099b07 diff --git a/trunk/ipc/mqueue.c b/trunk/ipc/mqueue.c index b103022179a3..6e10a55a78c5 100644 --- a/trunk/ipc/mqueue.c +++ b/trunk/ipc/mqueue.c @@ -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; } @@ -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 ||