[Bug 282268] linker_load_module() panics with KASAN during post-panic reboot

From: <bugzilla-noreply_at_freebsd.org>
Date: Tue, 22 Oct 2024 12:55:55 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=282268

--- Comment #2 from Christos Margiolis <christos@freebsd.org> ---
Not sure if this theory is correct, but I am noticing that the issue is more
frequent when the panic was caused by a manual call to panic(9), as opposed to,
say, a memory issue.

I sent you the dump file on Slack because it's too big to attach here. Seems
like it's crashing when loading filemon(4):

(kgdb) bt
#0  __curthread () at /mnt/src/sys/amd64/include/pcpu_aux.h:57
#1  doadump (textdump=textdump@entry=0) at
/mnt/src/sys/kern/kern_shutdown.c:404
#2  0xffffffff805a33b6 in db_dump (dummy=<optimized out>, dummy2=<optimized
out>, dummy3=<optimized out>,
    dummy4=<optimized out>) at /mnt/src/sys/ddb/db_command.c:595
#3  0xffffffff805a31eb in db_command (last_cmdp=<optimized out>,
cmd_table=<optimized out>, dopager=true)
    at /mnt/src/sys/ddb/db_command.c:508
#4  0xffffffff805a2bfd in db_command_loop () at
/mnt/src/sys/ddb/db_command.c:555
#5  0xffffffff805a8979 in db_trap (type=<optimized out>, code=<optimized out>)
at /mnt/src/sys/ddb/db_main.c:267
#6  0xffffffff81189485 in kdb_trap (type=3, code=code@entry=0,
tf=tf@entry=0xfffffe0046ce0110)
    at /mnt/src/sys/kern/subr_kdb.c:790
#7  0xffffffff81a201a8 in trap (frame=0xfffffe0046ce0110) at
/mnt/src/sys/amd64/amd64/trap.c:606
#8  <signal handler called>
#9  kdb_enter (why=<optimized out>, msg=<optimized out>) at
/mnt/src/sys/kern/subr_kdb.c:556
#10 0xffffffff810dde37 in vpanic (
    fmt=fmt@entry=0xffffffff81c8f46f "ASan: Invalid access, %zu-byte %s at
%#lx, %s(%x)",
    ap=ap@entry=0xfffffe0046ce03e0) at /mnt/src/sys/kern/kern_shutdown.c:967
#11 0xffffffff810ddbd5 in panic (fmt=0xffffffff81c8f46f "ASan: Invalid access,
%zu-byte %s at %#lx, %s(%x)")
    at /mnt/src/sys/kern/kern_shutdown.c:892
#12 0xffffffff81160970 in kasan_report (addr=18446741875887136624, size=4,
write=false, pc=<optimized out>,
    code=<optimized out>) at /mnt/src/sys/kern/subr_asan.c:202
#13 0xffffffff8107f1f3 in linker_hints_lookup (
    path=0xffffffff829c65e0 <linker_path>
"/boot/kernel;/boot/modules;/boot/dtb;/boot/dtb/overlays",
    modname=0xfffffe004a17ec00 "filemon", modnamelen=7, verinfo=0x0,
pathlen=<optimized out>)
    at /mnt/src/sys/kern/kern_linker.c:2046
#14 linker_search_module (modname=0xfffffe004a17ec00 "filemon", modnamelen=7,
verinfo=0x0)
    at /mnt/src/sys/kern/kern_linker.c:2134
#15 linker_load_module (kldname=kldname@entry=0x0, modname=0xfffffe004a17ec00
"filemon", parent=parent@entry=0x0,
    verinfo=verinfo@entry=0x0, lfpp=lfpp@entry=0xfffffe0046ce0c00) at
/mnt/src/sys/kern/kern_linker.c:2272
#16 0xffffffff81082e23 in kern_kldload (td=<optimized out>,
file=file@entry=0xfffffe004a17ec00 "filemon",
    fileid=fileid@entry=0xfffffe0046ce0ca0) at
/mnt/src/sys/kern/kern_linker.c:1236
#17 0xffffffff81083052 in sys_kldload (td=0xffffffff826074b0 <panicstr>,
uap=<optimized out>)
    at /mnt/src/sys/kern/kern_linker.c:1259
#18 0xffffffff81a223ae in syscallenter (td=0xfffffe005bc4c000)
    at /mnt/src/sys/amd64/amd64/../../kern/subr_syscall.c:189
#19 amd64_syscall (td=0xfffffe005bc4c000, traced=0) at
/mnt/src/sys/amd64/amd64/trap.c:1192
#20 <signal handler called>
#21 0x000012614498a7da in ?? ()
Backtrace stopped: Cannot access memory at address 0x126142f959a8
(kgdb)

-- 
You are receiving this mail because:
You are the assignee for the bug.