kernel - Fix additional races in lwp_signotify()
authorMatthew Dillon <dillon@apollo.backplane.com>
Thu, 17 Nov 2011 18:44:16 +0000 (10:44 -0800)
committerMatthew Dillon <dillon@apollo.backplane.com>
Thu, 17 Nov 2011 18:44:16 +0000 (10:44 -0800)
commit81cd8ede74a6a09d318c1642787a8b8936374786
treed73e100a0227cd1b7ad48acd40664455aa282f90
parent47538602cfcaf8cbba97edc7b0fe47de8088e694
kernel - Fix additional races in lwp_signotify()

* lwp_signotify() was improperly scheduling threads whos td_gd is on the
  local cpu without checking the SINTR flags.  This can catch a thread in
  the middle of being transitioned to another cpu and cause havoc.

* Only schedule the thread if the SINTR flags are set.

* We can't call setrunnable() from an IPI so adjustments have to be made
  in the remote cpu to set the lp's lwp_stat state before issuing the IPI
  and only do the scheduling of its thread from the IPI function.

Reported-by: ftigeot
sys/kern/kern_sig.c