mqueues: Partially sync with NetBSD.
authorStathis Kamperis <beket@dragonflybsd.org>
Fri, 15 Jan 2010 20:14:26 +0000 (22:14 +0200)
committerStathis Kamperis <beket@dragonflybsd.org>
Fri, 15 Jan 2010 20:22:28 +0000 (22:22 +0200)
commitc8b16402084f798630323f66751076ac7a064d4c
tree8257b6ca436faadb8b744f97bde19c9b1257d590
parent4eb19d560d343232d563e632faaaa697d9d8ecf7
mqueues: Partially sync with NetBSD.

This fixes the following critical issues:
* An invalid signal number passed to mq_notify() could crash the kernel
  upon the signal delivery.
* mq_send() to a full queue could crash the kernel due to NULL pointer
  dereference in timeout calculation.
* Likewise for mq_receive() from an empty queue.

Thanks to swildner@ for bringing this into my attention.
sys/kern/sys_mqueue.c