Do not crash in witness code if interrupt fires early.
authorbluhm <bluhm@openbsd.org>
Wed, 25 Sep 2024 18:24:13 +0000 (18:24 +0000)
committerbluhm <bluhm@openbsd.org>
Wed, 25 Sep 2024 18:24:13 +0000 (18:24 +0000)
commitf8f7dc1f1132b5aeb0dfc6c92da9ba96b923f6b9
treebb23e588c3c1df2cf21b50dfa67ffe1bb88b22ee
parent175054dbe41bc430cc9644e61cf024ce78d19f9f
Do not crash in witness code if interrupt fires early.

It can happen that an interrupt handler is called immediately on a
secondary CPU when it is spun up during boot.  At that moment no
process is schduled yet, so curproc is NULL.  To prevent a crash
when p->p_sleeplocks is dereferenced, skip witness check in this
case.

OK visa@
sys/kern/subr_witness.c