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 *250647 18389 0 0 0x4000000 0 syz-executor.0 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(ffff800000e08800) at tun_clone_destroy+0x234 sys/net/if_tun.c:315 if_clone_destroy(ffff8000217139c0) at if_clone_destroy+0x132 sys/net/if.c:1247 sys_ioctl(ffff800021725b60,ffff800021713ad8,ffff800021713b20) at sys_ioctl+0x49e syscall(ffff800021713ba0) at syscall+0x4a4 sys/arch/amd64/amd64/trap.c:625 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0xdccd9e520d0, 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(ffff800000e08800) at tun_clone_destroy+0x234 sys/net/if_tun.c:315 if_clone_destroy(ffff8000217139c0) at if_clone_destroy+0x132 sys/net/if.c:1247 sys_ioctl(ffff800021725b60,ffff800021713ad8,ffff800021713b20) at sys_ioctl+0x49e syscall(ffff800021713ba0) at syscall+0x4a4 sys/arch/amd64/amd64/trap.c:625 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0xdccd9e520d0, count: -8 ddb> show registers rdi 0 rsi 0x1 rbp 0xffff800021713850 rbx 0x80206979 __kernel_virt_to_phys+0x206979 rdx 0xffff800000ccc280 rcx 0 rax 0xffff800021725b60 r8 0 r9 0x8080808080808080 r10 0xd17be11fb56b44e6 r11 0x308e70caf9fb87e8 r12 0 r13 0 r14 0 r15 0x1 rip 0xffffffff81a69eb8 db_enter+0x18 cs 0x8 rflags 0x246 rsp 0xffff800021713840 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb> show proc PROC (syz-executor.0) pid=250647 stat=onproc flags process=0 proc=4000000 pri=32, usrpri=81, nice=20 forw=0xffffffffffffffff, list=0xffff8000217245a0,0xffffffff82cf3498 process=0xffff80002e8cb7b0 user=0xffff80002170e000, vmspace=0xfffffd80754a5c20 estcpu=36, cpticks=1, pctcpu=0.0 user=0, sys=1, intr=0 ddb> ps PID TID PPID UID S FLAGS WAIT COMMAND 18389 367591 81990 0 2 0 syz-executor.0 *18389 250647 81990 0 7 0x4000000 syz-executor.0 77892 76612 94924 0 3 0x80 nanoslp syz-executor.5 77892 240777 94924 0 3 0x4000000 smrbar syz-executor.5 77892 390840 94924 0 3 0x4000080 fsleep syz-executor.5 11788 495676 0 0 3 0x14200 acct acct 72728 158790 17181 0 3 0x82 piperd syz-executor.2 98705 523636 17181 0 2 0x482 syz-executor.4 58778 223763 0 0 3 0x14280 nfsidl nfsio 61810 194883 0 0 3 0x14280 nfsidl nfsio 31076 487724 0 0 3 0x14280 nfsidl nfsio 69299 515113 0 0 3 0x14280 nfsidl nfsio 24517 461014 0 0 3 0x14280 nfsidl nfsio 35648 246666 0 0 3 0x14280 nfsidl nfsio 29682 191353 0 0 3 0x14280 nfsidl nfsio 77601 291347 0 0 3 0x14280 nfsidl nfsio 2819 388987 0 0 3 0x14280 nfsidl nfsio 37282 64114 0 0 3 0x14280 nfsidl nfsio 36679 470117 0 0 3 0x14280 nfsidl nfsio 16759 430564 0 0 3 0x14280 nfsidl nfsio 78575 479261 0 0 3 0x14280 nfsidl nfsio 63259 112730 0 0 3 0x14280 nfsidl nfsio 25422 234999 0 0 3 0x14280 nfsidl nfsio 43593 94058 0 0 3 0x14280 nfsidl nfsio 37838 299533 0 0 3 0x14280 nfsidl nfsio 77448 470519 0 0 3 0x14280 nfsidl nfsio 47482 384673 0 0 3 0x14280 nfsidl nfsio 59168 54714 0 0 3 0x14280 nfsidl nfsio 51366 279217 0 0 3 0x14200 bored sosplice 30532 227573 17181 0 3 0x82 piperd syz-executor.1 94924 121686 17181 0 2 0x482 syz-executor.5 72326 195604 17181 0 3 0x82 piperd syz-executor.3 31505 173044 17181 0 3 0x82 piperd syz-executor.6 81990 270425 17181 0 3 0x82 nanoslp syz-executor.0 17181 216081 7148 0 3 0x82 thrsleep syz-fuzzer 17181 140686 7148 0 3 0x4000082 nanoslp syz-fuzzer 17181 191056 7148 0 3 0x4000082 wait syz-fuzzer 17181 243023 7148 0 3 0x4000082 wait syz-fuzzer 17181 397512 7148 0 3 0x4000082 thrsleep syz-fuzzer 17181 144147 7148 0 3 0x4000082 thrsleep syz-fuzzer 17181 150257 7148 0 3 0x4000082 wait syz-fuzzer 17181 184064 7148 0 3 0x4000082 thrsleep syz-fuzzer 17181 437054 7148 0 3 0x4000082 wait syz-fuzzer 17181 277792 7148 0 2 0x4000002 syz-fuzzer 17181 481037 7148 0 3 0x4000082 thrsleep syz-fuzzer 17181 165017 7148 0 3 0x4000082 wait syz-fuzzer 17181 477981 7148 0 3 0x4000082 wait syz-fuzzer 17181 282479 7148 0 3 0x4000082 wait syz-fuzzer 7148 496696 8182 0 3 0x10008a sigsusp ksh 8182 487171 64363 0 3 0x9a kqread sshd 82048 125002 1 0 3 0x100083 ttyopn getty 64363 423528 1 0 3 0x88 kqread sshd 26778 215382 99397 73 3 0x1100090 kqread syslogd 99397 229811 1 0 3 0x100082 netio syslogd 45944 22483 1 0 3 0x100080 kqread resolvd 42640 278129 60884 77 2 0x100092 dhcpleased 20425 429971 60884 77 3 0x100092 kqread dhcpleased 60884 65104 1 0 3 0x80 kqread dhcpleased 4058 433671 0 0 3 0x14200 bored smr 1023 288322 0 0 2 0x14200 zerothread 46874 440751 0 0 3 0x14200 aiodoned aiodoned 79732 214464 0 0 3 0x14200 syncer update 21179 429851 0 0 3 0x14200 cleaner cleaner 2745 400839 0 0 3 0x14200 reaper reaper 42211 397169 0 0 3 0x14200 pgdaemon pagedaemon 33781 396257 0 0 3 0x14200 bored viomb 4020 5128 0 0 3 0x40014200 acpi0 acpi0 75723 99809 0 0 3 0x14200 bored softnet 72152 501656 0 0 3 0x14200 bored softnet 4635 121983 0 0 3 0x14200 bored softnet 90087 231434 0 0 3 0x14200 bored softnet 55632 478606 0 0 3 0x14200 bored systqmp 67856 330528 0 0 3 0x14200 bored systq 24371 209470 0 0 3 0x40014200 bored softclock 47859 243395 0 0 3 0x40014200 idle0 1 115794 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 10223 6427K 6742K 78643K 13553 0 pcb 14 16K 21K 78643K 3349 0 rtable 166 14K 16K 78643K 1776 0 ifaddr 72 20K 21K 78643K 329 0 sysctl 2 0K 0K 78643K 2 0 counters 27 17K 17K 78643K 128 0 ioctlops 0 0K 4K 78643K 254 0 iov 0 0K 26K 78643K 662 0 mount 1 1K 1K 78643K 1 0 log 0 0K 0K 78643K 4 0 vnodes 1401 88K 88K 78643K 2933 0 UFS quota 1 32K 32K 78643K 1 0 UFS mount 5 36K 36K 78643K 5 0 shm 2 1K 5K 78643K 37 0 VM map 2 1K 1K 78643K 2 0 sem 12 0K 0K 78643K 391 0 dirhash 12 2K 2K 78643K 12 0 ACPI 1697 195K 286K 78643K 12548 0 file desc 11 37K 73K 78643K 3102 0 sigio 0 0K 0K 78643K 96 0 proc 58 59K 83K 78643K 925 0 subproc 91 5K 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 169 0 in_multi 62 4K 6K 78643K 366 0 ether_multi 1 0K 0K 78643K 27 0 mrt 1 0K 0K 78643K 18 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 854 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 275 76K 98K 78643K 21293 0 UVM aobj 131 4K 4K 78643K 140 0 memdesc 1 4K 4K 78643K 1 0 crypto data 1 1K 1K 78643K 1 0 ip6_options 0 0K 0K 78643K 112 0 NDP 13 0K 2K 78643K 115 0 temp 126 5770K 6794K 78643K 31622 0 kqueue 12 18K 24K 78643K 338 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 1502 0 1499 19 17 2 6 0 8 1 rtentry 112 318 0 250 4 0 4 4 0 8 0 unpcb 144 2812 0 2799 31 25 6 8 0 8 5 syncache 296 30 0 30 7 6 1 1 0 8 1 tcpqe 32 126 0 126 6 5 1 1 0 8 1 tcpcb 776 802 0 794 31 29 2 11 0 8 0 arp 88 45 0 32 1 0 1 1 0 8 0 ipq 40 4 0 4 2 2 0 1 0 8 0 ipqe 40 15 0 15 2 2 0 1 0 8 0 inpcb 336 5677 0 5660 71 68 3 18 0 8 0 nd6 48 70 0 57 1 0 1 1 0 8 0 pkpcb 40 13 0 13 2 2 0 1 0 8 0 kcovpl 48 20 0 13 1 0 1 1 0 8 0 mppekey 1024 6 0 6 2 2 0 1 0 8 0 ppxss 1160 65 0 64 4 3 1 1 0 8 0 pppxif 1360 47 0 47 2 2 0 1 0 8 0 pfstscr 40 8 0 4 1 0 1 1 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 5 0 0 1 0 1 1 0 8 0 pfstkey 128 13 0 10 1 0 1 1 0 8 0 pfstate 352 8 0 4 1 0 1 1 0 8 0 rttmr 136 3 0 3 1 1 0 1 0 8 0 art_heap8 4096 1 0 0 1 0 1 1 0 8 0 art_heap4 256 1581 0 1277 38 17 21 29 0 8 0 art_table 32 1582 0 1277 4 0 4 4 0 8 0 art_node 16 317 0 258 1 0 1 1 0 8 0 sysvmsgpl 40 14 0 4 1 0 1 1 0 8 0 semapl 112 389 0 379 1 0 1 1 0 8 0 shmpl 112 137 0 9 4 0 4 4 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino2pl 256 5467 0 4041 90 0 90 90 0 8 0 ffsino 240 5467 0 4041 85 0 85 85 0 8 0 nchpl 144 9740 0 8122 63 0 63 63 0 8 0 rtmask 32 1 0 1 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 35625 0 35625 5 4 1 3 0 8 1 vmpool 664 7 0 7 2 1 1 1 0 8 1 kstatmem 264 132 0 106 2 0 2 2 0 8 0 scsiplug 72 8 0 8 2 2 0 1 0 8 0 scxspl 216 27174 0 27174 12 11 1 8 0 8 1 plimitpl 152 569 0 555 1 0 1 1 0 8 0 sigapl 424 3495 0 3434 8 0 8 8 0 8 0 futexpl 64 36532 0 36531 1 0 1 1 0 8 0 knotepl 120 46234 0 46160 16 10 6 7 0 8 1 kqueuepl 184 909 0 901 15 14 1 6 0 8 0 pipepl 288 1280 0 1255 15 12 3 7 0 8 0 fdescpl 432 3357 0 3335 4 0 4 4 0 8 0 filepl 120 28941 0 28724 46 34 12 16 0 8 4 lockfpl 104 871 0 869 3 2 1 2 0 8 0 lockfspl 48 254 0 252 1 0 1 1 0 8 0 sessionpl 144 35 0 20 1 0 1 1 0 8 0 pgrppl 48 35 0 20 1 0 1 1 0 8 0 ucredpl 104 2673 0 2663 1 0 1 1 0 8 0 zombiepl 144 3435 0 3434 1 0 1 1 0 8 0 processpl 1008 3495 0 3434 10 1 9 9 0 8 0 procpl 696 8043 0 7966 12 3 9 10 0 8 1 sosppl 168 39 0 39 7 6 1 1 0 8 1 sockpl 456 10020 0 9991 206 186 20 37 0 8 16 mcl64k 65536 204 0 204 5 4 1 1 0 8 1 mcl16k 16384 49 0 49 7 7 0 1 0 8 0 mcl12k 12288 122 0 122 7 6 1 1 0 8 1 mcl9k 9216 42 0 42 8 8 0 1 0 8 0 mcl8k 8192 305 0 305 5 4 1 1 0 8 1 mcl4k 4096 410 0 410 2 1 1 1 0 8 1 mcl2k2 2112 70 0 70 10 9 1 1 0 8 1 mcl2k 2048 80507 0 80437 35 25 10 31 0 8 0 mtagpl 96 227 0 127 5 1 4 4 0 8 0 mbufpl 256 218584 0 218305 2730 2699 31 1974 0 8 6 bufpl 288 7988 0 1597 457 0 457 457 0 8 0 anonpl 24 682535 0 666020 181 63 118 131 0 188 10 amapchunkpl 152 59737 0 59100 43 14 29 35 0 158 1 amappl16 200 7872 0 7316 73 37 36 43 0 8 6 amappl15 192 40 0 37 1 0 1 1 0 8 0 amappl14 184 207 0 195 2 1 1 2 0 8 0 amappl13 176 6 0 6 1 1 0 1 0 8 0 amappl12 168 535 0 533 1 0 1 1 0 8 0 amappl11 160 43 0 33 1 0 1 1 0 8 0 amappl10 152 51 0 43 1 0 1 1 0 8 0 amappl9 144 975 0 973 1 0 1 1 0 8 0 amappl8 136 192 0 133 3 0 3 3 0 8 0 amappl7 128 178 0 155 2 0 2 2 0 8 0 amappl6 120 222 0 212 2 1 1 2 0 8 0 amappl5 112 224 0 218 1 0 1 1 0 8 0 amappl4 104 611 0 587 2 1 1 2 0 8 0 amappl3 96 9112 0 9070 2 0 2 2 0 8 0 amappl2 88 3898 0 3832 3 0 3 3 0 8 0 amappl1 80 77399 0 76763 28 11 17 26 0 8 0 amappl 88 20610 0 20461 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 139 0 9 3 0 3 3 0 8 0 uaddrrnd 24 3364 0 3342 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 3364 0 3342 1 0 1 1 0 8 0 vmmpekpl 168 31037 0 30975 3 0 3 3 0 8 0 vmmpepl 168 314941 0 312615 201 70 131 140 0 357 14 vmsppl 344 3363 0 3342 3 0 3 3 0 8 0 rwobjpl 24 88554 0 80927 49 0 49 49 0 8 0 pdppl 4096 6734 0 6684 264 200 64 68 0 8 14 pvpl 32 1387161 0 1365706 394 186 208 333 0 265 20 pmappl 216 3363 0 3342 2 0 2 2 0 8 0 extentpl 40 56 0 38 1 0 1 1 0 8 0 phpool 112 3820 0 3047 83 55 28 75 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(ffff800000e08800) at tun_clone_destroy+0x234 sys/net/if_tun.c:315 if_clone_destroy(ffff8000217139c0) at if_clone_destroy+0x132 sys/net/if.c:1247 sys_ioctl(ffff800021725b60,ffff800021713ad8,ffff800021713b20) at sys_ioctl+0x49e syscall(ffff800021713ba0) at syscall+0x4a4 sys/arch/amd64/amd64/trap.c:625 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0xdccd9e520d0, 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(ffff800000e08800) at tun_clone_destroy+0x234 sys/net/if_tun.c:315 if_clone_destroy(ffff8000217139c0) at if_clone_destroy+0x132 sys/net/if.c:1247 sys_ioctl(ffff800021725b60,ffff800021713ad8,ffff800021713b20) at sys_ioctl+0x49e syscall(ffff800021713ba0) at syscall+0x4a4 sys/arch/amd64/amd64/trap.c:625 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0xdccd9e520d0, count: -8