panic: kernel diagnostic assertion "sc->sc_dev == 0" failed: file "/syzkaller/managers/multicore/kernel/sys/net/if_tun.c", line 305 Stopped at db_enter+0x18: addq $0x8,%rsp TID PID UID PRFLAGS PFLAGS CPU COMMAND *434838 37927 0 0 0x4000000 0K syz-executor.5 db_enter() at db_enter+0x18 sys/arch/amd64/amd64/db_interface.c:440 panic(ffffffff82579a90) at panic+0x177 sys/kern/subr_prf.c:202 __assert(ffffffff825ec6cc,ffffffff82633a76,131,ffffffff825feb3f) at __assert+0x25 sys/kern/subr_prf.c:161 tun_clone_destroy(ffff800000c9e800) at tun_clone_destroy+0x278 sys/net/if_tun.c:305 if_clone_destroy(ffff80002b53f3d0) at if_clone_destroy+0x132 sys/net/if.c:1218 soo_ioctl(fffffd80785e0b60,80206979,ffff80002b53f3d0,ffff8000211927f0) at soo_ioctl+0x26c sys_ioctl(ffff8000211927f0,ffff80002b53f4e8,ffff80002b53f540) at sys_ioctl+0x4a2 syscall(ffff80002b53f5b0) at syscall+0x489 mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff80002b53f5b0) at syscall+0x489 sys/arch/amd64/amd64/trap.c:585 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0xe1f2d5e8b80, 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 305 ddb{0}> trace db_enter() at db_enter+0x18 sys/arch/amd64/amd64/db_interface.c:440 panic(ffffffff82579a90) at panic+0x177 sys/kern/subr_prf.c:202 __assert(ffffffff825ec6cc,ffffffff82633a76,131,ffffffff825feb3f) at __assert+0x25 sys/kern/subr_prf.c:161 tun_clone_destroy(ffff800000c9e800) at tun_clone_destroy+0x278 sys/net/if_tun.c:305 if_clone_destroy(ffff80002b53f3d0) at if_clone_destroy+0x132 sys/net/if.c:1218 soo_ioctl(fffffd80785e0b60,80206979,ffff80002b53f3d0,ffff8000211927f0) at soo_ioctl+0x26c sys_ioctl(ffff8000211927f0,ffff80002b53f4e8,ffff80002b53f540) at sys_ioctl+0x4a2 syscall(ffff80002b53f5b0) at syscall+0x489 mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff80002b53f5b0) at syscall+0x489 sys/arch/amd64/amd64/trap.c:585 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0xe1f2d5e8b80, count: -9 ddb{0}> show registers rdi 0 rsi 0x1 rbp 0xffff80002b53f1e0 rbx 0xffffffff828ecbff cpu_info_full_primary+0x2bff rdx 0 rcx 0 rax 0xffff8000211927f0 r8 0 r9 0x8080808080808080 r10 0x8a4783d3d7f5a7ce r11 0x8e8aa657afb40072 r12 0xffffffff828eca00 cpu_info_full_primary+0x2a00 r13 0 r14 0 r15 0x1 rip 0xffffffff82237da8 db_enter+0x18 cs 0x8 rflags 0x246 rsp 0xffff80002b53f1d0 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb{0}> show proc PROC (syz-executor.5) pid=434838 stat=onproc flags process=0 proc=4000000 pri=32, usrpri=86, nice=20 forw=0xffffffffffffffff, list=0xffff800021192a90,0xffffffff82af1e70 process=0xffff80002e3e6dd8 user=0xffff80002b53a000, vmspace=0xfffffd807a3ad030 estcpu=36, cpticks=1, pctcpu=0.0 user=0, sys=1, intr=0 ddb{0}> ps PID TID PPID UID S FLAGS WAIT COMMAND 37927 402893 53128 0 2 0 syz-executor.5 *37927 434838 53128 0 7 0x4000000 syz-executor.5 41806 270916 57459 0 2 0x480 syz-executor.6 41806 78501 57459 0 3 0x4000080 kqpoll syz-executor.6 41806 201494 57459 0 3 0x4000080 fsleep syz-executor.6 31937 360896 96506 0 3 0x80 nanoslp syz-executor.1 31937 446733 96506 0 3 0x4000080 netcon2 syz-executor.1 31937 317022 96506 0 3 0x4000080 fsleep syz-executor.1 96506 98464 59203 0 2 0x482 syz-executor.1 8259 317681 59203 0 3 0x82 piperd syz-executor.4 20326 481413 59203 0 3 0x82 piperd syz-executor.0 57459 183186 59203 0 2 0x482 syz-executor.6 739 457462 59203 0 2 0x482 syz-executor.3 52934 3074 59203 0 3 0x82 piperd syz-executor.2 57170 190768 0 0 3 0x14200 acct acct 11000 483316 1 0 3 0x100083 ttyin getty 53128 369882 59203 0 2 0x482 syz-executor.5 16629 121918 59203 0 3 0x82 piperd syz-executor.7 27100 185832 0 0 3 0x14280 nfsidl nfsio 13270 219447 0 0 3 0x14280 nfsidl nfsio 98504 471857 0 0 3 0x14280 nfsidl nfsio 66161 62162 0 0 3 0x14280 nfsidl nfsio 65141 205120 0 0 3 0x14280 nfsidl nfsio 65653 517041 0 0 3 0x14280 nfsidl nfsio 31338 450383 0 0 3 0x14280 nfsidl nfsio 74900 132351 0 0 3 0x14280 nfsidl nfsio 35244 83629 0 0 3 0x14280 nfsidl nfsio 36844 23111 0 0 3 0x14280 nfsidl nfsio 49843 436640 0 0 3 0x14280 nfsidl nfsio 8372 266454 0 0 3 0x14280 nfsidl nfsio 27738 495277 0 0 3 0x14280 nfsidl nfsio 2741 192547 0 0 3 0x14280 nfsidl nfsio 68251 134066 0 0 3 0x14280 nfsidl nfsio 22664 229650 0 0 3 0x14280 nfsidl nfsio 61109 210202 0 0 3 0x14280 nfsidl nfsio 94594 51559 0 0 3 0x14280 nfsidl nfsio 98006 436233 0 0 3 0x14280 nfsidl nfsio 62729 84332 0 0 3 0x14280 nfsidl nfsio 8648 34632 0 0 3 0x14200 bored sosplice 59203 365052 67493 0 3 0x82 thrsleep syz-fuzzer 59203 331230 67493 0 3 0x4000082 thrsleep syz-fuzzer 59203 354091 67493 0 3 0x4000082 kqread syz-fuzzer 59203 227175 67493 0 3 0x4000082 thrsleep syz-fuzzer 59203 455831 67493 0 3 0x4000082 thrsleep syz-fuzzer 59203 489665 67493 0 3 0x4000082 thrsleep syz-fuzzer 59203 376047 67493 0 3 0x4000082 thrsleep syz-fuzzer 59203 87685 67493 0 3 0x4000082 thrsleep syz-fuzzer 59203 443363 67493 0 3 0x4000082 thrsleep syz-fuzzer 67493 238839 89532 0 3 0x10008a sigsusp ksh 89532 55051 63655 0 3 0x9a kqread sshd 63655 56080 1 0 3 0x88 kqread sshd 89596 187322 3104 74 3 0x100092 bpf pflogd 3104 508686 1 0 3 0x80 netio pflogd 85154 113667 54885 73 3 0x100090 kqread syslogd 54885 306501 1 0 3 0x100082 netio syslogd 15476 348547 1 0 3 0x100080 kqread resolvd 88728 180223 85384 77 2 0x100092 dhcpleased 2532 234437 85384 77 3 0x100092 kqread dhcpleased 85384 379283 1 0 3 0x80 kqread dhcpleased 25320 338311 0 0 3 0x14200 bored smr 86806 492630 0 0 2 0x14200 zerothread 42138 413993 0 0 3 0x14200 aiodoned aiodoned 20660 295481 0 0 3 0x14200 syncer update 94053 393219 0 0 3 0x14200 cleaner cleaner 13678 155423 0 0 3 0x14200 reaper reaper 93517 394920 0 0 3 0x14200 pgdaemon pagedaemon 5826 320050 0 0 3 0x14200 bored viomb 13107 234315 0 0 3 0x40014200 acpi0 acpi0 28150 237226 0 0 7 0x40014200 idle1 89023 56489 0 0 3 0x14200 bored softnet 46918 130141 0 0 3 0x14200 bored systqmp 87720 204170 0 0 3 0x14200 bored systq 48072 91482 0 0 2 0x40014200 softclock 61629 483468 0 0 3 0x40014200 idle0 1 203454 0 0 3 0x80082 wait init 0 0 -1 0 3 0x10200 scheduler swapper ddb{0}> show all locks Process 37927 (syz-executor.5) thread 0xffff8000211927f0 (434838) exclusive rwlock clonelk r = 0 (0xffffffff8298b730) #0 witness_lock+0x44d #1 if_clone_destroy+0x49 #2 soo_ioctl+0x26c #3 sys_ioctl+0x4a2 #4 syscall+0x489 mi_syscall sys/sys/syscall_mi.h:102 [inline] #4 syscall+0x489 sys/arch/amd64/amd64/trap.c:585 #5 Xsyscall+0x128 exclusive kernel_lock &kernel_lock r = 0 (0xffffffff82ac44c8) #0 witness_lock+0x44d #1 soo_ioctl+0x25a sys/kern/sys_socket.c:136 #2 sys_ioctl+0x4a2 #3 syscall+0x489 mi_syscall sys/sys/syscall_mi.h:102 [inline] #3 syscall+0x489 sys/arch/amd64/amd64/trap.c:585 #4 Xsyscall+0x128 ddb{0}> show malloc Type InUse MemUse HighUse Limit Requests Type Lim devbuf 10230 6587K 7325K 78643K 55254 0 pcb 15 20K 25K 78643K 3627 0 rtable 295 29K 30K 78643K 8716 0 ifaddr 112 30K 34K 78643K 5549 0 sysctl 2 0K 0K 78643K 2 0 counters 58 35K 36K 78643K 638 0 ioctlops 0 0K 4K 78643K 14652 0 iov 0 0K 32K 78643K 2734 0 mount 1 1K 1K 78643K 1 0 log 0 0K 0K 78643K 4 0 vnodes 1480 92K 93K 78643K 17402 0 UFS quota 1 32K 32K 78643K 1 0 UFS mount 5 36K 36K 78643K 5 0 shm 2 1K 9K 78643K 304 0 VM map 2 1K 1K 78643K 2 0 sem 20 10K 20K 78643K 303 0 dirhash 12 2K 2K 78643K 12 0 ACPI 1697 195K 286K 78643K 12548 0 file desc 13 45K 81K 78643K 30415 0 sigio 2 0K 0K 78643K 663 0 proc 70 87K 111K 78643K 3837 0 subproc 104 6K 6K 78643K 1114 0 NFS srvsock 1 0K 0K 78643K 1 0 NFS daemon 1 16K 16K 78643K 1 0 ip_moptions 0 0K 0K 78643K 3091 0 in_multi 86 5K 6K 78643K 1579 0 ether_multi 1 0K 0K 78643K 259 0 mrt 2 0K 0K 78643K 109 0 ISOFS mount 1 32K 32K 78643K 1 0 MSDOSFS mount 1 16K 16K 78643K 1 0 ttys 241 1076K 1076K 78643K 241 0 exec 0 0K 2K 78643K 5602 0 pfkey data 0 0K 0K 78643K 9 0 tdb 3 0K 0K 78643K 3 0 pagedep 1 8K 8K 78643K 1 0 inodedep 1 32K 32K 78643K 1 0 newblk 1 0K 0K 78643K 1 0 VM swap 7 26K 26K 78643K 7 0 UVM amap 863 2180K 2181K 78643K 377055 0 UVM aobj 131 8K 8K 78643K 176 0 memdesc 1 4K 4K 78643K 1 0 crypto data 1 1K 1K 78643K 1 0 ip6_options 0 0K 0K 78643K 1305 0 NDP 14 0K 2K 78643K 489 0 temp 180 4770K 8866K 78643K 192270 0 kqueue 13 20K 30K 78643K 1775 0 SYN cache 2 8K 16K 78643K 3 0 ddb{0}> show all pools Name Size Requests Fail Releases Pgreq Pgrel Npage Hiwat Minpg Maxpg Idle plcache 128 22 0 0 1 0 1 1 0 8 0 rtpcb 120 2397 0 2394 28 27 1 5 0 8 0 rtentry 112 1542 0 1441 4 0 4 4 0 8 0 unpcb 136 15208 0 15193 160 159 1 9 0 8 0 syncache 296 96 0 96 26 25 1 1 0 8 1 tcpqe 32 1586 0 1586 15 14 1 2 0 8 1 tcpcb 736 9444 0 9396 303 295 8 13 0 8 3 arp 120 307 0 287 1 0 1 1 0 8 0 inpcb 304 31736 0 31722 385 378 7 15 0 8 5 rttmr 72 36 0 36 10 10 0 1 0 8 0 nd6 48 308 0 282 1 0 1 1 0 8 0 pkpcb 40 77 0 77 14 14 0 1 0 8 0 kcovpl 48 85 0 77 1 0 1 1 0 8 0 ppxss 1248 77 0 77 21 21 0 1 0 8 0 pfstscr 40 1035 0 1035 15 15 0 1 0 8 0 pffrag 232 100 0 98 10 9 1 1 0 482 0 pffrnode 88 100 0 98 10 9 1 1 0 8 0 pffrent 40 370 0 368 12 11 1 1 0 8 0 pfosfp 40 1436 0 1012 5 0 5 5 0 8 0 pfosfpen 112 1436 0 714 21 0 21 21 0 8 0 pfrke_plain 168 55 0 53 10 9 1 1 0 8 0 pfrktable 1344 604 0 579 14 11 3 3 0 8 0 pftag 88 55 0 36 1 0 1 1 0 8 0 pfqueue 264 25 0 25 7 7 0 1 0 8 0 pfstitem 24 68 0 66 1 0 1 1 0 8 0 pfstkey 112 2136 0 2134 1 0 1 1 0 8 0 pfstate 320 1092 0 1090 3 2 1 3 0 8 0 pfrule 1360 2879 0 2144 68 6 62 62 0 8 0 art_heap8 4096 8 0 6 8 6 2 4 0 8 0 art_heap4 256 5429 0 4991 62 34 28 32 0 8 0 art_table 32 5437 0 4997 5 0 5 5 0 8 0 art_node 16 1518 0 1429 1 0 1 1 0 8 0 sysvmsgpl 40 49 0 9 1 0 1 1 0 8 0 semupl 112 12 0 12 2 2 0 1 0 8 0 semapl 112 279 0 261 1 0 1 1 0 8 0 shmpl 112 173 0 45 4 0 4 4 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino2pl 256 41387 0 39872 96 0 96 96 0 8 0 ffsino 272 41387 0 39872 102 0 102 102 0 8 0 nchpl 144 80176 0 78553 63 0 63 63 0 8 0 rtmask 32 110 0 108 10 9 1 1 0 8 0 uvmvnodes 80 5926 0 0 121 0 121 121 0 8 0 vnodes 224 5926 0 0 349 0 349 349 0 8 0 namei 1024 285524 0 285524 9 8 1 2 0 8 1 percpumem 16 331 0 290 1 0 1 1 0 8 0 vcpupl 2048 338 0 0 43 0 43 43 0 8 0 vmpool 560 392 0 54 27 2 25 25 0 8 0 pfiaddrpl 120 1041 0 338 24 2 22 22 0 8 0 scsiplug 72 26 0 26 9 9 0 1 0 8 0 scxspl 216 233757 0 233757 42 41 1 8 0 8 1 plimitpl 152 3651 0 3636 1 0 1 1 0 8 0 sigapl 424 30630 0 30568 10 2 8 8 0 8 0 futexpl 64 303924 0 303922 7 6 1 1 0 8 0 knotepl 120 600 0 0 6 0 6 6 0 8 0 kqueuepl 216 26465 0 26455 242 237 5 8 0 8 4 pipepl 336 5828 0 5800 147 140 7 9 0 8 4 fdescpl 496 30570 0 30544 6 2 4 5 0 8 0 filepl 152 216920 0 216676 329 312 17 21 0 8 6 lockfpl 104 16708 0 16705 32 30 2 4 0 8 1 lockfspl 48 3455 0 3452 1 0 1 1 0 8 0 sessionpl 144 112 0 95 1 0 1 1 0 8 0 pgrppl 48 147 0 130 1 0 1 1 0 8 0 ucredpl 96 28417 0 28400 1 0 1 1 0 8 0 zombiepl 144 30568 0 30567 3 2 1 1 0 8 0 processpl 1064 30630 0 30567 5 0 5 5 0 8 0 procpl 672 79846 0 79770 32 24 8 9 0 8 0 srpgc 96 131 0 131 24 24 0 1 0 8 0 sosppl 168 195 0 194 36 35 1 1 0 8 0 sockpl 480 49518 0 49487 937 927 10 36 0 8 6 mcl64k 65536 33 0 0 3 0 3 3 0 8 0 mcl16k 16384 17 0 0 3 0 3 3 0 8 0 mcl12k 12288 25 0 0 2 0 2 2 0 8 0 mcl9k 9216 17 0 0 2 0 2 2 0 8 0 mcl8k 8192 25 0 0 4 1 3 3 0 8 0 mcl4k 4096 18 0 0 3 0 3 3 0 8 0 mcl2k2 2112 9 0 0 1 0 1 1 0 8 0 mcl2k 2048 692 0 0 48 20 28 39 0 8 0 mtagpl 96 1654 0 0 21 0 21 21 0 8 0 mbufpl 256 5812 0 0 322 0 322 322 0 8 0 bufpl 288 47599 0 41263 453 0 453 453 0 8 0 anonpl 24 8586629 0 8564990 588 436 152 182 0 186 1 amapchunkpl 152 936140 0 935344 203 164 39 50 0 158 0 amappl16 200 85581 0 84585 305 249 56 66 0 8 0 amappl15 192 2597 0 2592 1 0 1 1 0 8 0 amappl14 184 4901 0 4894 1 0 1 1 0 8 0 amappl13 176 3964 0 3962 1 0 1 1 0 8 0 amappl12 168 1251 0 1242 1 0 1 1 0 8 0 amappl11 160 2766 0 2752 1 0 1 1 0 8 0 amappl10 152 6586 0 6583 1 0 1 1 0 8 0 amappl9 144 5715 0 5712 1 0 1 1 0 8 0 amappl8 136 6996 0 6772 8 0 8 8 0 8 0 amappl7 128 4537 0 4518 1 0 1 1 0 8 0 amappl6 120 5755 0 5718 3 1 2 2 0 8 0 amappl5 112 33310 0 33294 1 0 1 1 0 8 0 amappl4 104 7872 0 7837 4 2 2 2 0 8 0 amappl3 96 4058 0 4045 1 0 1 1 0 8 0 amappl2 88 7281 0 7184 5 2 3 3 0 8 0 amappl1 80 544296 0 543743 19 5 14 19 0 8 0 amappl 88 374356 0 373939 13 2 11 11 0 92 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 253 0 253 1 1 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 175 0 45 4 1 3 3 0 8 0 uaddrrnd 24 30962 0 30598 3 0 3 3 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 30962 0 30598 3 0 3 3 0 8 0 vmmpekpl 168 195183 0 195076 6 1 5 5 0 8 0 vmmpepl 168 2781285 0 2777532 758 555 203 205 0 357 17 vmsppl 368 30961 0 30598 36 2 34 34 0 8 0 rwobjpl 56 656553 0 648167 166 45 121 123 0 8 0 pdppl 4096 61931 0 61534 1282 875 407 408 0 8 10 pvpl 32 14241533 0 14218396 880 661 219 292 0 265 0 pmappl 248 30961 0 30598 24 0 24 24 0 8 0 extentpl 40 58 0 38 1 0 1 1 0 8 0 phpool 112 2998 0 1389 47 0 47 47 0 8 0 ddb{0}> machine ddbcpu 0 Invalid cpu 0 ddb{0}> trace db_enter() at db_enter+0x18 sys/arch/amd64/amd64/db_interface.c:440 panic(ffffffff82579a90) at panic+0x177 sys/kern/subr_prf.c:202 __assert(ffffffff825ec6cc,ffffffff82633a76,131,ffffffff825feb3f) at __assert+0x25 sys/kern/subr_prf.c:161 tun_clone_destroy(ffff800000c9e800) at tun_clone_destroy+0x278 sys/net/if_tun.c:305 if_clone_destroy(ffff80002b53f3d0) at if_clone_destroy+0x132 sys/net/if.c:1218 soo_ioctl(fffffd80785e0b60,80206979,ffff80002b53f3d0,ffff8000211927f0) at soo_ioctl+0x26c sys_ioctl(ffff8000211927f0,ffff80002b53f4e8,ffff80002b53f540) at sys_ioctl+0x4a2 syscall(ffff80002b53f5b0) at syscall+0x489 mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff80002b53f5b0) at syscall+0x489 sys/arch/amd64/amd64/trap.c:585 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0xe1f2d5e8b80, count: -9 ddb{0}> machine ddbcpu 1 Stopped at x86_ipi_db+0x1a: addq $0x8,%rsp x86_ipi_db(ffff800020ce8ff0) at x86_ipi_db+0x1a sys/arch/amd64/amd64/db_interface.c:393 x86_ipi_handler() at x86_ipi_handler+0xb7 sys/arch/amd64/amd64/ipi.c:106 Xresume_lapic_ipi() at Xresume_lapic_ipi+0x23 acpicpu_idle() at acpicpu_idle+0x312 sys/dev/acpi/acpicpu.c:1206 sched_idle(ffff800020ce8ff0) at sched_idle+0x417 sys/kern/kern_sched.c:178 end trace frame: 0x0, count: 10 ddb{1}> tac No such command