summaryrefslogtreecommitdiff
path: root/gnu
diff options
context:
space:
mode:
authorVitaliy Makkoveev <mvs@cvs.openbsd.org>2024-08-11 15:10:54 +0000
committerVitaliy Makkoveev <mvs@cvs.openbsd.org>2024-08-11 15:10:54 +0000
commit26825a9eaa696b9cd0238bdb598417e6f6237424 (patch)
tree0ed5210f252a7005ccdc372d61e8cf5442aa6223 /gnu
parent47ae1e7bb0aab55d429ff5b6cc2442521544ea33 (diff)
Make exit1() wait sysctl(2) `allprocess' loops.
Regardless on wired userland memory, KERN_FILE_BYPID and KERN_FILE_BYUID `allprocess' loops have netlock provided sleep points, so concurrent process exit(1) could crash kernel. The main exit1() problem is that process teardown begins while process is still linked to `allprocess' list, and current code doesn't allow to unlink it first. Wait for concurrent sysctl(2) `allprocess' loops between PS_EXITING bit setting and list unlinking. Both KERN_FILE_BYPID and KERN_FILE_BYUID loops do PS_EXITING check and won't deal with dying process. Concurrent exit1() thread will wait loops keeping process linked to `allprocess' list. Tested with i386 dpb(1) run. Stress tests and ok bluhm.
Diffstat (limited to 'gnu')
0 files changed, 0 insertions, 0 deletions