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 *452826 33670 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(ffff800000d60800) at tun_clone_destroy+0x234 sys/net/if_tun.c:315 if_clone_destroy(ffff8000216f7110) at if_clone_destroy+0x132 sys/net/if.c:1247 sys_ioctl(ffff8000217058c0,ffff8000216f7220,ffff8000216f7270) at sys_ioctl+0x49e syscall(ffff8000216f72f0) at syscall+0x4a4 sys/arch/amd64/amd64/trap.c:625 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x7f7ffffc27a0, 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(ffff800000d60800) at tun_clone_destroy+0x234 sys/net/if_tun.c:315 if_clone_destroy(ffff8000216f7110) at if_clone_destroy+0x132 sys/net/if.c:1247 sys_ioctl(ffff8000217058c0,ffff8000216f7220,ffff8000216f7270) at sys_ioctl+0x49e syscall(ffff8000216f72f0) at syscall+0x4a4 sys/arch/amd64/amd64/trap.c:625 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x7f7ffffc27a0, count: -8 ddb> show registers rdi 0 rsi 0x1 rbp 0xffff8000216f6fa0 rbx 0x80206979 __kernel_virt_to_phys+0x206979 rdx 0 rcx 0 rax 0xffff8000217058c0 r8 0 r9 0x8080808080808080 r10 0xf0b38a492cc5604d r11 0x51a1cbc8088d45ca r12 0 r13 0 r14 0 r15 0x1 rip 0xffffffff81a69eb8 db_enter+0x18 cs 0x8 rflags 0x246 rsp 0xffff8000216f6f90 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb> show proc PROC (ifconfig) pid=452826 stat=onproc flags process=2 proc=0 pri=79, usrpri=79, nice=20 forw=0xffffffffffffffff, list=0xffff800021705608,0xffffffff82cf3498 process=0xffff8000217157a0 user=0xffff8000216f2000, vmspace=0xfffffd8069ba0978 estcpu=29, cpticks=1, pctcpu=0.0 user=0, sys=1, intr=0 ddb> ps PID TID PPID UID S FLAGS WAIT COMMAND *33670 452826 26124 0 7 0x2 ifconfig 26124 233169 97479 0 3 0x10008a sigsusp sh 97479 336325 83813 0 3 0x82 wait syz-executor.0 48039 379783 83813 0 3 0x82 piperd syz-executor.4 29822 287130 1 0 3 0x100083 ttyin getty 84666 16994 83813 0 3 0x82 piperd syz-executor.3 52109 94869 83813 0 3 0x82 piperd syz-executor.5 10128 221489 83813 0 3 0x82 piperd syz-executor.2 20116 457565 0 0 3 0x14200 acct acct 21903 127578 83813 0 3 0x82 piperd syz-executor.1 29250 497375 0 0 3 0x14280 nfsidl nfsio 81391 452273 0 0 3 0x14280 nfsidl nfsio 51156 18081 0 0 3 0x14280 nfsidl nfsio 30229 112956 0 0 3 0x14280 nfsidl nfsio 65884 436690 0 0 3 0x14280 nfsidl nfsio 14794 330830 0 0 3 0x14280 nfsidl nfsio 41014 119054 0 0 3 0x14280 nfsidl nfsio 11148 403329 0 0 3 0x14280 nfsidl nfsio 53993 338773 0 0 3 0x14280 nfsidl nfsio 70432 56469 0 0 3 0x14280 nfsidl nfsio 13803 8109 0 0 3 0x14280 nfsidl nfsio 68754 470949 0 0 3 0x14280 nfsidl nfsio 84528 114353 0 0 3 0x14280 nfsidl nfsio 60462 348186 0 0 3 0x14280 nfsidl nfsio 14787 125157 0 0 3 0x14280 nfsidl nfsio 28258 139383 0 0 3 0x14280 nfsidl nfsio 19772 416945 0 0 3 0x14280 nfsidl nfsio 2205 407575 0 0 3 0x14280 nfsidl nfsio 56456 371572 0 0 3 0x14280 nfsidl nfsio 91431 224266 0 0 3 0x14280 nfsidl nfsio 69203 174100 0 0 3 0x14200 bored sosplice 72274 9225 83813 0 3 0x82 piperd syz-executor.6 67283 467646 83813 0 3 0x82 piperd syz-executor.7 83813 241990 33098 0 3 0x82 thrsleep syz-fuzzer 83813 437610 33098 0 3 0x4000082 nanoslp syz-fuzzer 83813 209458 33098 0 3 0x4000082 wait syz-fuzzer 83813 89474 33098 0 3 0x4000082 thrsleep syz-fuzzer 83813 427368 33098 0 3 0x4000082 wait syz-fuzzer 83813 167337 33098 0 3 0x4000082 thrsleep syz-fuzzer 83813 125250 33098 0 3 0x4000082 wait syz-fuzzer 83813 233432 33098 0 3 0x4000082 wait syz-fuzzer 83813 524041 33098 0 3 0x4000082 wait syz-fuzzer 83813 438315 33098 0 3 0x4000082 thrsleep syz-fuzzer 83813 49694 33098 0 3 0x4000082 wait syz-fuzzer 83813 389164 33098 0 3 0x4000082 wait syz-fuzzer 83813 453217 33098 0 3 0x4000082 wait syz-fuzzer 83813 259062 33098 0 3 0x4000082 thrsleep syz-fuzzer 33098 196427 16356 0 3 0x10008a sigsusp ksh 16356 335781 58729 0 3 0x9a kqread sshd 58729 315394 1 0 3 0x88 kqread sshd 26423 370290 81642 73 3 0x1100090 kqread syslogd 81642 326607 1 0 3 0x100082 netio syslogd 62303 96096 1 0 3 0x100080 kqread resolvd 31438 455204 79702 77 2 0x100092 dhcpleased 66978 418584 79702 77 3 0x100092 kqread dhcpleased 79702 298308 1 0 3 0x80 kqread dhcpleased 98196 366064 0 0 3 0x14200 bored smr 97359 488704 0 0 2 0x14200 zerothread 29411 140710 0 0 3 0x14200 aiodoned aiodoned 63367 108442 0 0 3 0x14200 syncer update 26436 349956 0 0 3 0x14200 cleaner cleaner 32613 117357 0 0 3 0x14200 reaper reaper 5497 192746 0 0 3 0x14200 pgdaemon pagedaemon 92836 462267 0 0 3 0x14200 bored viomb 71432 431101 0 0 3 0x40014200 acpi0 acpi0 39158 485652 0 0 3 0x14200 bored softnet 65030 29775 0 0 3 0x14200 bored softnet 21793 360224 0 0 3 0x14200 bored softnet 63423 138640 0 0 3 0x14200 bored softnet 29602 72645 0 0 3 0x14200 bored systqmp 65018 74457 0 0 3 0x14200 bored systq 71285 496686 0 0 2 0x40014200 softclock 47787 310416 0 0 3 0x40014200 idle0 1 110276 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 10205 6417K 6968K 78643K 14342 0 pcb 13 13K 17K 78643K 403 0 rtable 181 15K 16K 78643K 844 0 ifaddr 71 21K 21K 78643K 321 0 sysctl 2 0K 0K 78643K 2 0 counters 27 17K 17K 78643K 100 0 ioctlops 0 0K 2K 78643K 390 0 iov 0 0K 24K 78643K 366 0 mount 1 1K 1K 78643K 1 0 log 0 0K 0K 78643K 4 0 vnodes 1400 88K 88K 78643K 3295 0 UFS quota 1 32K 32K 78643K 1 0 UFS mount 5 36K 36K 78643K 5 0 shm 2 1K 9K 78643K 31 0 VM map 2 1K 1K 78643K 2 0 sem 12 0K 0K 78643K 465 0 dirhash 12 2K 2K 78643K 12 0 ACPI 1697 195K 286K 78643K 12548 0 file desc 12 41K 69K 78643K 2122 0 sigio 0 0K 0K 78643K 73 0 proc 65 67K 75K 78643K 831 0 subproc 104 6K 6K 78643K 254 0 NFS srvsock 1 0K 0K 78643K 1 0 NFS daemon 1 16K 16K 78643K 1 0 ip_moptions 0 0K 0K 78643K 319 0 in_multi 66 4K 6K 78643K 317 0 ether_multi 1 0K 0K 78643K 12 0 mrt 1 0K 0K 78643K 9 0 ISOFS mount 1 32K 32K 78643K 1 0 MSDOSFS mount 1 16K 16K 78643K 1 0 ttys 163 731K 731K 78643K 163 0 exec 0 0K 1K 78643K 852 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 259 86K 88K 78643K 14742 0 UVM aobj 100 3K 3K 78643K 103 0 memdesc 1 4K 4K 78643K 1 0 crypto data 1 1K 1K 78643K 1 0 ip6_options 0 0K 0K 78643K 59 0 NDP 11 0K 1K 78643K 106 0 temp 124 5770K 6797K 78643K 30053 0 kqueue 12 18K 26K 78643K 222 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 164 0 161 2 1 1 2 0 8 0 rtentry 112 269 0 194 5 2 3 4 0 8 0 unpcb 144 5233 0 5220 21 13 8 8 0 8 7 syncache 296 18 0 18 5 5 0 1 0 8 0 tcpqe 32 783 0 783 6 6 0 1 0 8 0 tcpcb 776 1024 0 1015 30 22 8 8 0 8 5 arp 88 42 0 30 1 0 1 1 0 8 0 ipq 40 4 0 3 1 0 1 1 0 8 0 ipqe 40 10 0 9 1 0 1 1 0 8 0 inpcb 336 2508 0 2495 31 24 7 16 0 8 4 nd6 48 60 0 46 1 0 1 1 0 8 0 pkpcb 40 3 0 3 1 0 1 1 0 8 1 kcovpl 48 19 0 11 1 0 1 1 0 8 0 mppekey 1024 3 0 3 1 1 0 1 0 8 0 ppxss 1160 38 0 38 4 4 0 1 0 8 0 pppxif 1360 14 0 14 4 4 0 1 0 8 0 pfstscr 40 8 0 5 1 0 1 1 0 8 0 pfqueue 264 3 0 3 1 1 0 1 0 8 0 pfstitem 24 6 0 0 1 0 1 1 0 8 0 pfstkey 128 16 0 14 1 0 1 1 0 8 0 pfstate 352 8 0 5 1 0 1 1 0 8 0 art_heap8 4096 1 0 0 1 0 1 1 0 8 0 art_heap4 256 1193 0 880 35 14 21 29 0 8 0 art_table 32 1194 0 880 4 1 3 4 0 8 0 art_node 16 266 0 197 1 0 1 1 0 8 0 sysvmsgpl 40 15 0 7 1 0 1 1 0 8 0 semapl 112 463 0 453 1 0 1 1 0 8 0 shmpl 112 100 0 3 3 0 3 3 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino2pl 256 4581 0 3154 90 0 90 90 0 8 0 ffsino 240 4581 0 3154 85 0 85 85 0 8 0 nchpl 144 7481 0 5849 63 0 63 63 0 8 0 rtmask 32 2 0 2 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 28507 0 28507 3 2 1 2 0 8 1 vmpool 664 4 0 4 1 1 0 1 0 8 0 kstatmem 264 130 0 108 2 0 2 2 0 8 0 scxspl 216 20978 0 20978 13 11 2 8 0 8 2 plimitpl 152 380 0 365 1 0 1 1 0 8 0 sigapl 424 2421 0 2360 8 0 8 8 0 8 0 futexpl 64 22593 0 22593 1 0 1 1 0 8 1 knotepl 120 38160 0 38078 13 9 4 7 0 8 0 kqueuepl 184 490 0 482 7 6 1 4 0 8 0 pipepl 288 708 0 680 19 12 7 7 0 8 4 fdescpl 432 2383 0 2360 4 0 4 4 0 8 0 filepl 120 21590 0 21357 36 20 16 17 0 8 8 lockfpl 104 616 0 614 2 0 2 2 0 8 1 lockfspl 48 175 0 173 1 0 1 1 0 8 0 sessionpl 144 36 0 20 1 0 1 1 0 8 0 pgrppl 48 219 0 203 1 0 1 1 0 8 0 ucredpl 104 3254 0 3244 1 0 1 1 0 8 0 zombiepl 144 2360 0 2360 1 0 1 1 0 8 1 processpl 1008 2421 0 2360 10 1 9 9 0 8 0 procpl 696 5301 0 5227 10 1 9 9 0 8 0 sosppl 168 17 0 17 3 2 1 1 0 8 1 sockpl 456 7919 0 7890 177 163 14 35 0 8 8 mcl64k 65536 85 0 85 5 4 1 1 0 8 1 mcl16k 16384 68 0 68 5 4 1 1 0 8 1 mcl12k 12288 84 0 84 3 2 1 1 0 8 1 mcl9k 9216 27 0 27 6 5 1 1 0 8 1 mcl8k 8192 209 0 209 2 1 1 1 0 8 1 mcl4k 4096 224 0 224 2 1 1 1 0 8 1 mcl2k2 2112 10 0 10 4 3 1 1 0 8 1 mcl2k 2048 77313 0 77212 40 25 15 26 0 8 1 mtagpl 96 270 0 50 7 1 6 6 0 8 0 mbufpl 256 142614 0 142155 87 54 33 64 0 8 1 bufpl 288 7360 0 963 458 0 458 458 0 8 0 anonpl 24 416643 0 401841 113 6 107 110 0 188 0 amapchunkpl 152 39065 0 38476 37 8 29 29 0 158 1 amappl16 200 2907 0 2333 35 3 32 32 0 8 1 amappl15 192 29 0 28 1 0 1 1 0 8 0 amappl14 184 190 0 176 2 0 2 2 0 8 0 amappl13 176 1 0 0 1 0 1 1 0 8 0 amappl12 168 524 0 520 1 0 1 1 0 8 0 amappl11 160 40 0 30 1 0 1 1 0 8 0 amappl10 152 38 0 29 1 0 1 1 0 8 0 amappl9 144 976 0 976 5 4 1 1 0 8 1 amappl8 136 187 0 127 3 0 3 3 0 8 0 amappl7 128 158 0 134 2 0 2 2 0 8 0 amappl6 120 197 0 182 2 1 1 2 0 8 0 amappl5 112 186 0 178 1 0 1 1 0 8 0 amappl4 104 620 0 593 2 1 1 2 0 8 0 amappl3 96 6209 0 6171 2 0 2 2 0 8 0 amappl2 88 2887 0 2820 3 1 2 3 0 8 0 amappl1 80 56102 0 55488 27 11 16 26 0 8 0 amappl 88 14107 0 13965 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 102 0 3 2 0 2 2 0 8 0 uaddrrnd 24 2387 0 2364 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 2387 0 2364 1 0 1 1 0 8 0 vmmpekpl 168 23640 0 23581 4 0 4 4 0 8 0 vmmpepl 168 225551 0 223285 172 38 134 140 0 357 10 vmsppl 344 2386 0 2364 3 0 3 3 0 8 0 rwobjpl 24 63161 0 55541 47 0 47 47 0 8 0 pdppl 4096 4780 0 4728 210 148 62 66 0 8 10 pvpl 32 957657 0 938042 360 132 228 360 0 265 43 pmappl 216 2386 0 2364 2 0 2 2 0 8 0 extentpl 40 56 0 38 1 0 1 1 0 8 0 phpool 112 1084 0 296 23 0 23 23 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(ffff800000d60800) at tun_clone_destroy+0x234 sys/net/if_tun.c:315 if_clone_destroy(ffff8000216f7110) at if_clone_destroy+0x132 sys/net/if.c:1247 sys_ioctl(ffff8000217058c0,ffff8000216f7220,ffff8000216f7270) at sys_ioctl+0x49e syscall(ffff8000216f72f0) at syscall+0x4a4 sys/arch/amd64/amd64/trap.c:625 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x7f7ffffc27a0, 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(ffff800000d60800) at tun_clone_destroy+0x234 sys/net/if_tun.c:315 if_clone_destroy(ffff8000216f7110) at if_clone_destroy+0x132 sys/net/if.c:1247 sys_ioctl(ffff8000217058c0,ffff8000216f7220,ffff8000216f7270) at sys_ioctl+0x49e syscall(ffff8000216f72f0) at syscall+0x4a4 sys/arch/amd64/amd64/trap.c:625 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x7f7ffffc27a0, count: -8