]> git.karo-electronics.de Git - karo-tx-linux.git/commit
ipc/mqueue: strengthen checks on mqueue creation
authorDoug Ledford <dledford@redhat.com>
Thu, 3 May 2012 05:44:52 +0000 (15:44 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Thu, 3 May 2012 05:47:02 +0000 (15:47 +1000)
commit9a169606b99a7212131ef5f4dfc6bdf7d6f17d59
tree02f95f10486c5f352612c3359bff2dca9c27d778
parent2d7e900e111a4a2775c56f5afac8a0aff2a21e90
ipc/mqueue: strengthen checks on mqueue creation

We already check the mq attr struct if it's passed in, but now that the
admin can set system wide defaults separate from maximums, it's actually
possible to set the defaults to something that would overflow.  So, if
there is no attr struct passed in to the open call, check the default
values.

While we are at it, simplify mq_attr_ok() by making it return 0 or an
error condition, so that way if we add more tests to it later, we have the
option of what error should be returned instead of the calling location
having to pick a possibly inaccurate error code.

Signed-off-by: Doug Ledford <dledford@redhat.com>
Cc: Stephen Rothwell <sfr@canb.auug.org.au>
Cc: Manfred Spraul <manfred@colorfullife.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
ipc/mqueue.c