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 * 94432 38805 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(ffff800000d14800) at tun_clone_destroy+0x234 sys/net/if_tun.c:315 if_clone_destroy(ffff8000216e0820) at if_clone_destroy+0x132 sys/net/if.c:1247 sys_ioctl(ffff8000217275f0,ffff8000216e0930,ffff8000216e0980) at sys_ioctl+0x49e syscall(ffff8000216e0a00) at syscall+0x4a4 sys/arch/amd64/amd64/trap.c:625 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x7f7ffffe51d0, 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(ffff800000d14800) at tun_clone_destroy+0x234 sys/net/if_tun.c:315 if_clone_destroy(ffff8000216e0820) at if_clone_destroy+0x132 sys/net/if.c:1247 sys_ioctl(ffff8000217275f0,ffff8000216e0930,ffff8000216e0980) at sys_ioctl+0x49e syscall(ffff8000216e0a00) at syscall+0x4a4 sys/arch/amd64/amd64/trap.c:625 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x7f7ffffe51d0, count: -8 ddb> show registers rdi 0 rsi 0x1 rbp 0xffff8000216e06b0 rbx 0x80206979 __kernel_virt_to_phys+0x206979 rdx 0 rcx 0 rax 0xffff8000217275f0 r8 0 r9 0x8080808080808080 r10 0x80a3958552221208 r11 0xcca19691cfdfabaf r12 0 r13 0 r14 0 r15 0x1 rip 0xffffffff81a69eb8 db_enter+0x18 cs 0x8 rflags 0x246 rsp 0xffff8000216e06a0 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb> show proc PROC (ifconfig) pid=94432 stat=onproc flags process=2 proc=0 pri=83, usrpri=84, nice=20 forw=0xffffffffffffffff, list=0xffff800021727080,0xffffffff82cf3498 process=0xffff8000fffeefd0 user=0xffff8000216db000, vmspace=0xfffffd8069b5fd80 estcpu=34, cpticks=2, pctcpu=0.0 user=0, sys=2, intr=0 ddb> ps PID TID PPID UID S FLAGS WAIT COMMAND *38805 94432 43314 0 7 0x2 ifconfig 43314 303957 98384 0 3 0x10008a sigsusp sh 98384 79679 50836 0 3 0x82 wait syz-executor.0 92279 162076 25433 60928 3 0x90 nanoslp syz-executor.4 92279 188246 25433 60928 3 0x4000090 fsleep syz-executor.4 92279 384737 25433 60928 3 0x4000090 pipewr syz-executor.4 92279 457465 25433 60928 3 0x4000090 fsleep syz-executor.4 59214 433369 50836 0 3 0x82 piperd syz-executor.5 36948 376320 50836 0 3 0x82 piperd syz-executor.7 4223 233547 50836 0 3 0x82 piperd syz-executor.2 47647 196001 50836 0 3 0x82 piperd syz-executor.6 25433 335093 50836 0 2 0x482 syz-executor.4 44840 337017 0 0 3 0x14280 nfsidl nfsio 58114 99918 0 0 3 0x14280 nfsidl nfsio 64927 76733 0 0 3 0x14280 nfsidl nfsio 35114 491331 0 0 3 0x14280 nfsidl nfsio 57687 37028 0 0 3 0x14280 nfsidl nfsio 35471 505911 0 0 3 0x14280 nfsidl nfsio 79854 355388 0 0 3 0x14280 nfsidl nfsio 54071 393982 0 0 3 0x14280 nfsidl nfsio 16607 28856 0 0 3 0x14280 nfsidl nfsio 22971 417754 0 0 3 0x14280 nfsidl nfsio 34511 214345 0 0 3 0x14280 nfsidl nfsio 87775 417858 0 0 3 0x14280 nfsidl nfsio 24669 29190 0 0 3 0x14280 nfsidl nfsio 48412 320296 0 0 3 0x14280 nfsidl nfsio 92863 372213 0 0 3 0x14280 nfsidl nfsio 85804 45676 0 0 3 0x14280 nfsidl nfsio 71098 107292 0 0 3 0x14280 nfsidl nfsio 67771 24914 0 0 3 0x14280 nfsidl nfsio 10360 484911 0 0 3 0x14280 nfsidl nfsio 14036 347378 0 0 3 0x14280 nfsidl nfsio 318 232200 0 0 3 0x14200 acct acct 7653 346604 0 0 3 0x14200 bored sosplice 78196 315663 50836 0 3 0x82 piperd syz-executor.3 24256 52050 50836 0 3 0x82 piperd syz-executor.1 50836 362066 22898 0 3 0x82 wait syz-fuzzer 50836 134764 22898 0 3 0x4000082 nanoslp syz-fuzzer 50836 76194 22898 0 3 0x4000082 thrsleep syz-fuzzer 50836 334378 22898 0 3 0x4000082 thrsleep syz-fuzzer 50836 205109 22898 0 3 0x4000082 wait syz-fuzzer 50836 35809 22898 0 3 0x4000082 wait syz-fuzzer 50836 280744 22898 0 3 0x4000082 wait syz-fuzzer 50836 34099 22898 0 3 0x4000082 wait syz-fuzzer 50836 510856 22898 0 3 0x4000082 thrsleep syz-fuzzer 50836 310383 22898 0 3 0x4000082 thrsleep syz-fuzzer 50836 243051 22898 0 3 0x4000082 wait syz-fuzzer 50836 390242 22898 0 3 0x4000082 thrsleep syz-fuzzer 50836 188915 22898 0 3 0x4000082 wait syz-fuzzer 50836 74443 22898 0 3 0x4000082 wait syz-fuzzer 22898 63318 92567 0 3 0x10008a sigsusp ksh 92567 373220 84059 0 3 0x9a kqread sshd 631 50449 1 0 3 0x100083 ttyopn getty 84059 8242 1 0 3 0x88 kqread sshd 46595 188060 92922 73 3 0x1100090 kqread syslogd 92922 406649 1 0 3 0x100082 netio syslogd 14991 66565 1 0 3 0x100080 kqread resolvd 76871 239802 17720 77 2 0x100092 dhcpleased 36276 154042 17720 77 3 0x100092 kqread dhcpleased 17720 381004 1 0 3 0x80 kqread dhcpleased 11072 133757 0 0 3 0x14200 bored smr 98171 350283 0 0 2 0x14200 zerothread 77441 415648 0 0 3 0x14200 aiodoned aiodoned 70031 332288 0 0 3 0x14200 syncer update 77260 323500 0 0 3 0x14200 cleaner cleaner 44724 366392 0 0 3 0x14200 reaper reaper 40643 480626 0 0 3 0x14200 pgdaemon pagedaemon 96598 315967 0 0 3 0x14200 bored viomb 55511 99992 0 0 3 0x40014200 acpi0 acpi0 64243 507297 0 0 3 0x14200 bored softnet 32308 509304 0 0 3 0x14200 bored softnet 16074 374434 0 0 3 0x14200 bored softnet 66215 366848 0 0 3 0x14200 bored softnet 78995 448608 0 0 3 0x14200 bored systqmp 29604 230701 0 0 3 0x14200 bored systq 94231 516324 0 0 2 0x40014200 softclock 84737 23125 0 0 3 0x40014200 idle0 1 27186 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 10215 6401K 6835K 78643K 15345 0 pcb 13 16K 18K 78643K 418 0 rtable 179 14K 15K 78643K 914 0 ifaddr 66 20K 21K 78643K 340 0 sysctl 2 0K 0K 78643K 2 0 counters 26 17K 17K 78643K 158 0 ioctlops 0 0K 2K 78643K 498 0 iov 0 0K 40K 78643K 320 0 mount 1 1K 1K 78643K 1 0 log 0 0K 0K 78643K 4 0 vnodes 1401 88K 88K 78643K 3244 0 UFS quota 1 32K 32K 78643K 1 0 UFS mount 5 36K 36K 78643K 5 0 shm 2 1K 5K 78643K 26 0 VM map 2 1K 1K 78643K 2 0 sem 12 0K 0K 78643K 288 0 dirhash 12 2K 2K 78643K 12 0 ACPI 1697 195K 286K 78643K 12548 0 file desc 13 45K 66K 78643K 2517 0 sigio 1 0K 0K 78643K 173 0 proc 65 67K 75K 78643K 856 0 subproc 104 6K 6K 78643K 260 0 NFS srvsock 1 0K 0K 78643K 1 0 NFS daemon 1 16K 16K 78643K 1 0 ip_moptions 0 0K 0K 78643K 151 0 in_multi 70 4K 6K 78643K 321 0 ether_multi 1 0K 0K 78643K 22 0 mrt 1 0K 0K 78643K 4 0 ISOFS mount 1 32K 32K 78643K 1 0 MSDOSFS mount 1 16K 16K 78643K 1 0 ttys 247 1102K 1102K 78643K 247 0 exec 0 0K 1K 78643K 1019 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 272 83K 97K 78643K 17684 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 136 0 NDP 10 0K 1K 78643K 113 0 temp 120 5770K 6809K 78643K 40878 0 kqueue 12 18K 26K 78643K 224 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 263 0 260 4 3 1 3 0 8 0 rtentry 112 296 0 218 4 0 4 4 0 8 0 unpcb 144 3313 0 3298 24 15 9 10 0 8 8 syncache 296 18 0 18 5 5 0 1 0 8 0 tcpqe 32 87 0 87 2 2 0 1 0 8 0 tcpcb 776 1398 0 1392 56 47 9 18 0 8 8 arp 88 47 0 30 1 0 1 1 0 8 0 ipq 40 1 0 0 1 0 1 1 0 8 0 ipqe 40 3 0 2 1 0 1 1 0 8 0 inpcb 336 6119 0 6100 59 48 11 18 0 8 8 nd6 48 66 0 49 1 0 1 1 0 8 0 pkpcb 40 38 0 38 3 3 0 1 0 8 0 kcovpl 48 20 0 12 1 0 1 1 0 8 0 mppekey 1024 3 0 3 1 1 0 1 0 8 0 ppxss 1160 92 0 92 5 4 1 1 0 8 1 pppxif 1360 70 0 70 1 1 0 1 0 8 0 pfstscr 40 11 0 7 1 0 1 1 0 8 0 pfanchor 1280 132 0 0 11 0 11 11 0 8 0 pfqueue 264 2 0 2 1 1 0 1 0 8 0 pfstitem 24 8 0 0 1 0 1 1 0 8 0 pfstkey 128 18 0 15 1 0 1 1 0 8 0 pfstate 352 11 0 7 1 0 1 1 0 8 0 art_heap8 4096 1 0 0 1 0 1 1 0 8 0 art_heap4 256 1405 0 1036 41 14 27 30 0 8 2 art_table 32 1406 0 1036 4 0 4 4 0 8 0 art_node 16 289 0 221 1 0 1 1 0 8 0 semupl 112 1 0 1 1 1 0 1 0 8 0 semapl 112 286 0 276 1 0 1 1 0 8 0 shmpl 112 131 0 3 4 0 4 4 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino2pl 256 5127 0 3699 90 0 90 90 0 8 0 ffsino 240 5127 0 3699 85 0 85 85 0 8 0 nchpl 144 8767 0 7131 63 0 63 63 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 33172 0 33172 4 3 1 3 0 8 1 vmpool 664 6 0 6 2 2 0 1 0 8 0 kstatmem 264 140 0 120 2 0 2 2 0 8 0 scsiplug 72 3 0 3 1 1 0 1 0 8 0 scxspl 216 24798 0 24798 13 11 2 8 0 8 2 plimitpl 152 771 0 756 1 0 1 1 0 8 0 sigapl 424 2812 0 2750 8 0 8 8 0 8 0 futexpl 64 29320 0 29318 1 0 1 1 0 8 0 knotepl 120 32810 0 32728 22 17 5 12 0 8 1 kqueuepl 184 371 0 363 4 3 1 4 0 8 0 pipepl 288 892 0 863 11 8 3 7 0 8 0 fdescpl 432 2774 0 2750 4 0 4 4 0 8 1 filepl 120 25432 0 25193 42 26 16 19 0 8 8 lockfpl 104 958 0 956 4 3 1 2 0 8 0 lockfspl 48 366 0 364 1 0 1 1 0 8 0 sessionpl 144 35 0 19 1 0 1 1 0 8 0 pgrppl 48 42 0 26 1 0 1 1 0 8 0 ucredpl 104 3159 0 3148 1 0 1 1 0 8 0 zombiepl 144 2750 0 2750 2 1 1 1 0 8 1 processpl 1008 2812 0 2750 10 1 9 9 0 8 0 procpl 696 6521 0 6443 12 3 9 10 0 8 1 sosppl 168 245 0 244 2 1 1 1 0 8 0 sockpl 456 9740 0 9710 228 216 12 38 0 8 7 mcl64k 65536 90 0 90 5 4 1 1 0 8 1 mcl16k 16384 51 0 51 4 4 0 1 0 8 0 mcl12k 12288 119 0 119 4 3 1 1 0 8 1 mcl9k 9216 39 0 39 4 4 0 1 0 8 0 mcl8k 8192 177 0 177 2 1 1 1 0 8 1 mcl4k 4096 340 0 340 2 1 1 1 0 8 1 mcl2k2 2112 23 0 23 6 5 1 1 0 8 1 mcl2k 2048 81470 0 81404 41 31 10 29 0 8 0 mtagpl 96 584 0 266 11 1 10 10 0 8 0 mbufpl 256 166636 0 165933 185 127 58 113 0 8 0 bufpl 288 8447 0 2053 457 0 457 457 0 8 0 anonpl 24 602784 0 588779 172 38 134 134 0 188 26 amapchunkpl 152 51076 0 50463 46 4 42 42 0 158 10 amappl16 200 7444 0 6873 56 19 37 43 0 8 4 amappl15 192 15 0 14 1 0 1 1 0 8 0 amappl14 184 199 0 184 2 0 2 2 0 8 0 amappl13 176 5 0 5 1 1 0 1 0 8 0 amappl12 168 535 0 532 1 0 1 1 0 8 0 amappl11 160 49 0 39 1 0 1 1 0 8 0 amappl10 152 43 0 35 1 0 1 1 0 8 0 amappl9 144 975 0 974 1 0 1 1 0 8 0 amappl8 136 199 0 136 3 0 3 3 0 8 0 amappl7 128 168 0 146 2 0 2 2 0 8 0 amappl6 120 210 0 195 2 1 1 2 0 8 0 amappl5 112 194 0 187 1 0 1 1 0 8 0 amappl4 104 595 0 568 2 1 1 2 0 8 0 amappl3 96 7459 0 7416 2 0 2 2 0 8 0 amappl2 88 3304 0 3235 3 1 2 3 0 8 0 amappl1 80 64282 0 63640 28 12 16 26 0 8 0 amappl 88 17018 0 16862 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 2780 0 2756 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 2780 0 2756 1 0 1 1 0 8 0 vmmpekpl 168 26718 0 26663 3 0 3 3 0 8 0 vmmpepl 168 266467 0 264103 186 48 138 156 0 357 13 vmsppl 344 2779 0 2756 3 0 3 3 0 8 0 rwobjpl 24 75659 0 67977 48 0 48 48 0 8 0 pdppl 4096 5566 0 5512 248 186 62 66 0 8 8 pvpl 32 1215003 0 1195944 376 153 223 333 0 265 33 pmappl 216 2779 0 2756 2 0 2 2 0 8 0 extentpl 40 56 0 38 1 0 1 1 0 8 0 phpool 112 1243 0 431 25 0 25 25 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(ffff800000d14800) at tun_clone_destroy+0x234 sys/net/if_tun.c:315 if_clone_destroy(ffff8000216e0820) at if_clone_destroy+0x132 sys/net/if.c:1247 sys_ioctl(ffff8000217275f0,ffff8000216e0930,ffff8000216e0980) at sys_ioctl+0x49e syscall(ffff8000216e0a00) at syscall+0x4a4 sys/arch/amd64/amd64/trap.c:625 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x7f7ffffe51d0, 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(ffff800000d14800) at tun_clone_destroy+0x234 sys/net/if_tun.c:315 if_clone_destroy(ffff8000216e0820) at if_clone_destroy+0x132 sys/net/if.c:1247 sys_ioctl(ffff8000217275f0,ffff8000216e0930,ffff8000216e0980) at sys_ioctl+0x49e syscall(ffff8000216e0a00) at syscall+0x4a4 sys/arch/amd64/amd64/trap.c:625 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x7f7ffffe51d0, count: -8