panic: kernel diagnostic assertion "sc->sc_dev == 0" failed: file "/syzkaller/managers/multicore/kernel/sys/net/if_tun.c", line 319 Stopped at db_enter+0x25: addq $0x8,%rsp TID PID UID PRFLAGS PFLAGS CPU COMMAND *297263 36160 0 0x2 0 0K ifconfig 385 8720 0 0x10100002 0 1 sh db_enter() at db_enter+0x25 sys/arch/amd64/amd64/db_interface.c:438 panic(ffffffff834f1887) at panic+0x1e5 sys/kern/subr_prf.c:198 __assert(ffffffff8352f344,ffffffff835773e1,13f,ffffffff8346af3e) at __assert+0x29 sys/kern/subr_prf.c:-1 tun_clone_destroy(ffff800001608000) at tun_clone_destroy+0x38a if_clone_destroy(ffff80002a36fcf0) at if_clone_destroy+0x205 sys/net/if.c:1464 ifioctl(ffff8000015ad4a0,80206979,ffff80002a36fcf0,ffff800045ffcf98) at ifioctl+0x59d sys/net/if.c:2142 sys_ioctl(ffff800045ffcf98,ffff80002a36fed0,ffff80002a36fe20) at sys_ioctl+0x674 sys/kern/sys_generic.c:-1 syscall(ffff80002a36fed0) at syscall+0xbd4 mi_syscall sys/sys/syscall_mi.h:176 [inline] syscall(ffff80002a36fed0) at syscall+0xbd4 sys/arch/amd64/amd64/trap.c:791 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x725d0520aae0, count: 6 https://www.openbsd.org/ddb.html describes the minimum info required in bug reports. Insufficient info makes it difficult to find and fix bugs. ddb{0}> ddb{0}> set $lines = 0 ddb{0}> set $maxwidth = 0 ddb{0}> show panic *cpu0: kernel diagnostic assertion "sc->sc_dev == 0" failed: file "/syzkaller/managers/multicore/kernel/sys/net/if_tun.c", line 319 ddb{0}> show kasan No such command ddb{0}> trace db_enter() at db_enter+0x25 sys/arch/amd64/amd64/db_interface.c:438 panic(ffffffff834f1887) at panic+0x1e5 sys/kern/subr_prf.c:198 __assert(ffffffff8352f344,ffffffff835773e1,13f,ffffffff8346af3e) at __assert+0x29 sys/kern/subr_prf.c:-1 tun_clone_destroy(ffff800001608000) at tun_clone_destroy+0x38a if_clone_destroy(ffff80002a36fcf0) at if_clone_destroy+0x205 sys/net/if.c:1464 ifioctl(ffff8000015ad4a0,80206979,ffff80002a36fcf0,ffff800045ffcf98) at ifioctl+0x59d sys/net/if.c:2142 sys_ioctl(ffff800045ffcf98,ffff80002a36fed0,ffff80002a36fe20) at sys_ioctl+0x674 sys/kern/sys_generic.c:-1 syscall(ffff80002a36fed0) at syscall+0xbd4 mi_syscall sys/sys/syscall_mi.h:176 [inline] syscall(ffff80002a36fed0) at syscall+0xbd4 sys/arch/amd64/amd64/trap.c:791 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x725d0520aae0, count: -9 ddb{0}> show registers rdi 0 rsi 0x1 rbp 0xffff80002a36fab0 rbx 0xffffffff8391ce0f cpu_info_full_primary+0x2e0f rdx 0 rcx 0xffff800045ffcf98 rax 0xffffffff8391bff0 cpu_info_full_primary+0x1ff0 r8 0x101010101010101 r9 0x8080808080808080 r10 0x886b13c743461144 r11 0xe842cac3886906d2 r12 0xffffffff8391cc10 cpu_info_full_primary+0x2c10 r13 0 r14 0 r15 0x1 rip 0xffffffff81246135 db_enter+0x25 cs 0x8 rflags 0x246 rsp 0xffff80002a36faa0 ss 0x10 db_enter+0x25: addq $0x8,%rsp ddb{0}> show proc PROC (ifconfig) tid=297263 pid=36160 tcnt=1 stat=onproc flags process=2 proc=0 runpri=79, usrpri=79, slppri=17, nice=20 wchan=0x0, wmesg=, ps_single=0x0 scnt=0 ecnt=0 forw=0xffffffffffffffff, list=0xffff80002a309cb0,0xffff800045ffc2b0 process=0xffff80002a235370 user=0xffff80002a36a000, vmspace=0xfffff9800b1f7b70 estcpu=29, cpticks=1, pctcpu=0.0, user=0, sys=1, intr=0 ddb{0}> ps PID TID PPID UID S PRLAGS PFLAGS WAIT COMMAND 42616 156476 36875 0 2 0x100002 0 sh *36160 297263 90197 0 7 0x2 0 ifconfig 59779 441333 63807 0 2 0x2 0 ifconfig 8720 385 96471 0 7 0x10100002 0 sh 90197 460372 49762 0 3 0x100002 0x88 sigsusp sh 63807 475112 67189 0 3 0x100002 0x88 sigsusp sh 58255 92300 13419 0 2 0x2000 0x80000 syz-executor 58255 56541 13419 0 3 0x2000 0x4000000 suspend syz-executor 58255 271453 13419 0 2 0x2000 0x4080000 syz-executor 49762 501123 27270 0 3 0x2 0x80 wait syz-executor 67189 188084 27270 0 3 0x2 0x80 wait syz-executor 36875 438830 27270 0 3 0x2 0x80 wait syz-executor 96471 144095 27270 0 3 0x2 0x80 wait syz-executor 71223 514106 27270 0 3 0x2 0x80 piperd syz-executor 3129 258248 27270 0 3 0x2 0x80 piperd syz-executor 13419 382393 27270 0 2 0x2 0xc80 syz-executor 6039 249033 0 0 3 0x14000 0x280 nfsidl nfsio 48387 502253 0 0 3 0x14000 0x280 nfsidl nfsio 23013 133836 0 0 3 0x14000 0x280 nfsidl nfsio 29596 229338 0 0 3 0x14000 0x280 nfsidl nfsio 64466 281666 0 0 3 0x14000 0x280 nfsidl nfsio 54514 450245 0 0 3 0x14000 0x280 nfsidl nfsio 76695 440280 0 0 3 0x14000 0x280 nfsidl nfsio 57604 160514 0 0 3 0x14000 0x280 nfsidl nfsio 43195 482700 0 0 3 0x14000 0x280 nfsidl nfsio 22498 173998 0 0 3 0x14000 0x280 nfsidl nfsio 34958 371424 0 0 3 0x14000 0x280 nfsidl nfsio 57189 133696 0 0 3 0x14000 0x280 nfsidl nfsio 33002 123917 0 0 3 0x14000 0x280 nfsidl nfsio 50274 254119 0 0 3 0x14000 0x280 nfsidl nfsio 55426 202470 0 0 3 0x14000 0x280 nfsidl nfsio 18475 445805 0 0 3 0x14000 0x280 nfsidl nfsio 99489 17258 0 0 3 0x14000 0x280 nfsidl nfsio 88973 310894 0 0 3 0x14000 0x280 nfsidl nfsio 35677 297268 0 0 3 0x14000 0x280 nfsidl nfsio 92361 344560 0 0 3 0x14000 0x280 nfsidl nfsio 7432 335192 1 0 3 0x100003 0x80 ttyin getty 27270 4931 1 0 3 0x2 0x80 nanoslp syz-executor 20584 517077 0 0 3 0x14000 0x200 bored smr 47466 282066 0 0 2 0x14000 0x200 zerothread 19026 194785 0 0 3 0x14000 0x200 aiodoned aiodoned 40155 518056 0 0 3 0x14000 0x200 syncer update 31346 486643 0 0 3 0x14000 0x200 cleaner cleaner 46564 262980 0 0 3 0x14000 0x200 reaper reaper 94333 6619 0 0 3 0x14000 0x200 pgdaemon pagedaemon 53717 264126 0 0 3 0x14000 0x200 bored viomb 27109 61641 0 0 3 0x14000 0x40000200 acpi0 acpi0 99767 310928 0 0 3 0x14000 0x40000200 idle1 68657 360844 0 0 3 0x14000 0x200 bored softnet1 92504 433495 0 0 3 0x14000 0x200 bored softnet0 35732 328782 0 0 3 0x14000 0x200 smrbar systqmp 43202 157746 0 0 3 0x14000 0x200 bored systq 85883 514012 0 0 2 0x14000 0x200 softclockmp 99053 97392 0 0 3 0x14000 0x40000200 tmoslp softclock 82477 356204 0 0 3 0x14000 0x40000200 idle0 1 431479 0 0 3 0x2 0x80 wait init 0 0 -1 0 3 0x10000 0x200 scheduler swapper ddb{0}> show all locks Process 36160 (ifconfig) thread 0xffff800045ffcf98 (297263) exclusive rwlock clonelk r = 0 (0xffffffff839ca868) #0 witness_lock+0x5f1 stacktrace_save sys/sys/stacktrace.h:37 [inline] #0 witness_lock+0x5f1 sys/kern/subr_witness.c:1160 #1 rw_do_enter_write+0x42c sys/kern/kern_rwlock.c:320 #2 if_clone_destroy+0x93 sys/net/if.c:-1 #3 ifioctl+0x59d sys/net/if.c:2142 #4 sys_ioctl+0x674 sys/kern/sys_generic.c:-1 #5 syscall+0xbd4 mi_syscall sys/sys/syscall_mi.h:176 [inline] #5 syscall+0xbd4 sys/arch/amd64/amd64/trap.c:791 #6 Xsyscall+0x128 exclusive kernel_lock &kernel_lock r = 0 (0xffffffff83ac6700) #0 witness_lock+0x5f1 stacktrace_save sys/sys/stacktrace.h:37 [inline] #0 witness_lock+0x5f1 sys/kern/subr_witness.c:1160 #1 ifioctl+0x58c sys/net/if.c:2142 #2 sys_ioctl+0x674 sys/kern/sys_generic.c:-1 #3 syscall+0xbd4 mi_syscall sys/sys/syscall_mi.h:176 [inline] #3 syscall+0xbd4 sys/arch/amd64/amd64/trap.c:791 #4 Xsyscall+0x128 Process 35732 (systqmp) thread 0xffff800045ffe530 (328782) shared rwlock systqmp r = 0 (0xffffffff839c6208) #0 witness_lock+0x5f1 stacktrace_save sys/sys/stacktrace.h:37 [inline] #0 witness_lock+0x5f1 sys/kern/subr_witness.c:1160 #1 taskq_thread+0x11a sys/kern/kern_task.c:442 #2 proc_trampoline+0x10 ddb{0}> show malloc Type InUse MemUse HighUse Limit Requests Type Lim devbuf 11044 12013K 12219K 166960K 12696 0 pcb 17 12K 12K 166960K 49 0 rtable 123 4K 7K 166960K 806 0 pf 32 17K 18K 166960K 92 0 ifaddr 30 4K 7K 166960K 115 0 ifgroup 51 2K 2K 166960K 136 0 sysctl 1 1K 9K 166960K 5 0 counters 68 36K 37K 166960K 110 0 ioctlops 0 0K 4K 166960K 1526 0 iov 0 0K 16K 166960K 6 0 mount 1 1K 1K 166960K 1 0 log 2 0K 0K 166960K 6 0 vnodes 1324 83K 84K 166960K 1764 0 UFS quota 1 32K 32K 166960K 1 0 UFS mount 5 36K 36K 166960K 5 0 shm 2 1K 5K 166960K 5 0 VM map 2 1K 1K 166960K 2 0 sem 16 1K 1K 166960K 18 0 dirhash 24 4K 4K 166960K 30 0 ACPI 1692 195K 286K 166960K 12472 0 file desc 15 57K 81K 166960K 516 0 sigio 0 0K 0K 166960K 3 0 proc 29 66K 164K 166960K 1045 0 subproc 63 3K 4K 166960K 252 0 NFS srvsock 1 0K 0K 166960K 1 0 NFS daemon 1 16K 16K 166960K 1 0 ip_moptions 0 0K 0K 166960K 17 0 in_multi 45 3K 6K 166960K 269 0 ether_multi 1 0K 0K 166960K 1 0 mrt 0 0K 0K 166960K 11 0 ISOFS mount 1 32K 32K 166960K 1 0 MSDOSFS mount 1 16K 16K 166960K 1 0 ttys 67 307K 307K 166960K 67 0 exec 0 0K 1K 166960K 633 0 fusefs mount 1 32K 32K 166960K 1 0 pfkey data 0 0K 0K 166960K 1 0 tdb 3 0K 0K 166960K 3 0 VM swap 8 62K 64K 166960K 10 0 UVM amap 91 77K 182K 166960K 5593 0 UVM aobj 5 2K 2K 166960K 5 0 pinsyscall 18 36K 98K 166960K 2124 0 memdesc 1 4K 4K 166960K 1 0