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)
committerSascha Wildner <saw@online.de>
Sat, 14 Jul 2012 04:33:12 +0000 (06:33 +0200)
commitb4ff333e9005d88cb2dde8fc6552780f730603f3
treea8e87fbd54192579cc9a2e12471bf8ee01226243
parenta1417c6dafae947ec8152c53748995dbf1b5526f
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