lkml.org 
[lkml]   [2012]   [May]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [Patch 3/4] ipc/mqueue: strengthen checks on mqueue creation
On Tue, 01 May 2012 19:04:53 -0400
KOSAKI Motohiro <kosaki.motohiro@gmail.com> wrote:

> > OK, then would EOVERFLOW suit things better?
>
> I have no seen to any confusion source this. thank you.

--- a/ipc/mqueue.c~ipc-mqueue-strengthen-checks-on-mqueue-creation-fix
+++ a/ipc/mqueue.c
@@ -687,13 +687,13 @@ static int mq_attr_ok(struct ipc_namespa
}
/* check for overflow */
if (attr->mq_msgsize > ULONG_MAX/attr->mq_maxmsg)
- return -ENOMEM;
+ return -EOVERFLOW;
mq_treesize = attr->mq_maxmsg * sizeof(struct msg_msg) +
min_t(unsigned int, attr->mq_maxmsg, MQ_PRIO_MAX) *
sizeof(struct posix_msg_tree_node);
total_size = attr->mq_maxmsg * attr->mq_msgsize;
if (total_size + mq_treesize < total_size)
- return -ENOMEM;
+ return -EOVERFLOW;
return 0;
}

_


\
 
 \ /
  Last update: 2012-05-02 01:21    [from the cache]
©2003-2011 Jasper Spaans