panic: kernel diagnostic assertion "sc->sc_dev == 0" failed: file "/syzkaller/managers/main/kernel/sys/net/if_tun.c", line 303 Stopped at db_enter+0x18: addq $0x8,%rsp TID PID UID PRFLAGS PFLAGS CPU COMMAND * 79881 85763 0 0 0x4000000 0 syz-executor.5 db_enter() at db_enter+0x18 sys/arch/amd64/amd64/db_interface.c:437 panic(ffffffff8272af71) at panic+0x161 sys/kern/subr_prf.c:198 __assert(ffffffff827a2e5b,ffffffff827d894e,12f,ffffffff827b8d33) at __assert+0x25 sys/kern/subr_prf.c:157 tun_clone_destroy(ffff800000db8000) at tun_clone_destroy+0x234 sys/net/if_tun.c:303 if_clone_destroy(ffff8000265aeac0) at if_clone_destroy+0x132 sys/net/if.c:1247 sys_ioctl(ffff80002ce362f0,ffff8000265aebd8,ffff8000265aec20) at sys_ioctl+0x49e syscall(ffff8000265aeca0) at syscall+0x4e6 sys/arch/amd64/amd64/trap.c:626 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0xab5c8c12370, 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 303 ddb> trace db_enter() at db_enter+0x18 sys/arch/amd64/amd64/db_interface.c:437 panic(ffffffff8272af71) at panic+0x161 sys/kern/subr_prf.c:198 __assert(ffffffff827a2e5b,ffffffff827d894e,12f,ffffffff827b8d33) at __assert+0x25 sys/kern/subr_prf.c:157 tun_clone_destroy(ffff800000db8000) at tun_clone_destroy+0x234 sys/net/if_tun.c:303 if_clone_destroy(ffff8000265aeac0) at if_clone_destroy+0x132 sys/net/if.c:1247 sys_ioctl(ffff80002ce362f0,ffff8000265aebd8,ffff8000265aec20) at sys_ioctl+0x49e syscall(ffff8000265aeca0) at syscall+0x4e6 sys/arch/amd64/amd64/trap.c:626 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0xab5c8c12370, count: -8 ddb> show registers rdi 0 rsi 0x1 rbp 0xffff8000265ae950 rbx 0x80206979 __kernel_virt_to_phys+0x206979 rdx 0xffff800000e92100 rcx 0 rax 0xffff80002ce362f0 r8 0x101010101010101 r9 0x8080808080808080 r10 0xd1aac0b5a0e0e182 r11 0xe052b496fa32ab3e r12 0 r13 0 r14 0 r15 0x1 rip 0xffffffff8143dae8 db_enter+0x18 cs 0x8 rflags 0x246 rsp 0xffff8000265ae940 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb> show proc PROC (syz-executor.5) pid=79881 stat=onproc flags process=0 proc=4000000 pri=32, usrpri=86, nice=20 forw=0xffffffffffffffff, list=0xffff80002ce36dd0,0xffff80002ce378c0 process=0xffff8000fffee400 user=0xffff8000265a9000, vmspace=0xfffffd806b9b2cd0 estcpu=36, cpticks=1, pctcpu=0.0 user=0, sys=1, intr=0 ddb> ps PID TID PPID UID S FLAGS WAIT COMMAND 24090 394067 92608 0 2 0 syz-executor.7 24090 90046 92608 0 3 0x4000080 fsleep syz-executor.7 91034 471173 54488 0 2 0 syz-executor.6 91034 497604 54488 0 3 0x4000080 fsleep syz-executor.6 33084 402360 2221 0 2 0 syz-executor.4 33084 4591 2221 0 3 0x4000080 fsleep syz-executor.4 85763 276302 75987 0 2 0 syz-executor.5 *85763 79881 75987 0 7 0x4000000 syz-executor.5 26187 13563 50277 0 2 0 syz-executor.3 26187 2640 50277 0 3 0x4000080 fsleep syz-executor.3 26187 335249 50277 0 3 0x4000080 fsleep syz-executor.3 25755 112141 32752 0 2 0 syz-executor.1 25755 39563 32752 0 3 0x4000080 bell syz-executor.1 25755 264749 32752 0 3 0x4000080 fsleep syz-executor.1 25692 143122 7538 0 2 0 syz-executor.0 25692 350402 7538 0 3 0x4000080 fsleep syz-executor.0 54449 279335 50877 0 2 0x82000 syz-executor.2 54449 355472 50877 0 3 0x4002000 suspend syz-executor.2 54449 227388 50877 0 4 0x4082000 syz-executor.2 50277 79492 73033 0 3 0x82 nanoslp syz-executor.3 92608 433871 73033 0 3 0x82 nanoslp syz-executor.7 32752 398981 73033 0 3 0x82 nanoslp syz-executor.1 50877 159222 73033 0 3 0x82 nanoslp syz-executor.2 2221 314397 73033 0 3 0x82 nanoslp syz-executor.4 13558 124582 1 0 3 0x100083 ttyin getty 75987 510391 73033 0 3 0x82 nanoslp syz-executor.5 7538 427481 73033 0 3 0x82 nanoslp syz-executor.0 15171 425543 0 0 3 0x14280 nfsidl nfsio 41520 221764 0 0 3 0x14280 nfsidl nfsio 13910 169926 0 0 3 0x14280 nfsidl nfsio 35043 125872 0 0 3 0x14280 nfsidl nfsio 5719 169547 0 0 3 0x14280 nfsidl nfsio 75138 241088 0 0 3 0x14280 nfsidl nfsio 60842 186347 0 0 3 0x14280 nfsidl nfsio 82757 1390 0 0 3 0x14280 nfsidl nfsio 26815 336548 0 0 3 0x14280 nfsidl nfsio 3365 264126 0 0 3 0x14280 nfsidl nfsio 35729 148505 0 0 3 0x14280 nfsidl nfsio 62427 314467 0 0 3 0x14280 nfsidl nfsio 79889 44042 0 0 3 0x14280 nfsidl nfsio 66375 138309 0 0 3 0x14280 nfsidl nfsio 20375 222624 0 0 3 0x14280 nfsidl nfsio 70945 240976 0 0 3 0x14280 nfsidl nfsio 75553 390141 0 0 3 0x14280 nfsidl nfsio 54616 97473 0 0 3 0x14280 nfsidl nfsio 10078 53222 0 0 3 0x14280 nfsidl nfsio 44721 517479 0 0 3 0x14280 nfsidl nfsio 54488 515295 73033 0 3 0x82 nanoslp syz-executor.6 99718 299620 0 0 3 0x14200 bored sosplice 73033 505670 30352 0 3 0x82 wait syz-fuzzer 73033 289243 30352 0 3 0x4000082 thrsleep syz-fuzzer 73033 381214 30352 0 3 0x4000082 thrsleep syz-fuzzer 73033 17885 30352 0 3 0x4000082 wait syz-fuzzer 73033 21267 30352 0 3 0x4000082 thrsleep syz-fuzzer 73033 318043 30352 0 3 0x4000082 kqread syz-fuzzer 73033 363933 30352 0 3 0x4000082 thrsleep syz-fuzzer 73033 189762 30352 0 3 0x4000082 wait syz-fuzzer 73033 196434 30352 0 3 0x4000082 thrsleep syz-fuzzer 73033 219609 30352 0 3 0x4000082 wait syz-fuzzer 73033 10094 30352 0 3 0x4000082 wait syz-fuzzer 73033 469268 30352 0 3 0x4000082 wait syz-fuzzer 73033 510121 30352 0 3 0x4000082 wait syz-fuzzer 73033 112763 30352 0 3 0x4000082 wait syz-fuzzer 73033 113753 30352 0 3 0x4000082 thrsleep syz-fuzzer 30352 317551 45434 0 3 0x10008a sigsusp ksh 45434 150145 43830 0 3 0x9a kqread sshd 43830 95620 1 0 3 0x88 kqread sshd 60578 440831 39758 73 3 0x1100090 kqread syslogd 39758 310246 1 0 3 0x100082 netio syslogd 92876 416283 1 0 3 0x100080 kqread resolvd 65706 96428 95421 77 3 0x100092 kqread dhcpleased 2040 326575 95421 77 3 0x100092 kqread dhcpleased 95421 352343 1 0 3 0x80 kqread dhcpleased 89994 148002 0 0 3 0x14200 bored smr 910 7975 0 0 2 0x14200 zerothread 78441 262199 0 0 3 0x14200 aiodoned aiodoned 53775 390803 0 0 3 0x14200 syncer update 92877 521820 0 0 3 0x14200 cleaner cleaner 84195 452261 0 0 3 0x14200 reaper reaper 9900 100644 0 0 3 0x14200 pgdaemon pagedaemon 57734 308792 0 0 3 0x14200 bored viomb 42727 447382 0 0 3 0x40014200 acpi0 acpi0 40504 94035 0 0 3 0x14200 bored softnet 41989 203624 0 0 3 0x14200 bored softnet 81932 458268 0 0 3 0x14200 bored softnet 43977 149800 0 0 3 0x14200 bored softnet 63279 13634 0 0 3 0x14200 bored systqmp 25660 325934 0 0 3 0x14200 bored systq 57411 280098 0 0 3 0x40014200 bored softclock 92581 82078 0 0 3 0x40014200 idle0 1 56138 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 10231 6489K 7776K 78643K 71681 0 pcb 13 18K 21K 78643K 8142 0 rtable 181 15K 16K 78643K 2880 0 ifaddr 87 27K 28K 78643K 1788 0 sysctl 3 1K 2K 78643K 12 0 counters 27 17K 17K 78643K 1117 0 ioctlops 0 0K 4K 78643K 5559 0 iov 0 0K 32K 78643K 1389 0 mount 1 1K 1K 78643K 1 0 log 0 0K 0K 78643K 4 0 vnodes 1589 99K 100K 78643K 20215 0 UFS quota 1 32K 32K 78643K 1 0 UFS mount 5 36K 36K 78643K 5 0 shm 2 1K 5K 78643K 99 0 VM map 2 0K 0K 78643K 2 0 sem 19 5K 7K 78643K 193 0 dirhash 12 2K 2K 78643K 12 0 ACPI 1697 195K 286K 78643K 12548 0 file desc 18 65K 73K 78643K 15121 0 sigio 0 0K 0K 78643K 641 0 proc 63 59K 75K 78643K 1918 0 subproc 104 6K 6K 78643K 637 0 NFS srvsock 1 0K 0K 78643K 1 0 NFS daemon 1 16K 16K 78643K 1 0 ip_moptions 0 0K 0K 78643K 397 0 in_multi 67 4K 7K 78643K 959 0 ether_multi 1 0K 0K 78643K 66 0 mrt 1 0K 0K 78643K 45 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 1K 78643K 2108 0 pfkey data 0 0K 0K 78643K 4 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 360 94K 109K 78643K 96003 0 UVM aobj 131 4K 4K 78643K 137 0 memdesc 1 4K 4K 78643K 1 0 crypto data 1 1K 1K 78643K 1 0 ip6_options 0 0K 0K 78643K 349 0 NDP 12 0K 1K 78643K 474 0 temp 129 5770K 39562K 78643K 198456 0 kqueue 12 18K 28K 78643K 895 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 722 0 719 9 8 1 3 0 8 0 rtentry 112 957 0 884 5 2 3 4 0 8 0 unpcb 144 20965 0 20947 112 110 2 6 0 8 1 syncache 296 54 0 54 11 11 0 1 0 8 0 sackhl 24 1 0 1 1 1 0 1 0 8 0 tcpqe 32 104 0 104 6 6 0 1 0 8 0 tcpcb 776 12688 0 12680 139 131 8 11 0 8 7 arp 88 108 0 94 1 0 1 1 0 8 0 ipq 40 1 0 1 1 1 0 1 0 8 0 ipqe 40 68 0 68 1 1 0 1 0 8 0 inpcb 336 29312 0 29301 223 214 9 15 0 8 8 nd6 48 159 0 141 1 0 1 1 0 8 0 pkpcb 40 11 0 11 3 3 0 1 0 8 0 kcovpl 48 49 0 41 1 0 1 1 0 8 0 mppekey 1024 12 0 12 3 3 0 1 0 8 0 ppxss 1160 815 0 815 21 21 0 1 0 8 0 pppxif 1360 619 0 619 16 16 0 1 0 8 0 pfstscr 40 173 0 168 2 1 1 1 0 8 0 pfosfp 40 3 0 2 1 0 1 1 0 8 0 pfosfpen 112 3 0 2 1 0 1 1 0 8 0 pfanchor 1280 615 1 169 43 3 40 43 0 8 0 pfqueue 264 10 0 10 3 3 0 1 0 8 0 pfstitem 24 32 0 22 1 0 1 1 0 8 0 pfstkey 128 330 0 320 2 1 1 1 0 8 0 pfstate 352 169 0 164 2 1 1 1 0 8 0 rttmr 136 2 0 2 1 1 0 1 0 8 0 art_heap8 4096 6 0 5 5 4 1 2 0 8 0 art_heap4 256 4743 0 4443 52 33 19 30 0 8 0 art_table 32 4749 0 4448 4 1 3 4 0 8 0 art_node 16 955 0 892 1 0 1 1 0 8 0 sysvmsgpl 40 2 0 0 1 0 1 1 0 8 0 semupl 112 2 0 2 1 1 0 1 0 8 0 semapl 112 174 0 157 1 0 1 1 0 8 0 shmpl 112 134 0 6 4 0 4 4 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino2pl 256 21002 0 19532 93 0 93 93 0 8 0 ffsino 240 21002 0 19532 87 0 87 87 0 8 0 nchpl 144 40149 0 39619 63 41 22 63 0 8 0 rtmask 32 9 0 9 3 3 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 160337 0 160337 10 9 1 2 0 8 1 vmpool 664 19 0 19 5 5 0 1 0 8 0 kstatmem 264 730 0 706 2 0 2 2 0 8 0 scsiplug 72 6 0 6 2 2 0 1 0 8 0 scxspl 216 119888 0 119888 24 23 1 8 0 8 1 plimitpl 152 1595 0 1580 1 0 1 1 0 8 0 sigapl 424 15346 0 15280 8 0 8 8 0 8 0 futexpl 64 180627 0 180620 5 4 1 1 0 8 0 knotepl 120 206281 0 206201 71 65 6 11 0 8 2 kqueuepl 184 1831 0 1823 16 15 1 4 0 8 0 pipepl 288 3767 0 3739 55 52 3 7 0 8 0 fdescpl 432 15304 0 15275 5 1 4 4 0 8 0 filepl 120 139511 0 139264 153 141 12 17 0 8 4 lockfpl 104 3693 0 3691 12 11 1 2 0 8 0 lockfspl 48 1212 0 1210 1 0 1 1 0 8 0 sessionpl 144 65 0 49 1 0 1 1 0 8 0 pgrppl 48 280 0 264 1 0 1 1 0 8 0 ucredpl 104 11731 0 11720 1 0 1 1 0 8 0 zombiepl 144 15280 0 15280 3 2 1 1 0 8 1 processpl 1008 15346 0 15280 10 1 9 9 0 8 0 procpl 696 37312 0 37221 23 14 9 10 0 8 0 sosppl 168 81 0 81 19 19 0 1 0 8 0 sockpl 456 51070 0 51038 865 852 13 33 0 8 9 mcl64k 65536 428 0 428 28 27 1 1 0 8 1 mcl16k 16384 198 0 198 34 34 0 1 0 8 0 mcl12k 12288 461 0 461 26 25 1 1 0 8 1 mcl9k 9216 102 0 102 26 26 0 1 0 8 0 mcl8k 8192 799 0 799 26 25 1 1 0 8 1 mcl4k 4096 1469 0 1469 14 13 1 1 0 8 1 mcl2k2 2112 119 0 119 38 38 0 1 0 8 0 mcl2k 2048 107862 0 107763 66 52 14 30 0 8 0 mtagpl 96 12201 0 10806 85 50 35 41 0 8 0 mbufpl 256 290630 0 289020 901 798 103 470 0 8 0 bufpl 288 25193 0 18796 458 0 458 458 0 8 0 anonpl 24 2762893 0 2743475 211 89 122 133 0 188 0 amapchunkpl 152 269579 0 268784 105 74 31 45 0 158 0 amappl16 200 23497 0 22838 117 82 35 45 0 8 0 amappl15 192 64 0 62 1 0 1 1 0 8 0 amappl14 184 318 0 303 2 0 2 2 0 8 0 amappl13 176 10 0 10 1 1 0 1 0 8 0 amappl12 168 885 0 878 1 0 1 1 0 8 0 amappl11 160 52 0 41 1 0 1 1 0 8 0 amappl10 152 68 0 58 1 0 1 1 0 8 0 amappl9 144 998 0 997 2 1 1 1 0 8 0 amappl8 136 446 0 357 4 0 4 4 0 8 0 amappl7 128 251 0 225 2 0 2 2 0 8 0 amappl6 120 382 0 368 1 0 1 1 0 8 0 amappl5 112 391 0 385 1 0 1 1 0 8 0 amappl4 104 971 0 946 2 1 1 2 0 8 0 amappl3 96 42883 0 42824 2 0 2 2 0 8 0 amappl2 88 16130 0 16055 3 1 2 3 0 8 0 amappl1 80 336896 0 336122 24 8 16 22 0 8 0 amappl 88 94932 0 94725 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 136 0 6 3 0 3 3 0 8 0 uaddrrnd 24 15323 0 15294 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 15323 0 15294 1 0 1 1 0 8 0 vmmpekpl 168 108448 0 108393 4 0 4 4 0 8 0 vmmpepl 168 1369546 0 1366508 402 267 135 158 0 357 0 vmsppl 272 15322 0 15294 4 2 2 3 0 8 0 rwobjpl 24 342898 0 334991 52 3 49 49 0 8 0 pdppl 4096 30652 0 30588 664 600 64 68 0 8 0 pvpl 32 5391339 0 5366120 468 260 208 255 0 265 0 pmappl 216 15322 0 15294 2 0 2 2 0 8 0 extentpl 40 56 0 38 1 0 1 1 0 8 0 phpool 112 2745 0 1884 36 10 26 36 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(ffffffff8272af71) at panic+0x161 sys/kern/subr_prf.c:198 __assert(ffffffff827a2e5b,ffffffff827d894e,12f,ffffffff827b8d33) at __assert+0x25 sys/kern/subr_prf.c:157 tun_clone_destroy(ffff800000db8000) at tun_clone_destroy+0x234 sys/net/if_tun.c:303 if_clone_destroy(ffff8000265aeac0) at if_clone_destroy+0x132 sys/net/if.c:1247 sys_ioctl(ffff80002ce362f0,ffff8000265aebd8,ffff8000265aec20) at sys_ioctl+0x49e syscall(ffff8000265aeca0) at syscall+0x4e6 sys/arch/amd64/amd64/trap.c:626 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0xab5c8c12370, 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(ffffffff8272af71) at panic+0x161 sys/kern/subr_prf.c:198 __assert(ffffffff827a2e5b,ffffffff827d894e,12f,ffffffff827b8d33) at __assert+0x25 sys/kern/subr_prf.c:157 tun_clone_destroy(ffff800000db8000) at tun_clone_destroy+0x234 sys/net/if_tun.c:303 if_clone_destroy(ffff8000265aeac0) at if_clone_destroy+0x132 sys/net/if.c:1247 sys_ioctl(ffff80002ce362f0,ffff8000265aebd8,ffff8000265aec20) at sys_ioctl+0x49e syscall(ffff8000265aeca0) at syscall+0x4e6 sys/arch/amd64/amd64/trap.c:626 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0xab5c8c12370, count: -8