login: 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 * 26925 33571 0 0x2 0 0K ifconfig db_enter() at db_enter+0x25 sys/arch/amd64/amd64/db_interface.c:438 panic(ffffffff834f6ed5) at panic+0x1e5 sys/kern/subr_prf.c:198 __assert(ffffffff8353483d,ffffffff8357af87,13f,ffffffff8346ea26) at __assert+0x29 sys/kern/subr_prf.c:-1 tun_clone_destroy(ffff8000015c6800) at tun_clone_destroy+0x38a if_clone_destroy(ffff80002a361ad0) at if_clone_destroy+0x205 sys/net/if.c:1464 ifioctl(ffff8000015aeec0,80206979,ffff80002a361ad0,ffff80002a21dc98) at ifioctl+0x59d sys/net/if.c:2142 sys_ioctl(ffff80002a21dc98,ffff80002a361cb0,ffff80002a361c00) at sys_ioctl+0x674 sys/kern/sys_generic.c:-1 syscall(ffff80002a361cb0) at syscall+0xbd4 mi_syscall sys/sys/syscall_mi.h:176 [inline] syscall(ffff80002a361cb0) at syscall+0xbd4 sys/arch/amd64/amd64/trap.c:804 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x73cb17ec4300, 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(ffffffff834f6ed5) at panic+0x1e5 sys/kern/subr_prf.c:198 __assert(ffffffff8353483d,ffffffff8357af87,13f,ffffffff8346ea26) at __assert+0x29 sys/kern/subr_prf.c:-1 tun_clone_destroy(ffff8000015c6800) at tun_clone_destroy+0x38a if_clone_destroy(ffff80002a361ad0) at if_clone_destroy+0x205 sys/net/if.c:1464 ifioctl(ffff8000015aeec0,80206979,ffff80002a361ad0,ffff80002a21dc98) at ifioctl+0x59d sys/net/if.c:2142 sys_ioctl(ffff80002a21dc98,ffff80002a361cb0,ffff80002a361c00) at sys_ioctl+0x674 sys/kern/sys_generic.c:-1 syscall(ffff80002a361cb0) at syscall+0xbd4 mi_syscall sys/sys/syscall_mi.h:176 [inline] syscall(ffff80002a361cb0) at syscall+0xbd4 sys/arch/amd64/amd64/trap.c:804 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x73cb17ec4300, count: -9 ddb{0}> show registers rdi 0 rsi 0x1 rbp 0xffff80002a361890 rbx 0xffffffff839e8e0f cpu_info_full_primary+0x2e0f rdx 0 rcx 0xffff80002a21dc98 rax 0xffffffff839e7ff0 cpu_info_full_primary+0x1ff0 r8 0x101010101010101 r9 0x8080808080808080 r10 0x598c796718689ac6 r11 0xbd016937897f61e3 r12 0xffffffff839e8c10 cpu_info_full_primary+0x2c10 r13 0 r14 0 r15 0x1 rip 0xffffffff825468c5 db_enter+0x25 cs 0x8 rflags 0x246 rsp 0xffff80002a361880 ss 0x10 db_enter+0x25: addq $0x8,%rsp ddb{0}> show proc PROC (ifconfig) tid=26925 pid=33571 tcnt=1 stat=onproc flags process=2 proc=0 runpri=32, usrpri=86, slppri=32, nice=20 wchan=0x0, wmesg=, ps_single=0x0 scnt=0 ecnt=0 forw=0xffffffffffffffff, list=0xffff80002a21cd08,0xffffffff83a07160 process=0xffff80002a227558 user=0xffff80002a35c000, vmspace=0xfffffc807e60f990 estcpu=36, cpticks=1, pctcpu=0.0, user=0, sys=1, intr=0 ddb{0}> ps PID TID PPID UID S PRLAGS PFLAGS WAIT COMMAND *33571 26925 9357 0 7 0x2 0 ifconfig 9357 9397 98351 0 3 0x100002 0x88 sigsusp sh 25132 389127 92598 0 3 0x100002 0x88 sigsusp sh 98351 405016 54285 0 3 0x2 0x80 wait syz-executor 92598 195279 54285 0 3 0x2 0x80 wait syz-executor 7391 271193 82432 0 2 0x10100002 0x88 sh 1312 411693 84352 0 2 0x10100002 0x88 sh 82432 169356 54285 0 3 0x2 0x80 wait syz-executor 84352 234474 54285 0 3 0x2 0x80 wait syz-executor 40862 121110 54285 0 3 0x2 0x80 piperd syz-executor 92304 103037 1 0 3 0x100003 0x80 ttyin getty 19663 23417 54285 0 3 0x2 0x80 piperd syz-executor 42183 323856 54285 0 3 0x2 0x80 piperd syz-executor 54285 159559 1 0 2 0x10000002 0x80 syz-executor 22566 118968 1 74 3 0x1100012 0x80 bpf pflogd 44387 286494 1 73 3 0x1100010 0x80 kqread syslogd 65869 244164 0 0 3 0x14000 0x200 bored smr 91249 402367 0 0 2 0x14000 0x200 zerothread 88338 259718 0 0 3 0x14000 0x200 aiodoned aiodoned 23828 362663 0 0 3 0x14000 0x200 syncer update 13404 87315 0 0 3 0x14000 0x200 cleaner cleaner 68121 334712 0 0 3 0x14000 0x200 reaper reaper 27926 390353 0 0 3 0x14000 0x200 pgdaemon pagedaemon 52089 386695 0 0 3 0x14000 0x200 bored viomb 22824 497417 0 0 3 0x14000 0x40000200 acpi0 acpi0 70939 501570 0 0 3 0x14000 0x40000200 idle1 85114 473034 0 0 3 0x14000 0x200 bored softnet1 94984 357193 0 0 2 0x14000 0x200 softnet0 2709 9688 0 0 3 0x14000 0x200 smrbar systqmp 62247 216719 0 0 3 0x14000 0x200 bored systq 70053 398525 0 0 3 0x14000 0x200 tmoslp softclockmp 97056 162957 0 0 3 0x14000 0x40000200 tmoslp softclock 79481 98252 0 0 3 0x14000 0x40000200 idle0 1 273725 0 0 3 0x2 0x80 wait init 0 0 -1 0 3 0x10000 0x200 scheduler swapper ddb{0}> show all locks Process 33571 (ifconfig) thread 0xffff80002a21dc98 (26925) exclusive rwlock clonelk r = 0 (0xffffffff839abed8) #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:804 #6 Xsyscall+0x128 exclusive kernel_lock &kernel_lock r = 0 (0xffffffff83abd700) #0 witness_lock+0x5f1 stacktrace_save sys/sys/stacktrace.h:37 [inline] #0 witness_lock+0x5f1 sys/kern/subr_witness.c:1160 #1 __mp_acquire_count+0x58 sys/kern/kern_lock.c:-1 #2 sleep_finish+0x2d8 sys/kern/kern_synch.c:369 #3 rw_do_enter_write+0x1dc sys/kern/kern_rwlock.c:298 #4 if_clone_destroy+0x93 sys/net/if.c:-1 #5 ifioctl+0x59d sys/net/if.c:2142 #6 sys_ioctl+0x674 sys/kern/sys_generic.c:-1 #7 syscall+0xbd4 mi_syscall sys/sys/syscall_mi.h:176 [inline] #7 syscall+0xbd4 sys/arch/amd64/amd64/trap.c:804 #8 Xsyscall+0x128 Process 2709 (systqmp) thread 0xffff800045ffea60 (9688) shared rwlock systqmp r = 0 (0xffffffff839153c8) #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 11065 12075K 12213K 166960K 12581 0 pcb 17 12K 12K 166960K 63 0 rtable 121 4K 7K 166960K 1279 0 pf 26 16K 19K 166960K 131 0 ifaddr 24 4K 7K 166960K 181 0 ifgroup 39 1K 2K 166960K 197 0 sysctl 1 1K 9K 166960K 5 0 counters 62 36K 37K 166960K 148 0 ioctlops 0 0K 4K 166960K 1576 0 iov 0 0K 12K 166960K 182 0 mount 1 1K 1K 166960K 1 0 log 0 0K 0K 166960K 4 0 vnodes 1298 82K 82K 166960K 1870 0 UFS quota 1 32K 32K 166960K 1 0 UFS mount 5 36K 36K 166960K 5 0 shm 2 1K 5K 166960K 6 0 VM map 2 1K 1K 166960K 2 0 sem 14 1K 1K 166960K 18 0 dirhash 12 2K 2K 166960K 12 0 ACPI 1692 195K 286K 166960K 12472 0 file desc 14 49K 85K 166960K 868 0 proc 29 50K 180K 166960K 1517 0 subproc 63 3K 4K 166960K 396 0 NFS srvsock 1 0K 0K 166960K 1 0 NFS daemon 1 16K 16K 166960K 1 0 ip_moptions 0 0K 0K 166960K 38 0 in_multi 44 2K 6K 166960K 447 0 ether_multi 1 0K 0K 166960K 1 0 mrt 3 0K 0K 166960K 21 0 ISOFS mount 1 32K 32K 166960K 1 0 MSDOSFS mount 1 16K 16K 166960K 1 0 ttys 229 1023K 1023K 166960K 229 0 exec 0 0K 1K 166960K 836 0 fusefs mount 1 32K 32K 166960K 1 0 pfkey data 0 0K 0K 166960K 2 0 tdb 3 0K 0K 166960K 3 0 VM swap 8 62K 64K 166960K 10 0 UVM amap 105 85K 159K 166960K 8038 0 UVM aobj 70 3K 3K 166960K 72 0 pinsyscall 20 40K 103K 166960K 2834 0 memdesc 1 4K 4K 166960K 1 0 crypto data 1 1K 1K 166960K 1 0 ip6_options 0 0K 0K 166960K 3 0 NDP 10 0K 2K 166960K 129 0 temp 39 9135K 9155K 166960K 17114 0 kqueue 3 4K 24K 166960K 63 0 SYN cache 2 16K 16K 166960K 2 0 ddb{0}> show all pools Name Size Requests Fail Releases Pgreq Pgrel Npage Hiwat Minpg Maxpg Idle plcache 128 28 0 0 1 0 1 1 0 8 0 rtpcb 120 105 0 105 1 0 1 1 0 8 1 rtentry 176 452 0 397 6 1 5 6 0 8 0 unpcb 144 162 0 157 1 0 1 1 0 8 0 syncache 336 5 0 5 2 2 0 1 0 8 0 tcpcb 736 111 0 110 4 1 3 4 0 8 2 arp 136 80 0 72 1 0 1 1 0 8 0 inpcb 328 452 0 450 4 1 3 4 0 8 2 nd6 152 117 0 108 1 0 1 1 0 8 0 pkpcb 40 2 0 2 2 2 0 1 0 8 0 kcovpl 48 44 0 37 1 0 1 1 0 8 0 ppxss 1192 7 0 7 1 0 1 1 0 8 1 pffrag 232 1 0 1 1 1 0 1 0 482 0 pffrnode 88 1 0 1 1 1 0 1 0 8 0 pffrent 40 3 0 3 1 1 0 1 0 8 0 pfosfp 40 1428 0 1005 5 0 5 5 0 8 0 pfosfpen 112 1428 0 714 21 0 21 21 0 8 0 pftag 88 1 0 0 1 0 1 1 0 8 0 pfstitem 24 51 0 4 1 0 1 1 0 8 0 pfstkey 128 51 0 4 2 0 2 2 0 8 0 pfstate 448 51 0 4 6 0 6 6 0 8 0 pfrule 1360 25 0 20 2 1 1 2 0 8 0 art_heap8 4096 1 0 0 1 0 1 1 0 8 0 art_heap4 256 1831 0 1508 29 0 29 29 0 8 2 art_table 40 1832 0 1508 5 0 5 5 0 8 0 art_node 32 452 0 392 1 0 1 1 0 8 0 sysvmsgpl 40 4 0 2 1 0 1 1 0 8 0 semapl 72 16 0 4 1 0 1 1 0 8 0 shmpl 120 69 0 2 3 0 3 3 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino2pl 256 2031 0 482 97 0 97 97 0 8 0 ffsino 296 2031 0 482 120 0 120 120 0 8 0 nchpl 144 2599 0 769 68 0 68 68 0 8 0 vnodes 216 2554 0 0 142 0 142 142 0 8 0 namei 1024 12808 0 12808 3 2 1 2 0 8 1 percpumem 16 90 0 43 1 0 1 1 0 8 0 kstatmem 264 105 0 86 2 0 2 2 0 8 0 scsiplug 72 2 0 2 1 1 0 1 0 8 0 scxspl 216 8941 0 8941 10 5 5 8 1 8 5 plimitpl 152 417 0 405 1 0 1 1 0 8 0 sigapl 424 1101 0 1063 6 0 6 6 0 8 0 knotepl 120 303 0 0 10 0 10 10 0 8 0 kqueuepl 224 111 0 109 1 0 1 1 0 8 0 pipepl 344 245 0 218 5 1 4 4 0 8 0 fdescpl 528 1085 0 1067 3 0 3 3 0 8 0 filepl 160 4351 0 4196 13 1 12 13 0 8 2 lockfpl 104 164 0 164 1 0 1 1 0 8 1 lockfspl 48 48 0 48 1 0 1 1 0 8 1 sessionpl 144 109 0 104 1 0 1 1 0 8 0 pgrppl 48 156 0 143 1 0 1 1 0 8 0 ucredpl 104 457 0 450 1 0 1 1 0 8 0 zombiepl 144 1067 0 1063 1 0 1 1 0 8 0 processpl 1240 1101 0 1063 5 1 4 5 0 8 0 procpl 664 1611 0 1573 6 0 6 6 0 8 1 sosppl 176 2 0 2 1 1 0 1 0 8 0 sockpl 752 738 0 731 6 1 5 6 0 8 3 mcl64k 65536 5 0 0 1 0 1 1 0 8 0 mcl16k 16384 4 0 0 1 0 1 1 0 8 0 mcl12k 12288 2 0 0 1 0 1 1 0 8 0 mcl9k128 9344 1 0 0 1 0 1 1 0 8 0 mcl8k 8192 3 0 0 1 0 1 1 0 8 0 mcl4k 4096 127 0 0 16 0 16 16 0 8 0 mcl2k 2048 28 0 0 4 1 3 4 0 8 0 mextrefs 64 27 0 0 1 0 1 1 0 8 0 mtagpl 96 1 0 0 1 0 1 1 0 8 0 mbufpl 256 269 0 0 17 0 17 17 0 8 0 bufpl 272 3040 0 92 197 0 197 197 0 8 0 anonpl 32 7135 0 0 58 0 58 58 0 247 0 amapchunkpl 152 23031 0 22823 26 3 23 25 0 158 7 amappl16 200 2016 0 2011 15 13 2 14 0 8 0 amappl15 192 17 0 17 1 1 0 1 0 8 0 amappl14 184 809 0 805 1 0 1 1 0 8 0 amappl13 176 182 0 179 1 0 1 1 0 8 0 amappl12 168 1462 0 1446 2 0 2 2 0 8 0 amappl11 160 7 0 6 1 0 1 1 0 8 0 amappl10 152 66 0 62 1 0 1 1 0 8 0 amappl9 144 292 0 292 1 1 0 1 0 8 0 amappl8 136 229 0 225 1 0 1 1 0 8 0 amappl7 128 205 0 200 1 0 1 1 0 8 0 amappl6 120 305 0 301 1 0 1 1 0 8 0 amappl5 112 269 0 265 1 0 1 1 0 8 0 amappl4 104 377 0 368 1 0 1 1 0 8 0 amappl3 96 4643 0 4592 4 0 4 4 0 8 0 amappl2 88 575 0 558 2 0 2 2 0 8 0 amappl1 80 15262 0 15086 15 1 14 15 0 8 2 amappl 88 6783 0 6706 4 0 4 4 0 92 0 uvmvnodes 80 108 0 0 3 0 3 3 0 8 0 dma4096 4096 1 0 1 1 1 0 1 0 8 0 dma1024 1024 1 0 0 1 0 1 1 0 8 0 dma256 256 6 0 6 1 1 0 1 0 8 0 dma128 128 256 0 256 2 2 0 1 0 8 0 dma64 64 6 0 6 1 1 0 1 0 8 0 dma32 32 7 0 7 1 1 0 1 0 8 0 dma16 16 18 0 17 1 0 1 1 0 8 0 aobjpl 72 71 0 2 2 0 2 2 0 8 0 uaddrrnd 24 1085 0 1067 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 1085 0 1067 1 0 1 1 0 8 0 vmmpekpl 168 10238 0 10185 3 0 3 3 0 8 0 vmmpepl 168 77391 0 76685 87 4 83 87 0 357 38 vmsppl 488 1084 0 1066 6 1 5 5 0 8 1 rwobjpl 80 24122 0 23564 26 4 22 26 0 8 1 pdppl 4096 2178 0 2132 136 80 56 82 0 8 10 pvpl 32 12875 0 0 104 0 104 104 0 265 0 pmappl 256 1084 0 1066 4 1 3 3 0 8 0 extentpl 40 45 0 27 1 0 1 1 0 8 0 phpool 112 527 0 90 13 0 13 13 0 8 0 ddb{0}> machine ddbcpu 0 Invalid cpu 0 ddb{0}>