kernel - Fix MP race in sysv semaphore code
authorMatthew Dillon <dillon@apollo.backplane.com>
Wed, 11 Jul 2012 22:29:55 +0000 (15:29 -0700)
committerMatthew Dillon <dillon@apollo.backplane.com>
Wed, 11 Jul 2012 22:29:55 +0000 (15:29 -0700)
commitead166eb4dd3c39eebe6407577f577dee061c743
treef464c78f47891c6235a1dd0a65fda264522d4d5b
parent9c104da7967d7be5e4548491bd7aee945003d382
kernel - Fix MP race in sysv semaphore code

* Fix a serious MP race in the sysv semaphore code due to a lack of
  protection of the semu* global structures.

* The race occurs during semaphore allocation and deallocation vs ANY
  exiting process (even if it does not use semaphores), potentially
  leading to a live-lock in the semu_list scan code.

  The live-lock will prevent the cpu it occurs on from being able to
  switch to another kernel or user thread.  In the sample case it
  stopped pagedaemon from running, creating a backlog in the I/O
  subsystem which locked the computer up.

Reported-by: Peter Avalos
sys/kern/sysv_sem.c