Adjust KERNEL_ASSERT_UNLOCKED() to not assert during a panic.
authorclaudio <claudio@openbsd.org>
Mon, 30 Oct 2023 07:04:36 +0000 (07:04 +0000)
committerclaudio <claudio@openbsd.org>
Mon, 30 Oct 2023 07:04:36 +0000 (07:04 +0000)
commit6d6c8141fa4d5762fdb4d433770e1c00c368708e
treec267297627488dcb45884bae3cac23cb13b30cc8
parent6e5620495a048c5d85f1ebee098031bea3ed2236
Adjust KERNEL_ASSERT_UNLOCKED() to not assert during a panic.

KERNEL_ASSERT_UNLOCKED calls _kernel_lock_held() which returns true
if panicstr || db_active which triggers this assert. Workaround this by
checking them before.

This will alter the following Syzkaller reports:
Reported-by: syzbot+169110a0815838ab5940@syzkaller.appspotmail.com
Reported-by: syzbot+3c2eced405b9de6f79c2@syzkaller.appspotmail.com
OK mpi@
sys/sys/systm.h