kernel - Fix lockmgr non-zero exclusive count panic
authorMatthew Dillon <dillon@apollo.backplane.com>
Wed, 29 Dec 2010 08:32:27 +0000 (00:32 -0800)
committerMatthew Dillon <dillon@apollo.backplane.com>
Wed, 29 Dec 2010 08:35:55 +0000 (00:35 -0800)
commit7a4c56501df11e04efafe58591214c5806606c25
treef6ccfe44ed24b094042d2784a1496ae5d2e2f4c5
parent8e0ec33bba020ab4df73731289378aee28caf399
kernel - Fix lockmgr non-zero exclusive count panic

* The vm_map lock uses shared & exclusive locks and tries to upgrade
  shared to exclusive.  There is a race where a shared upgrade can
  steal an exclusive lock from an exclusive request which has already
  acquired the LK_WANT_EXCL flag.

* Deal with the case by having the exclusive lock also acquire
  LK_HAVE_EXCL to catch any shared upgrades which beat out the
  request.

Reported-by: YONETANI Tomokazu <qhwt.dfly@les.ath.cx>
Researched-by: YONETANI Tomokazu <qhwt.dfly@les.ath.cx>
sys/kern/kern_lock.c