kernel - Fix nstopped SMP race during core dump
commit9cab665443b9e809e396eb34d9af986673056da1
authorMatthew Dillon <dillon@apollo.backplane.com>
Thu, 29 Nov 2018 06:56:24 +0000 (28 22:56 -0800)
committerMatthew Dillon <dillon@apollo.backplane.com>
Sat, 1 Dec 2018 05:12:08 +0000 (30 21:12 -0800)
tree503dece50079a73a4983cff85b8c71526f26dd32
parent962411e01b4f3d7d986683b932a711603b1f154f
kernel - Fix nstopped SMP race during core dump

* During a process core dump, p->p_nstopped can be adjusted without
  holding p->p_token, resulting in a SMP race which can cause
  p_nstopped to become permanently desynchronized and deadlock the
  process.

* Be robust in a p_nstopped handling case in kern_exit, just in case.
sys/kern/kern_exit.c
sys/kern/kern_synch.c