Re: ddb reset command results in LOR and panic? (audit related?)
- In reply to: Bjoern A. Zeeb: "ddb reset command results in LOR and panic? (audit related?)"
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Thu, 30 Jan 2025 10:32:58 UTC
On Thu, Jan 30, 2025 at 02:37:53AM +0000, Bjoern A. Zeeb wrote: > Hi. > > I broke into the kernel debugger after some driver went haywire. > > Upon typing reset to restart the machine I got the below. > How can we still report a LOR and panic on a lock when we > are resetting the machine from ddb? > > /bz > > db> reset > lock order reversal: (sleepable after non-sleepable) > 1st 0xfffff800031dfb40 thread (thread, sleep mutex) @ /sys/kern/subr_taskqueue.c:519 > 2nd 0xffffffff81cdecd0 audit_worker_lock (audit_worker_lock, sx) @ /sys/security/audit/audit_worker.c:512 > panic: lock (sx) kernel linker not locked @ /sys/kern/kern_linker.c:1130 > cpuid = 3 > time = 1738203974 > KDB: stack backtrace: > db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 0xfffffe0068c67180 > vpanic() at vpanic+0x136/frame 0xfffffe0068c672b0 > panic() at panic+0x43/frame 0xfffffe0068c67310 > witness_unlock() at witness_unlock+0x154/frame 0xfffffe0068c67340 > _sx_sunlock_int() at _sx_sunlock_int+0x4a/frame 0xfffffe0068c67370 > linker_search_symbol_name_flags() at linker_search_symbol_name_flags+0x90/frame 0xfffffe0068c673a0 > stack_sbuf_print_flags() at stack_sbuf_print_flags+0x8e/frame 0xfffffe0068c67430 > witness_checkorder() at witness_checkorder+0xbf6/frame 0xfffffe0068c675f0 > _sx_xlock() at _sx_xlock+0x60/frame 0xfffffe0068c67630 > audit_rotate_vnode() at audit_rotate_vnode+0xd0/frame 0xfffffe0068c67740 > kern_reboot() at kern_reboot+0x2a3/frame 0xfffffe0068c67780 > db_reset() at db_reset+0x108/frame 0xfffffe0068c677b0 This happens IMO due to audit shutdown hook which tried to do VFS ops during panic, then it went south. Perhaps something like this would fix your immediate issue. diff --git a/sys/security/audit/audit.c b/sys/security/audit/audit.c index 269e62db454a..8a9865bf233b 100644 --- a/sys/security/audit/audit.c +++ b/sys/security/audit/audit.c @@ -396,7 +396,8 @@ SYSINIT(audit_init, SI_SUB_AUDIT, SI_ORDER_FIRST, audit_init, NULL); void audit_shutdown(void *arg, int howto) { - + if (KERNEL_PANICED()) + return; audit_rotate_vnode(NULL, NULL); } (not even compiled).