mqueues: Add sysctl for max message count in a queue.
authorStathis Kamperis <beket@dragonflybsd.org>
Sat, 23 Jan 2010 11:29:53 +0000 (13:29 +0200)
committerStathis Kamperis <beket@dragonflybsd.org>
Sat, 23 Jan 2010 13:23:16 +0000 (15:23 +0200)
commit8658b626fa4839231ea8f05fc9349eb29777ab1d
tree0c5f5674ae39910f5514581265a8e7260f933210
parent711a015923054632de5d5f62c613ad242cf82e29
mqueues: Add sysctl for max message count in a queue.

A user could set mq_maxmsg (the maximal number of messages in a queue)
to a huge value on mq_open(O_CREAT) and later use up all kernel memory
by abusing mq_send(), resulting in a denial of service attack.

Add a sysctl'able limit which defaults to 16*mq_def_maxmsg.

Taken from NetBSD.
sys/kern/sys_mqueue.c