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 *268724 36707 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(ffff800000d0c000) at tun_clone_destroy+0x234 sys/net/if_tun.c:315 if_clone_destroy(ffff8000265a2490) at if_clone_destroy+0x132 sys/net/if.c:1247 sys_ioctl(ffff8000280038c8,ffff8000265a25a0,ffff8000265a25f0) at sys_ioctl+0x49e syscall(ffff8000265a2670) at syscall+0x4a4 sys/arch/amd64/amd64/trap.c:625 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x7f7ffffd12e0, 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(ffff800000d0c000) at tun_clone_destroy+0x234 sys/net/if_tun.c:315 if_clone_destroy(ffff8000265a2490) at if_clone_destroy+0x132 sys/net/if.c:1247 sys_ioctl(ffff8000280038c8,ffff8000265a25a0,ffff8000265a25f0) at sys_ioctl+0x49e syscall(ffff8000265a2670) at syscall+0x4a4 sys/arch/amd64/amd64/trap.c:625 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x7f7ffffd12e0, count: -8 ddb> show registers rdi 0 rsi 0x1 rbp 0xffff8000265a2320 rbx 0x80206979 __kernel_virt_to_phys+0x206979 rdx 0 rcx 0 rax 0xffff8000280038c8 r8 0 r9 0x8080808080808080 r10 0xb6c9090f2ead9b46 r11 0x7175db84385c4edc r12 0 r13 0 r14 0 r15 0x1 rip 0xffffffff81a69eb8 db_enter+0x18 cs 0x8 rflags 0x246 rsp 0xffff8000265a2310 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb> show proc PROC (ifconfig) pid=268724 stat=onproc flags process=2 proc=0 pri=55, usrpri=60, nice=20 forw=0xffffffffffffffff, list=0xffff800028003358,0xffff80002ce330a8 process=0xffff8000ffff6400 user=0xffff80002659d000, vmspace=0xfffffd8069b91820 estcpu=10, cpticks=20, pctcpu=0.0 user=0, sys=20, intr=0 ddb> ps PID TID PPID UID S FLAGS WAIT COMMAND 39295 200015 97001 0 2 0 syz-executor.7 39295 107024 97001 0 3 0x4000080 fsleep syz-executor.7 34927 218186 65922 0 2 0x2 sh 60619 518402 25560 0 2 0x2 syz-executor.5 39762 66214 87300 0 2 0 syz-executor.1 40957 375422 67957 0 2 0x100000 sh *36707 268724 36525 0 7 0x2 ifconfig 62232 227995 80123 0 2 0 syz-executor.3 62232 145112 80123 0 3 0x4000080 fsleep syz-executor.3 65922 460030 25560 0 3 0x82 wait syz-executor.2 67957 391027 61417 0 3 0x10008a sigsusp sh 97001 216370 25560 0 2 0x482 syz-executor.7 36525 70779 43518 0 3 0x10008a sigsusp sh 61417 497799 25560 0 3 0x82 wait syz-executor.4 43518 54608 25560 0 3 0x82 wait syz-executor.0 80123 328397 25560 0 2 0x482 syz-executor.3 87300 6952 25560 0 2 0x482 syz-executor.1 40707 251230 25560 0 3 0x82 piperd syz-executor.6 43197 91327 1 0 3 0x100083 ttyin getty 91385 496847 0 0 3 0x14200 bored sosplice 97644 43478 0 0 3 0x14280 nfsidl nfsio 83063 151188 0 0 3 0x14280 nfsidl nfsio 48692 315336 0 0 3 0x14280 nfsidl nfsio 86839 128570 0 0 3 0x14280 nfsidl nfsio 69957 332541 0 0 3 0x14280 nfsidl nfsio 9766 275501 0 0 3 0x14280 nfsidl nfsio 5001 503723 0 0 3 0x14280 nfsidl nfsio 61386 59140 0 0 3 0x14280 nfsidl nfsio 63500 287584 0 0 3 0x14280 nfsidl nfsio 80228 321362 0 0 3 0x14280 nfsidl nfsio 64105 319919 0 0 3 0x14280 nfsidl nfsio 5204 365796 0 0 3 0x14280 nfsidl nfsio 34987 232125 0 0 3 0x14280 nfsidl nfsio 3295 208397 0 0 3 0x14280 nfsidl nfsio 72147 299983 0 0 3 0x14280 nfsidl nfsio 30461 364116 0 0 3 0x14280 nfsidl nfsio 22274 466031 0 0 3 0x14280 nfsidl nfsio 32599 76886 0 0 3 0x14280 nfsidl nfsio 38561 43764 0 0 3 0x14280 nfsidl nfsio 80441 209391 0 0 3 0x14280 nfsidl nfsio 25560 379595 65046 0 3 0x82 wait syz-fuzzer 25560 303005 65046 0 2 0x4000002 syz-fuzzer 25560 429020 65046 0 3 0x4000082 thrsleep syz-fuzzer 25560 35990 65046 0 3 0x4000082 wait syz-fuzzer 25560 238506 65046 0 3 0x4000082 wait syz-fuzzer 25560 322086 65046 0 3 0x4000082 thrsleep syz-fuzzer 25560 74984 65046 0 3 0x4000082 kqread syz-fuzzer 25560 128058 65046 0 3 0x4000082 wait syz-fuzzer 25560 147461 65046 0 3 0x4000082 wait syz-fuzzer 25560 256077 65046 0 3 0x4000082 thrsleep syz-fuzzer 25560 140265 65046 0 3 0x4000082 wait syz-fuzzer 25560 200921 65046 0 3 0x4000082 wait syz-fuzzer 25560 224514 65046 0 3 0x4000082 thrsleep syz-fuzzer 25560 516379 65046 0 3 0x4000082 wait syz-fuzzer 65046 161425 76463 0 3 0x10008a sigsusp ksh 76463 209990 50655 0 3 0x9a kqread sshd 50655 92451 1 0 3 0x88 kqread sshd 14128 257310 60881 73 2 0x1100010 syslogd 60881 23642 1 0 3 0x100082 netio syslogd 62847 438553 1 0 3 0x100080 kqread resolvd 66273 216652 91724 77 2 0x100092 dhcpleased 24440 103702 91724 77 3 0x100092 kqread dhcpleased 91724 10122 1 0 3 0x80 kqread dhcpleased 76238 414488 0 0 3 0x14200 bored smr 13891 484820 0 0 2 0x14200 zerothread 87645 61783 0 0 3 0x14200 aiodoned aiodoned 94369 230570 0 0 2 0x14600 update 11991 504062 0 0 3 0x14200 cleaner cleaner 50633 338010 0 0 3 0x14200 reaper reaper 52774 149036 0 0 3 0x14200 pgdaemon pagedaemon 67077 106172 0 0 3 0x14200 bored viomb 31525 326211 0 0 3 0x40014200 acpi0 acpi0 21368 302040 0 0 3 0x14200 bored softnet 24436 295749 0 0 3 0x14200 bored softnet 71286 499185 0 0 3 0x14200 bored softnet 27684 63521 0 0 3 0x14200 bored softnet 95758 432635 0 0 3 0x14200 bored systqmp 94177 226518 0 0 3 0x14200 bored systq 8470 43351 0 0 2 0x40014200 softclock 56035 405772 0 0 3 0x40014200 idle0 1 114331 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 10208 6404K 8059K 78643K 14859 0 pcb 13 13K 15K 78643K 619 0 rtable 141 4K 7K 78643K 1257 0 ifaddr 65 20K 23K 78643K 424 0 sysctl 2 0K 0K 78643K 2 0 counters 27 17K 17K 78643K 122 0 ioctlops 0 0K 2K 78643K 469 0 iov 0 0K 16K 78643K 161 0 mount 1 1K 1K 78643K 1 0 log 0 0K 0K 78643K 4 0 vnodes 1562 98K 98K 78643K 3555 0 UFS quota 1 32K 32K 78643K 1 0 UFS mount 5 36K 36K 78643K 5 0 shm 2 1K 9K 78643K 48 0 VM map 2 1K 1K 78643K 2 0 sem 12 0K 0K 78643K 565 0 dirhash 12 2K 2K 78643K 12 0 ACPI 1697 195K 286K 78643K 12548 0 file desc 18 65K 77K 78643K 2948 0 sigio 0 0K 0K 78643K 368 0 proc 65 67K 75K 78643K 1201 0 subproc 104 6K 6K 78643K 429 0 NFS srvsock 1 0K 0K 78643K 1 0 NFS daemon 1 16K 16K 78643K 1 0 ip_moptions 0 0K 0K 78643K 70 0 in_multi 57 3K 7K 78643K 424 0 ether_multi 1 0K 0K 78643K 16 0 mrt 1 0K 0K 78643K 1 0 ISOFS mount 1 32K 32K 78643K 1 0 MSDOSFS mount 1 16K 16K 78643K 1 0 ttys 211 943K 943K 78643K 211 0 exec 0 0K 1K 78643K 929 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 279 81K 95K 78643K 19747 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 147 0 NDP 14 0K 1K 78643K 149 0 temp 120 5770K 5960K 78643K 59971 0 kqueue 12 18K 24K 78643K 243 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 370 0 367 5 4 1 3 0 8 0 rtentry 112 400 0 338 4 0 4 4 0 8 1 unpcb 144 2332 0 2319 24 23 1 6 0 8 0 syncache 296 32 0 32 7 7 0 1 0 8 0 tcpqe 32 486 0 486 8 8 0 2 0 8 0 tcpcb 776 3885 0 3881 59 58 1 18 0 8 0 arp 88 65 0 53 1 0 1 1 0 8 0 ipq 40 4 0 4 3 3 0 1 0 8 0 ipqe 40 42 0 42 3 3 0 1 0 8 0 inpcb 336 5534 0 5526 65 64 1 18 0 8 0 ip6q 72 1 0 1 1 1 0 1 0 8 0 ip6af 40 1 0 1 1 1 0 1 0 8 0 nd6 48 94 0 82 1 0 1 1 0 8 0 kcovpl 48 33 0 25 1 0 1 1 0 8 0 mppekey 1024 3 0 3 1 1 0 1 0 8 0 ppxss 1160 37 0 37 6 6 0 1 0 8 0 pppxif 1360 17 0 17 4 4 0 1 0 8 0 pfstscr 40 9 0 3 1 0 1 1 0 8 0 pfanchor 1280 380 0 0 32 0 32 32 0 8 0 pfstitem 24 12 0 0 1 0 1 1 0 8 0 pfstkey 128 18 0 12 1 0 1 1 0 8 0 pfstate 352 9 0 3 1 0 1 1 0 8 0 art_heap8 4096 1 0 0 1 0 1 1 0 8 0 art_heap4 256 1725 0 1442 30 6 24 29 0 8 6 art_table 32 1726 0 1442 4 0 4 4 0 8 0 art_node 16 395 0 339 1 0 1 1 0 8 0 sysvmsgpl 40 44 0 4 1 0 1 1 0 8 0 semapl 112 563 0 553 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 5670 0 4234 91 0 91 91 0 8 0 ffsino 240 5670 0 4234 86 0 86 86 0 8 0 nchpl 144 9565 0 7919 63 0 63 63 0 8 1 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 34961 0 34960 7 6 1 3 0 8 0 kstatmem 264 176 0 156 2 0 2 2 0 8 0 scsiplug 72 6 0 6 2 2 0 1 0 8 0 scxspl 216 31206 0 31206 27 26 1 8 0 8 1 plimitpl 152 534 0 518 1 0 1 1 0 8 0 sigapl 424 3202 0 3136 9 1 8 8 0 8 0 futexpl 64 29956 0 29954 4 3 1 1 0 8 0 knotepl 120 31955 0 31869 18 13 5 11 0 8 2 kqueuepl 184 449 0 441 7 6 1 3 0 8 0 pipepl 288 717 0 689 11 8 3 7 0 8 1 fdescpl 432 3165 0 3136 5 1 4 4 0 8 0 filepl 120 22931 0 22695 40 32 8 16 0 8 0 lockfpl 104 331 0 329 1 0 1 1 0 8 0 lockfspl 48 121 0 119 1 0 1 1 0 8 0 sessionpl 144 50 0 34 1 0 1 1 0 8 0 pgrppl 48 71 0 55 1 0 1 1 0 8 0 ucredpl 104 2804 0 2794 1 0 1 1 0 8 0 zombiepl 144 3136 0 3136 3 2 1 1 0 8 1 processpl 1008 3202 0 3136 11 2 9 9 0 8 0 procpl 696 7128 0 7047 14 5 9 10 0 8 0 sosppl 168 32 0 32 5 5 0 1 0 8 0 sockpl 456 8236 0 8212 196 192 4 28 0 8 1 mcl64k 65536 145 0 145 6 6 0 1 0 8 0 mcl16k 16384 71 0 71 9 8 1 1 0 8 1 mcl12k 12288 107 0 107 5 5 0 1 0 8 0 mcl9k 9216 41 0 41 7 7 0 1 0 8 0 mcl8k 8192 158 0 158 9 9 0 1 0 8 0 mcl4k 4096 275 0 275 10 9 1 1 0 8 1 mcl2k2 2112 16 0 16 6 6 0 1 0 8 0 mcl2k 2048 80283 0 80213 68 58 10 32 0 8 0 mtagpl 96 291 0 291 6 2 4 5 0 8 4 mbufpl 256 168260 0 168059 549 527 22 424 0 8 5 bufpl 288 9432 0 3038 458 0 458 458 0 8 0 anonpl 24 628412 0 614487 142 25 117 121 0 188 6 amapchunkpl 152 68198 0 67559 65 27 38 43 0 158 10 amappl16 200 6220 0 5674 43 13 30 36 0 8 0 amappl15 192 50 0 49 1 0 1 1 0 8 0 amappl14 184 246 0 234 2 1 1 2 0 8 0 amappl13 176 10 0 9 1 0 1 1 0 8 0 amappl12 168 675 0 668 1 0 1 1 0 8 0 amappl11 160 46 0 34 1 0 1 1 0 8 0 amappl10 152 59 0 51 1 0 1 1 0 8 0 amappl9 144 991 0 991 7 7 0 1 0 8 0 amappl8 136 238 0 186 2 0 2 2 0 8 0 amappl7 128 203 0 177 2 0 2 2 0 8 0 amappl6 120 267 0 249 2 1 1 2 0 8 0 amappl5 112 257 0 250 1 0 1 1 0 8 0 amappl4 104 701 0 671 2 1 1 2 0 8 0 amappl3 96 8175 0 8132 2 0 2 2 0 8 0 amappl2 88 3743 0 3673 3 1 2 3 0 8 0 amappl1 80 71968 0 71295 28 12 16 26 0 8 0 amappl 88 19015 0 18857 6 1 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 3165 0 3136 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 3165 0 3136 1 0 1 1 0 8 0 vmmpekpl 168 27747 0 27698 3 0 3 3 0 8 0 vmmpepl 168 304753 0 302250 219 73 146 146 0 357 21 vmsppl 344 3164 0 3136 3 0 3 3 0 8 0 rwobjpl 24 82040 0 74368 47 0 47 47 0 8 0 pdppl 4096 6336 0 6272 387 319 68 70 0 8 4 pvpl 32 1337477 0 1318138 381 159 222 333 0 265 32 pmappl 216 3164 0 3136 2 0 2 2 0 8 0 extentpl 40 56 0 38 1 0 1 1 0 8 0 phpool 112 1798 0 1027 34 10 24 34 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(ffff800000d0c000) at tun_clone_destroy+0x234 sys/net/if_tun.c:315 if_clone_destroy(ffff8000265a2490) at if_clone_destroy+0x132 sys/net/if.c:1247 sys_ioctl(ffff8000280038c8,ffff8000265a25a0,ffff8000265a25f0) at sys_ioctl+0x49e syscall(ffff8000265a2670) at syscall+0x4a4 sys/arch/amd64/amd64/trap.c:625 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x7f7ffffd12e0, 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(ffff800000d0c000) at tun_clone_destroy+0x234 sys/net/if_tun.c:315 if_clone_destroy(ffff8000265a2490) at if_clone_destroy+0x132 sys/net/if.c:1247 sys_ioctl(ffff8000280038c8,ffff8000265a25a0,ffff8000265a25f0) at sys_ioctl+0x49e syscall(ffff8000265a2670) at syscall+0x4a4 sys/arch/amd64/amd64/trap.c:625 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x7f7ffffd12e0, count: -8