panic: kernel diagnostic assertion "sc->sc_dev == 0" failed: file "/syzkaller/managers/main/kernel/sys/net/if_tun.c", line 315 Stopped at db_enter+0x18: addq $0x8,%rsp TID PID UID PRFLAGS PFLAGS CPU COMMAND *271228 10598 0 0x2 0 0 ifconfig db_enter() at db_enter+0x18 sys/arch/amd64/amd64/db_interface.c:437 panic(ffffffff82722f34) at panic+0x161 sys/kern/subr_prf.c:198 __assert(ffffffff827a0c78,ffffffff827d347f,13b,ffffffff827b3ae6) at __assert+0x25 sys/kern/subr_prf.c:157 tun_clone_destroy(ffff800000d29800) at tun_clone_destroy+0x234 sys/net/if_tun.c:315 if_clone_destroy(ffff8000299cff40) at if_clone_destroy+0x132 sys/net/if.c:1247 sys_ioctl(ffff8000ffff1328,ffff8000299d0050,ffff8000299d00a0) at sys_ioctl+0x49e syscall(ffff8000299d0120) at syscall+0x4a4 sys/arch/amd64/amd64/trap.c:625 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x7f7ffffcb180, count: 7 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> ddb> set $lines = 0 ddb> set $maxwidth = 0 ddb> show panic *cpu0: kernel diagnostic assertion "sc->sc_dev == 0" failed: file "/syzkaller/managers/main/kernel/sys/net/if_tun.c", line 315 ddb> trace db_enter() at db_enter+0x18 sys/arch/amd64/amd64/db_interface.c:437 panic(ffffffff82722f34) at panic+0x161 sys/kern/subr_prf.c:198 __assert(ffffffff827a0c78,ffffffff827d347f,13b,ffffffff827b3ae6) at __assert+0x25 sys/kern/subr_prf.c:157 tun_clone_destroy(ffff800000d29800) at tun_clone_destroy+0x234 sys/net/if_tun.c:315 if_clone_destroy(ffff8000299cff40) at if_clone_destroy+0x132 sys/net/if.c:1247 sys_ioctl(ffff8000ffff1328,ffff8000299d0050,ffff8000299d00a0) at sys_ioctl+0x49e syscall(ffff8000299d0120) at syscall+0x4a4 sys/arch/amd64/amd64/trap.c:625 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x7f7ffffcb180, count: -8 ddb> show registers rdi 0 rsi 0x1 rbp 0xffff8000299cfdd0 rbx 0x80206979 __kernel_virt_to_phys+0x206979 rdx 0 rcx 0 rax 0xffff8000ffff1328 r8 0 r9 0x8080808080808080 r10 0x502a9990764a8ef2 r11 0xb24c0ffbd6d8c72f r12 0 r13 0 r14 0 r15 0x1 rip 0xffffffff81a69eb8 db_enter+0x18 cs 0x8 rflags 0x246 rsp 0xffff8000299cfdc0 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb> show proc PROC (ifconfig) pid=271228 stat=onproc flags process=2 proc=0 pri=86, usrpri=86, nice=20 forw=0xffffffffffffffff, list=0xffff8000ffff1070,0xffffffff82cf3498 process=0xffff80002e85c000 user=0xffff8000299cb000, vmspace=0xfffffd807f0126b8 estcpu=36, cpticks=1, pctcpu=0.0 user=0, sys=1, intr=0 ddb> ps PID TID PPID UID S FLAGS WAIT COMMAND *10598 271228 94253 0 7 0x2 ifconfig 94253 516726 9554 0 3 0x10008a sigsusp sh 9554 23347 33568 0 3 0x82 wait syz-executor.0 5418 489220 33568 0 3 0x82 piperd syz-executor.5 65486 104824 33568 0 3 0x82 piperd syz-executor.2 39067 43203 33568 0 3 0x82 piperd syz-executor.7 74489 406805 33568 0 3 0x82 nanoslp syz-executor.1 81754 221782 33568 0 3 0x82 piperd syz-executor.3 46343 177502 1 0 3 0x100083 ttyin getty 84747 83717 33568 0 3 0x82 nanoslp syz-executor.6 16560 408603 33568 0 3 0x82 piperd syz-executor.4 27186 447557 0 0 3 0x14200 bored sosplice 33568 215638 90426 0 3 0x82 wait syz-fuzzer 33568 237213 90426 0 3 0x4000082 nanoslp syz-fuzzer 33568 269105 90426 0 3 0x4000082 wait syz-fuzzer 33568 498625 90426 0 3 0x4000082 thrsleep syz-fuzzer 33568 59168 90426 0 3 0x4000082 thrsleep syz-fuzzer 33568 56948 90426 0 3 0x4000082 wait syz-fuzzer 33568 383040 90426 0 3 0x4000082 wait syz-fuzzer 33568 430708 90426 0 3 0x4000082 thrsleep syz-fuzzer 33568 323191 90426 0 3 0x4000082 wait syz-fuzzer 33568 53445 90426 0 3 0x4000082 thrsleep syz-fuzzer 33568 947 90426 0 3 0x4000082 wait syz-fuzzer 33568 27929 90426 0 3 0x4000082 wait syz-fuzzer 33568 462103 90426 0 3 0x4000082 thrsleep syz-fuzzer 33568 437537 90426 0 3 0x4000082 wait syz-fuzzer 90426 110222 19519 0 3 0x10008a sigsusp ksh 19519 11017 45706 0 3 0x9a kqread sshd 45706 502970 1 0 3 0x88 kqread sshd 44838 137946 26830 73 3 0x1100090 kqread syslogd 26830 245243 1 0 3 0x100082 netio syslogd 94531 499228 1 0 3 0x100080 kqread resolvd 98702 430878 0 0 3 0x14200 bored smr 12893 95929 0 0 2 0x14200 zerothread 69200 302871 0 0 3 0x14200 aiodoned aiodoned 50462 426363 0 0 3 0x14200 syncer update 92837 372620 0 0 3 0x14200 cleaner cleaner 23663 91216 0 0 3 0x14200 reaper reaper 58013 259426 0 0 3 0x14200 pgdaemon pagedaemon 21947 446164 0 0 3 0x14200 bored viomb 72542 211858 0 0 3 0x40014200 acpi0 acpi0 82633 8928 0 0 3 0x14200 bored softnet 91229 253917 0 0 3 0x14200 bored softnet 97415 439040 0 0 3 0x14200 bored softnet 74783 298652 0 0 3 0x14200 bored softnet 76792 466523 0 0 3 0x14200 bored systqmp 19243 194285 0 0 3 0x14200 bored systq 5176 104921 0 0 2 0x40014200 softclock 32570 101782 0 0 3 0x40014200 idle0 1 160132 0 0 3 0x82 wait init 0 0 -1 0 3 0x10200 scheduler swapper ddb> show all locks No such command ddb> show malloc Type InUse MemUse HighUse Limit Requests Type Lim devbuf 10183 6428K 6935K 78643K 17878 0 pcb 13 18K 23K 78643K 3254 0 rtable 145 14K 14K 78643K 2681 0 ifaddr 72 22K 24K 78643K 673 0 sysctl 2 0K 0K 78643K 2 0 counters 25 17K 17K 78643K 203 0 ioctlops 0 0K 4K 78643K 2257 0 iov 0 0K 44K 78643K 1097 0 mount 1 1K 1K 78643K 1 0 log 0 0K 0K 78643K 4 0 vnodes 1594 100K 101K 78643K 8211 0 UFS quota 1 32K 32K 78643K 1 0 UFS mount 5 36K 36K 78643K 5 0 shm 2 1K 5K 78643K 81 0 VM map 2 1K 1K 78643K 2 0 sem 12 0K 0K 78643K 875 0 dirhash 12 2K 2K 78643K 12 0 ACPI 1697 195K 286K 78643K 12548 0 file desc 12 41K 73K 78643K 7072 0 sigio 0 0K 0K 78643K 66 0 proc 65 51K 75K 78643K 1819 0 subproc 104 6K 6K 78643K 650 0 NFS srvsock 1 0K 0K 78643K 1 0 NFS daemon 1 16K 16K 78643K 1 0 ip_moptions 0 0K 0K 78643K 237 0 in_multi 52 3K 6K 78643K 868 0 ether_multi 1 0K 0K 78643K 41 0 mrt 1 0K 0K 78643K 42 0 ISOFS mount 1 32K 32K 78643K 1 0 MSDOSFS mount 1 16K 16K 78643K 1 0 ttys 73 334K 334K 78643K 73 0 exec 0 0K 1K 78643K 1659 0 pfkey data 0 0K 0K 78643K 3 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 8 62K 64K 78643K 10 0 UVM amap 269 91K 104K 78643K 45919 0 UVM aobj 131 4K 4K 78643K 134 0 memdesc 1 4K 4K 78643K 1 0 crypto data 1 1K 1K 78643K 1 0 ip6_options 0 0K 0K 78643K 191 0 NDP 12 0K 2K 78643K 256 0 temp 123 5770K 6822K 78643K 54105 0 kqueue 6 10K 28K 78643K 634 0 SYN cache 2 16K 16K 78643K 2 0 ddb> show all pools Name Size Requests Fail Releases Pgreq Pgrel Npage Hiwat Minpg Maxpg Idle rtpcb 120 891 0 890 14 13 1 3 0 8 0 rtentry 112 831 0 773 4 2 2 4 0 8 0 unpcb 144 6221 0 6215 85 84 1 8 0 8 0 syncache 296 64 0 64 14 14 0 1 0 8 0 sackhl 24 1 0 1 1 1 0 1 0 8 0 tcpqe 32 129 0 129 10 10 0 1 0 8 0 tcpcb 776 2910 0 2904 77 73 4 14 0 8 3 arp 88 106 0 96 1 0 1 1 0 8 0 ipq 40 72 0 72 3 3 0 1 0 8 0 ipqe 40 146 0 146 3 3 0 1 0 8 0 inpcb 336 13124 0 13119 152 148 4 16 0 8 3 nd6 48 180 0 168 1 0 1 1 0 8 0 pkpcb 40 9 0 9 2 2 0 1 0 8 0 kcovpl 48 50 0 42 1 0 1 1 0 8 0 ppxss 1160 95 0 95 14 14 0 1 0 8 0 pppxif 1360 48 0 48 5 5 0 1 0 8 0 pfstscr 40 141 0 126 2 1 1 1 0 8 0 pfosfp 40 46 0 43 1 0 1 1 0 8 0 pfosfpen 112 46 0 0 2 0 2 2 0 8 0 pfanchor 1280 540 17 28 43 0 43 43 0 8 0 pftag 88 1 0 0 1 0 1 1 0 8 0 pfqueue 264 3 0 3 1 1 0 1 0 8 0 pfstitem 24 28 0 0 1 0 1 1 0 8 0 pfstkey 128 203 0 194 2 1 1 1 0 8 0 pfstate 352 135 0 121 3 1 2 2 0 8 0 rttmr 136 13 0 13 3 3 0 1 0 8 0 art_heap8 4096 1 0 0 1 0 1 1 0 8 0 art_heap4 256 4475 0 4231 50 34 16 29 0 8 0 art_table 32 4476 0 4231 4 1 3 4 0 8 0 art_node 16 827 0 778 1 0 1 1 0 8 0 sysvmsgpl 40 11 0 4 1 0 1 1 0 8 0 semapl 112 873 0 863 1 0 1 1 0 8 0 shmpl 112 131 0 3 5 1 4 4 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino2pl 256 11416 0 9986 91 0 91 91 0 8 0 ffsino 240 11416 0 9986 85 0 85 85 0 8 0 nchpl 144 20620 0 18990 63 1 62 63 0 8 0 rtmask 32 3 0 3 1 1 0 1 0 8 0 uvmvnodes 80 5926 0 0 121 0 121 121 0 8 0 vnodes 216 5926 0 0 330 0 330 330 0 8 0 namei 1024 80145 0 80145 5 4 1 3 0 8 1 vmpool 664 52 0 52 6 6 0 1 0 8 0 kstatmem 264 262 0 242 2 0 2 2 0 8 0 scsiplug 72 4 0 4 1 1 0 1 0 8 0 scxspl 216 59035 0 59035 22 21 1 8 0 8 1 plimitpl 152 1239 0 1224 1 0 1 1 0 8 0 sigapl 424 7302 0 7263 8 2 6 8 0 8 0 futexpl 64 89379 0 89379 3 2 1 1 0 8 1 knotepl 120 112573 0 112507 73 67 6 12 0 8 2 kqueuepl 184 1308 0 1303 14 13 1 4 0 8 0 pipepl 288 2686 0 2658 30 27 3 7 0 8 0 fdescpl 432 7265 0 7245 4 0 4 4 0 8 0 filepl 120 64722 0 64507 116 105 11 19 0 8 2 lockfpl 104 1539 0 1538 3 2 1 2 0 8 0 lockfspl 48 395 0 394 1 0 1 1 0 8 0 sessionpl 144 68 0 53 1 0 1 1 0 8 0 pgrppl 48 76 0 61 1 0 1 1 0 8 0 ucredpl 104 7870 0 7862 1 0 1 1 0 8 0 zombiepl 144 7265 0 7263 2 1 1 1 0 8 0 processpl 1008 7302 0 7263 10 4 6 9 0 8 0 procpl 696 17381 0 17329 21 14 7 10 0 8 0 sosppl 168 107 0 107 13 13 0 1 0 8 0 sockpl 456 20262 0 20250 491 485 6 31 0 8 4 mcl64k 65536 270 0 270 20 19 1 1 0 8 1 mcl16k 16384 133 0 133 20 19 1 1 0 8 1 mcl12k 12288 833 0 833 9 8 1 1 0 8 1 mcl9k 9216 140 0 140 23 23 0 1 0 8 0 mcl8k 8192 456 0 456 19 18 1 1 0 8 1 mcl4k 4096 677 0 677 15 14 1 1 0 8 1 mcl2k2 2112 43 0 43 17 17 0 1 0 8 0 mcl2k 2048 91302 0 91256 49 42 7 34 0 8 0 mtagpl 96 173 0 173 6 6 0 4 0 8 0 mbufpl 256 217111 0 217024 427 419 8 64 0 8 0 bufpl 288 14618 0 8221 458 0 458 458 0 8 0 anonpl 24 1372086 0 1358481 182 69 113 137 0 188 0 amapchunkpl 152 128879 0 128307 69 40 29 41 0 158 0 amappl16 200 12483 0 11901 73 41 32 43 0 8 0 amappl15 192 70 0 67 1 0 1 1 0 8 0 amappl14 184 317 0 307 2 1 1 2 0 8 0 amappl13 176 5 0 4 1 0 1 1 0 8 0 amappl12 168 912 0 907 1 0 1 1 0 8 0 amappl11 160 46 0 42 1 0 1 1 0 8 0 amappl10 152 80 0 70 1 0 1 1 0 8 0 amappl9 144 998 0 998 5 4 1 1 0 8 1 amappl8 136 353 0 270 3 0 3 3 0 8 0 amappl7 128 246 0 223 2 0 2 2 0 8 0 amappl6 120 349 0 337 2 1 1 2 0 8 0 amappl5 112 386 0 381 1 0 1 1 0 8 0 amappl4 104 964 0 939 2 1 1 2 0 8 0 amappl3 96 20402 0 20374 2 0 2 2 0 8 0 amappl2 88 8007 0 7957 3 1 2 3 0 8 0 amappl1 80 162771 0 162272 26 12 14 26 0 8 0 amappl 88 44861 0 44718 5 0 5 5 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 133 0 3 3 0 3 3 0 8 0 uaddrrnd 24 7317 0 7297 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 7317 0 7297 1 0 1 1 0 8 0 vmmpekpl 168 60876 0 60818 4 0 4 4 0 8 0 vmmpepl 168 676882 0 674848 265 120 145 158 0 357 20 vmsppl 344 7316 0 7297 3 0 3 3 0 8 0 rwobjpl 24 174234 0 166718 52 4 48 48 0 8 0 pdppl 4096 14640 0 14594 553 499 54 68 0 8 8 pvpl 32 2835544 0 2817486 497 311 186 362 0 265 0 pmappl 216 7316 0 7297 2 0 2 2 0 8 0 extentpl 40 56 0 38 1 0 1 1 0 8 0 phpool 112 1986 0 1250 24 0 24 24 0 8 0 ddb> machine ddbcpu 0 No such command ddb> trace db_enter() at db_enter+0x18 sys/arch/amd64/amd64/db_interface.c:437 panic(ffffffff82722f34) at panic+0x161 sys/kern/subr_prf.c:198 __assert(ffffffff827a0c78,ffffffff827d347f,13b,ffffffff827b3ae6) at __assert+0x25 sys/kern/subr_prf.c:157 tun_clone_destroy(ffff800000d29800) at tun_clone_destroy+0x234 sys/net/if_tun.c:315 if_clone_destroy(ffff8000299cff40) at if_clone_destroy+0x132 sys/net/if.c:1247 sys_ioctl(ffff8000ffff1328,ffff8000299d0050,ffff8000299d00a0) at sys_ioctl+0x49e syscall(ffff8000299d0120) at syscall+0x4a4 sys/arch/amd64/amd64/trap.c:625 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x7f7ffffcb180, count: -8 ddb> machine ddbcpu 1 No such command ddb> trace db_enter() at db_enter+0x18 sys/arch/amd64/amd64/db_interface.c:437 panic(ffffffff82722f34) at panic+0x161 sys/kern/subr_prf.c:198 __assert(ffffffff827a0c78,ffffffff827d347f,13b,ffffffff827b3ae6) at __assert+0x25 sys/kern/subr_prf.c:157 tun_clone_destroy(ffff800000d29800) at tun_clone_destroy+0x234 sys/net/if_tun.c:315 if_clone_destroy(ffff8000299cff40) at if_clone_destroy+0x132 sys/net/if.c:1247 sys_ioctl(ffff8000ffff1328,ffff8000299d0050,ffff8000299d00a0) at sys_ioctl+0x49e syscall(ffff8000299d0120) at syscall+0x4a4 sys/arch/amd64/amd64/trap.c:625 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x7f7ffffcb180, count: -8