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 * 56408 54438 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(ffff800000d4e000) at tun_clone_destroy+0x234 sys/net/if_tun.c:315 if_clone_destroy(ffff80002e83a230) at if_clone_destroy+0x132 sys/net/if.c:1247 sys_ioctl(ffff8000fffe9348,ffff80002e83a340,ffff80002e83a390) at sys_ioctl+0x49e syscall(ffff80002e83a410) at syscall+0x4a4 sys/arch/amd64/amd64/trap.c:625 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x7f7fffffbc80, 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(ffff800000d4e000) at tun_clone_destroy+0x234 sys/net/if_tun.c:315 if_clone_destroy(ffff80002e83a230) at if_clone_destroy+0x132 sys/net/if.c:1247 sys_ioctl(ffff8000fffe9348,ffff80002e83a340,ffff80002e83a390) at sys_ioctl+0x49e syscall(ffff80002e83a410) at syscall+0x4a4 sys/arch/amd64/amd64/trap.c:625 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x7f7fffffbc80, count: -8 ddb> show registers rdi 0 rsi 0x1 rbp 0xffff80002e83a0c0 rbx 0x80206979 __kernel_virt_to_phys+0x206979 rdx 0 rcx 0 rax 0xffff8000fffe9348 r8 0x101010101010101 r9 0x8080808080808080 r10 0xbaf214b2fa0e8d49 r11 0x9ae7104151db5bf0 r12 0 r13 0 r14 0 r15 0x1 rip 0xffffffff81a69eb8 db_enter+0x18 cs 0x8 rflags 0x246 rsp 0xffff80002e83a0b0 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb> show proc PROC (ifconfig) pid=56408 stat=onproc flags process=2 proc=0 pri=84, usrpri=84, nice=20 forw=0xffffffffffffffff, list=0xffff8000fffe8dd8,0xffffffff82cf3498 process=0xffff8000216de000 user=0xffff80002e835000, vmspace=0xfffffd8069b67978 estcpu=34, cpticks=1, pctcpu=0.0 user=0, sys=1, intr=0 ddb> ps PID TID PPID UID S FLAGS WAIT COMMAND *54438 56408 80049 0 7 0x2 ifconfig 80049 225032 27 0 3 0x10008a sigsusp sh 27 158139 60389 0 3 0x82 wait syz-executor.0 4974 84096 60389 0 3 0x82 piperd syz-executor.2 81372 76378 60389 0 3 0x82 piperd syz-executor.5 19733 113817 60389 0 3 0x82 piperd syz-executor.6 47321 41727 60389 0 3 0x82 piperd syz-executor.1 89117 459072 60389 0 3 0x82 piperd syz-executor.3 32773 125037 60389 0 3 0x82 piperd syz-executor.4 49034 270378 60389 0 3 0x82 piperd syz-executor.7 15063 441704 1 0 3 0x100083 ttyopn getty 47116 114971 0 0 3 0x14280 nfsidl nfsio 58078 75220 0 0 3 0x14280 nfsidl nfsio 82215 442128 0 0 3 0x14280 nfsidl nfsio 47929 369419 0 0 3 0x14280 nfsidl nfsio 40351 235210 0 0 3 0x14280 nfsidl nfsio 67418 4420 0 0 3 0x14280 nfsidl nfsio 8578 482367 0 0 3 0x14280 nfsidl nfsio 33064 413259 0 0 3 0x14280 nfsidl nfsio 13220 189364 0 0 3 0x14280 nfsidl nfsio 30924 510835 0 0 3 0x14280 nfsidl nfsio 79121 164672 0 0 3 0x14280 nfsidl nfsio 40046 22269 0 0 3 0x14280 nfsidl nfsio 46807 229201 0 0 3 0x14280 nfsidl nfsio 27466 471341 0 0 3 0x14280 nfsidl nfsio 5785 47755 0 0 3 0x14280 nfsidl nfsio 60677 460869 0 0 3 0x14280 nfsidl nfsio 80894 251634 0 0 3 0x14280 nfsidl nfsio 36598 36310 0 0 3 0x14280 nfsidl nfsio 58493 90401 0 0 3 0x14280 nfsidl nfsio 83883 136481 0 0 3 0x14280 nfsidl nfsio 71601 122346 0 0 3 0x14200 bored sosplice 60389 242786 37562 0 3 0x82 wait syz-fuzzer 60389 276034 37562 0 2 0x4000482 syz-fuzzer 60389 125711 37562 0 3 0x4000082 wait syz-fuzzer 60389 126059 37562 0 3 0x4000082 thrsleep syz-fuzzer 60389 253756 37562 0 3 0x4000082 wait syz-fuzzer 60389 207338 37562 0 3 0x4000082 thrsleep syz-fuzzer 60389 167957 37562 0 3 0x4000082 thrsleep syz-fuzzer 60389 116833 37562 0 3 0x4000082 wait syz-fuzzer 60389 76729 37562 0 3 0x4000082 wait syz-fuzzer 60389 270366 37562 0 3 0x4000082 wait syz-fuzzer 60389 212430 37562 0 3 0x4000082 thrsleep syz-fuzzer 60389 290023 37562 0 3 0x4000082 thrsleep syz-fuzzer 60389 134806 37562 0 3 0x4000082 wait syz-fuzzer 60389 401439 37562 0 3 0x4000082 wait syz-fuzzer 37562 360605 96190 0 3 0x10008a sigsusp ksh 96190 183283 57037 0 3 0x9a kqread sshd 57037 430498 1 0 3 0x88 kqread sshd 33430 78884 78482 73 3 0x1100090 kqread syslogd 78482 268819 1 0 3 0x100082 netio syslogd 63540 216930 1 0 3 0x100080 kqread resolvd 47935 56071 64787 77 2 0x100092 dhcpleased 74963 245819 64787 77 3 0x100092 kqread dhcpleased 64787 15061 1 0 3 0x80 kqread dhcpleased 75831 476080 0 0 3 0x14200 bored smr 38402 428266 0 0 2 0x14200 zerothread 38342 195860 0 0 3 0x14200 aiodoned aiodoned 69584 492215 0 0 3 0x14200 syncer update 22624 222026 0 0 3 0x14200 cleaner cleaner 77713 506205 0 0 3 0x14200 reaper reaper 74101 439662 0 0 3 0x14200 pgdaemon pagedaemon 92977 122928 0 0 3 0x14200 bored viomb 59675 174933 0 0 3 0x40014200 acpi0 acpi0 4703 463510 0 0 3 0x14200 bored softnet 82773 254298 0 0 3 0x14200 bored softnet 74972 199704 0 0 3 0x14200 bored softnet 87997 329492 0 0 3 0x14200 bored softnet 500 108055 0 0 3 0x14200 bored systqmp 89888 214275 0 0 3 0x14200 bored systq 48593 474203 0 0 2 0x40014200 softclock 29538 312234 0 0 3 0x40014200 idle0 1 155208 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 10224 6438K 6873K 78643K 28635 0 pcb 13 24K 28K 78643K 9228 0 rtable 156 14K 16K 78643K 3340 0 ifaddr 72 21K 25K 78643K 1046 0 sysctl 3 1K 2K 78643K 9 0 counters 27 17K 17K 78643K 474 0 ioctlops 0 0K 2K 78643K 1814 0 iov 0 0K 28K 78643K 2488 0 mount 1 1K 1K 78643K 1 0 log 0 0K 0K 78643K 4 0 vnodes 1519 95K 95K 78643K 9570 0 UFS quota 1 32K 32K 78643K 1 0 UFS mount 5 36K 36K 78643K 5 0 shm 2 1K 9K 78643K 66 0 VM map 2 1K 1K 78643K 2 0 sem 12 0K 0K 78643K 1663 0 dirhash 12 2K 2K 78643K 12 0 ACPI 1697 195K 286K 78643K 12548 0 file desc 12 41K 65K 78643K 10643 0 sigio 0 0K 0K 78643K 327 0 proc 82 68K 75K 78643K 2165 0 subproc 104 6K 6K 78643K 758 0 NFS srvsock 1 0K 0K 78643K 1 0 NFS daemon 1 16K 16K 78643K 1 0 ip_moptions 0 0K 0K 78643K 388 0 in_multi 53 3K 6K 78643K 971 0 ether_multi 1 0K 0K 78643K 58 0 mrt 1 0K 0K 78643K 79 0 ISOFS mount 1 32K 32K 78643K 1 0 MSDOSFS mount 1 16K 16K 78643K 1 0 ttys 235 1049K 1049K 78643K 235 0 exec 0 0K 1K 78643K 2450 0 pfkey data 0 0K 0K 78643K 75 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 283 88K 104K 78643K 69445 0 UVM aobj 131 4K 4K 78643K 139 0 memdesc 1 4K 4K 78643K 1 0 crypto data 1 1K 1K 78643K 1 0 ip6_options 0 0K 0K 78643K 499 0 NDP 12 0K 1K 78643K 349 0 temp 135 5770K 6798K 78643K 178124 0 kqueue 12 18K 26K 78643K 1052 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 1318 0 1315 24 23 1 3 0 8 0 rtentry 112 1018 0 955 4 1 3 4 0 8 0 unpcb 144 12476 0 12463 121 120 1 8 0 8 0 syncache 296 70 0 70 21 20 1 1 0 8 1 tcpqe 32 288 0 288 14 14 0 1 0 8 0 tcpcb 776 4331 0 4326 141 133 8 21 0 8 7 arp 88 146 0 135 1 0 1 1 0 8 0 ipq 40 18 0 18 8 8 0 1 0 8 0 ipqe 40 47 0 47 8 8 0 1 0 8 0 inpcb 336 25861 0 25852 257 250 7 29 0 8 5 nd6 48 196 0 182 1 0 1 1 0 8 0 pkpcb 40 34 0 34 9 9 0 1 0 8 0 kcovpl 48 58 0 50 1 0 1 1 0 8 0 mppekey 1024 5 0 5 2 2 0 1 0 8 0 ppxss 1160 317 0 317 30 30 0 1 0 8 0 pppxif 1360 201 0 201 18 18 0 1 0 8 0 pfstscr 40 342 0 335 1 0 1 1 0 8 0 pfosfp 40 9 0 6 1 0 1 1 0 8 0 pfosfpen 112 9 0 2 1 0 1 1 0 8 0 pfanchor 1280 512 113 0 43 0 43 43 0 8 0 pfqueue 264 5 0 5 2 2 0 1 0 8 0 pfstitem 24 160 0 146 1 0 1 1 0 8 0 pfstkey 128 550 0 465 3 0 3 3 0 8 0 pfstate 352 275 0 268 1 0 1 1 0 8 0 rttmr 136 26 0 26 7 7 0 1 0 8 0 art_heap8 4096 10 0 8 6 4 2 4 0 8 0 art_heap4 256 4084 0 3802 52 28 24 31 0 8 0 art_table 32 4094 0 3810 4 0 4 4 0 8 0 art_node 16 926 0 872 1 0 1 1 0 8 0 sysvmsgpl 40 53 0 13 1 0 1 1 0 8 0 semapl 112 1661 0 1651 1 0 1 1 0 8 0 shmpl 112 136 0 8 4 0 4 4 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino2pl 256 16133 0 14658 93 0 93 93 0 8 0 ffsino 240 16133 0 14658 88 0 88 88 0 8 0 nchpl 144 30564 0 28933 63 0 63 63 0 8 0 uvmvnodes 80 5963 0 0 122 0 122 122 0 8 0 vnodes 216 5963 0 0 332 0 332 332 0 8 0 namei 1024 115927 0 115927 9 8 1 3 0 8 1 vmpool 664 61 0 61 9 9 0 1 0 8 0 kstatmem 264 434 0 410 3 1 2 3 0 8 0 scsiplug 72 9 0 9 3 3 0 1 0 8 0 scxspl 216 89212 0 89212 28 26 2 8 0 8 2 plimitpl 152 1892 0 1877 1 0 1 1 0 8 0 sigapl 424 10867 0 10807 9 1 8 8 0 8 0 futexpl 64 122843 0 122843 6 5 1 1 0 8 1 knotepl 120 184939 0 184857 122 116 6 21 0 8 0 kqueuepl 184 2271 0 2263 32 31 1 4 0 8 0 pipepl 288 3664 0 3636 63 58 5 11 0 8 2 fdescpl 432 10822 0 10799 4 0 4 4 0 8 0 filepl 120 101910 0 101677 150 139 11 19 0 8 3 lockfpl 104 3218 0 3216 8 7 1 2 0 8 0 lockfspl 48 794 0 792 1 0 1 1 0 8 0 sessionpl 144 74 0 58 1 0 1 1 0 8 0 pgrppl 48 174 0 158 1 0 1 1 0 8 0 ucredpl 104 10765 0 10754 1 0 1 1 0 8 0 zombiepl 144 10807 0 10807 3 2 1 1 0 8 1 processpl 1008 10867 0 10807 10 1 9 9 0 8 0 procpl 696 26909 0 26836 17 8 9 10 0 8 0 sosppl 168 114 0 114 25 25 0 1 0 8 0 sockpl 456 39863 0 39833 865 851 14 46 0 8 8 mcl64k 65536 424 0 424 34 33 1 1 0 8 1 mcl16k 16384 180 0 180 38 38 0 1 0 8 0 mcl12k 12288 387 0 387 34 33 1 1 0 8 1 mcl9k 9216 170 0 170 37 36 1 1 0 8 1 mcl8k 8192 1027 0 1027 28 27 1 1 0 8 1 mcl4k 4096 1299 0 1299 23 22 1 1 0 8 1 mcl2k2 2112 110 0 110 30 30 0 1 0 8 0 mcl2k 2048 99108 0 99035 67 56 11 36 0 8 1 mtagpl 96 1979 0 1901 15 12 3 9 0 8 0 mbufpl 256 302078 0 301797 1056 1023 33 295 0 8 5 bufpl 288 23010 0 16616 458 0 458 458 0 8 0 anonpl 24 2159811 0 2145455 219 98 121 136 0 188 0 amapchunkpl 152 196247 0 195644 107 77 30 42 0 158 0 amappl16 200 23741 0 23144 157 122 35 45 0 8 1 amappl15 192 11 0 10 1 0 1 1 0 8 0 amappl14 184 330 0 315 2 0 2 2 0 8 0 amappl13 176 10 0 9 1 0 1 1 0 8 0 amappl12 168 985 0 981 1 0 1 1 0 8 0 amappl11 160 45 0 34 1 0 1 1 0 8 0 amappl10 152 90 0 82 1 0 1 1 0 8 0 amappl9 144 1003 0 1003 6 6 0 1 0 8 0 amappl8 136 368 0 299 4 1 3 3 0 8 0 amappl7 128 258 0 232 2 0 2 2 0 8 0 amappl6 120 460 0 444 2 1 1 2 0 8 0 amappl5 112 462 0 454 1 0 1 1 0 8 0 amappl4 104 1132 0 1105 2 1 1 2 0 8 0 amappl3 96 30508 0 30470 2 0 2 2 0 8 0 amappl2 88 11744 0 11677 3 1 2 3 0 8 0 amappl1 80 244254 0 243638 36 19 17 26 0 8 0 amappl 88 68181 0 68031 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 138 0 8 3 0 3 3 0 8 0 uaddrrnd 24 10883 0 10860 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 10883 0 10860 1 0 1 1 0 8 0 vmmpekpl 168 85665 0 85621 3 0 3 3 0 8 0 vmmpepl 168 1003604 0 1001297 470 326 144 161 0 357 14 vmsppl 344 10882 0 10860 3 0 3 3 0 8 0 rwobjpl 24 262664 0 254936 54 5 49 49 0 8 0 pdppl 4096 21772 0 21720 760 700 60 66 0 8 8 pvpl 32 4218071 0 4198623 522 317 205 334 0 265 0 pmappl 216 10882 0 10860 2 0 2 2 0 8 0 extentpl 40 56 0 38 1 0 1 1 0 8 0 phpool 112 3058 0 2269 31 4 27 31 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(ffff800000d4e000) at tun_clone_destroy+0x234 sys/net/if_tun.c:315 if_clone_destroy(ffff80002e83a230) at if_clone_destroy+0x132 sys/net/if.c:1247 sys_ioctl(ffff8000fffe9348,ffff80002e83a340,ffff80002e83a390) at sys_ioctl+0x49e syscall(ffff80002e83a410) at syscall+0x4a4 sys/arch/amd64/amd64/trap.c:625 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x7f7fffffbc80, 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(ffff800000d4e000) at tun_clone_destroy+0x234 sys/net/if_tun.c:315 if_clone_destroy(ffff80002e83a230) at if_clone_destroy+0x132 sys/net/if.c:1247 sys_ioctl(ffff8000fffe9348,ffff80002e83a340,ffff80002e83a390) at sys_ioctl+0x49e syscall(ffff80002e83a410) at syscall+0x4a4 sys/arch/amd64/amd64/trap.c:625 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x7f7fffffbc80, count: -8