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 * 16279 48137 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(ffff800000d6f000) at tun_clone_destroy+0x234 sys/net/if_tun.c:315 if_clone_destroy(ffff800026579a40) at if_clone_destroy+0x132 sys/net/if.c:1247 sys_ioctl(ffff8000216e4598,ffff800026579b50,ffff800026579ba0) at sys_ioctl+0x49e syscall(ffff800026579c20) at syscall+0x4a4 sys/arch/amd64/amd64/trap.c:625 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x7f7ffffd6210, 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(ffff800000d6f000) at tun_clone_destroy+0x234 sys/net/if_tun.c:315 if_clone_destroy(ffff800026579a40) at if_clone_destroy+0x132 sys/net/if.c:1247 sys_ioctl(ffff8000216e4598,ffff800026579b50,ffff800026579ba0) at sys_ioctl+0x49e syscall(ffff800026579c20) at syscall+0x4a4 sys/arch/amd64/amd64/trap.c:625 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x7f7ffffd6210, count: -8 ddb> show registers rdi 0 rsi 0x1 rbp 0xffff8000265798d0 rbx 0x80206979 __kernel_virt_to_phys+0x206979 rdx 0 rcx 0 rax 0xffff8000216e4598 r8 0x101010101010101 r9 0x8080808080808080 r10 0x7ec8e59b906b3338 r11 0xfc22566bc1698227 r12 0 r13 0 r14 0 r15 0x1 rip 0xffffffff81a69eb8 db_enter+0x18 cs 0x8 rflags 0x246 rsp 0xffff8000265798c0 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb> show proc PROC (ifconfig) pid=16279 stat=onproc flags process=2 proc=0 pri=80, usrpri=80, nice=20 forw=0xffffffffffffffff, list=0xffff800029a04318,0xffffffff82cf3498 process=0xffff8000265723f0 user=0xffff800026574000, vmspace=0xfffffd807e7f56c0 estcpu=30, cpticks=1, pctcpu=0.0 user=0, sys=1, intr=0 ddb> ps PID TID PPID UID S FLAGS WAIT COMMAND *48137 16279 55092 0 7 0x2 ifconfig 55092 135645 58339 0 3 0x10008a sigsusp sh 58339 111936 95075 0 3 0x82 wait syz-executor.0 5950 238856 95075 0 3 0x82 piperd syz-executor.1 24841 81698 95075 0 3 0x82 piperd syz-executor.3 49941 90724 95075 0 3 0x82 piperd syz-executor.7 27098 257587 0 0 3 0x14280 nfsidl nfsio 66487 394663 0 0 3 0x14280 nfsidl nfsio 80549 517718 0 0 3 0x14280 nfsidl nfsio 86858 259812 0 0 3 0x14280 nfsidl nfsio 57423 428352 0 0 3 0x14280 nfsidl nfsio 691 443366 0 0 3 0x14280 nfsidl nfsio 30113 64750 0 0 3 0x14280 nfsidl nfsio 24984 186633 0 0 3 0x14280 nfsidl nfsio 31702 168097 0 0 3 0x14280 nfsidl nfsio 24962 419580 0 0 3 0x14280 nfsidl nfsio 64057 2610 0 0 3 0x14280 nfsidl nfsio 99502 414615 0 0 3 0x14280 nfsidl nfsio 86917 217641 0 0 3 0x14280 nfsidl nfsio 49177 27724 0 0 3 0x14280 nfsidl nfsio 42456 54746 0 0 3 0x14280 nfsidl nfsio 63379 469785 0 0 3 0x14280 nfsidl nfsio 98711 42765 0 0 3 0x14280 nfsidl nfsio 44793 442581 0 0 3 0x14280 nfsidl nfsio 86189 18347 0 0 3 0x14280 nfsidl nfsio 71664 57228 0 0 3 0x14280 nfsidl nfsio 75210 357088 95075 0 3 0x82 piperd syz-executor.2 77566 454765 95075 0 3 0x82 piperd syz-executor.4 96744 29067 95075 0 3 0x82 piperd syz-executor.5 63948 53140 0 0 3 0x14200 bored sosplice 39192 351191 95075 0 3 0x82 piperd syz-executor.6 95075 441303 56738 0 3 0x82 wait syz-fuzzer 95075 108679 56738 0 2 0x4000482 syz-fuzzer 95075 141427 56738 0 3 0x4000082 thrsleep syz-fuzzer 95075 484571 56738 0 3 0x4000082 wait syz-fuzzer 95075 164682 56738 0 3 0x4000082 thrsleep syz-fuzzer 95075 459155 56738 0 3 0x4000082 thrsleep syz-fuzzer 95075 11323 56738 0 3 0x4000082 wait syz-fuzzer 95075 502453 56738 0 3 0x4000082 wait syz-fuzzer 95075 119018 56738 0 3 0x4000082 wait syz-fuzzer 95075 171517 56738 0 3 0x4000082 wait syz-fuzzer 95075 163394 56738 0 3 0x4000082 thrsleep syz-fuzzer 95075 126284 56738 0 3 0x4000082 thrsleep syz-fuzzer 95075 93780 56738 0 3 0x4000082 wait syz-fuzzer 95075 382333 56738 0 3 0x4000082 wait syz-fuzzer 56738 46644 37531 0 3 0x10008a sigsusp ksh 37531 52712 5378 0 3 0x9a kqread sshd 1412 396044 1 0 3 0x100083 ttyopn getty 5378 161776 1 0 3 0x88 kqread sshd 49853 100846 43152 73 3 0x1100090 kqread syslogd 43152 178392 1 0 3 0x100082 netio syslogd 55301 426015 1 0 3 0x100080 kqread resolvd 41010 172206 90229 77 2 0x100092 dhcpleased 8938 432664 90229 77 3 0x100092 kqread dhcpleased 90229 118348 1 0 3 0x80 kqread dhcpleased 50623 8525 0 0 3 0x14200 bored smr 52539 193481 0 0 2 0x14200 zerothread 16169 425468 0 0 3 0x14200 aiodoned aiodoned 3042 353332 0 0 3 0x14200 syncer update 10781 53960 0 0 3 0x14200 cleaner cleaner 82835 223931 0 0 3 0x14200 reaper reaper 80136 227073 0 0 3 0x14200 pgdaemon pagedaemon 9379 25410 0 0 3 0x14200 bored viomb 99311 293979 0 0 3 0x40014200 acpi0 acpi0 25267 36792 0 0 3 0x14200 bored softnet 97392 363587 0 0 3 0x14200 bored softnet 99103 133009 0 0 3 0x14200 bored softnet 9567 269262 0 0 3 0x14200 bored softnet 33565 250525 0 0 3 0x14200 bored systqmp 32685 110805 0 0 3 0x14200 bored systq 79652 223062 0 0 3 0x40014200 bored softclock 1214 4078 0 0 3 0x40014200 idle0 1 315294 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 10216 6407K 6884K 78643K 14839 0 pcb 13 16K 21K 78643K 654 0 rtable 137 14K 16K 78643K 1260 0 ifaddr 63 19K 22K 78643K 406 0 sysctl 0 0K 0K 78643K 5 0 counters 26 17K 17K 78643K 124 0 ioctlops 0 0K 4K 78643K 402 0 iov 0 0K 24K 78643K 582 0 mount 1 1K 1K 78643K 1 0 log 0 0K 0K 78643K 4 0 vnodes 1463 91K 92K 78643K 3170 0 UFS quota 1 32K 32K 78643K 1 0 UFS mount 5 36K 36K 78643K 5 0 shm 2 1K 5K 78643K 27 0 VM map 2 1K 1K 78643K 2 0 sem 12 0K 0K 78643K 563 0 dirhash 12 2K 2K 78643K 12 0 ACPI 1697 195K 286K 78643K 12548 0 file desc 12 41K 73K 78643K 2585 0 sigio 0 0K 0K 78643K 47 0 proc 69 67K 75K 78643K 920 0 subproc 104 6K 6K 78643K 299 0 NFS srvsock 1 0K 0K 78643K 1 0 NFS daemon 1 16K 16K 78643K 1 0 ip_moptions 0 0K 0K 78643K 236 0 in_multi 57 3K 6K 78643K 465 0 ether_multi 1 0K 0K 78643K 18 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 235 1049K 1049K 78643K 235 0 exec 0 0K 1K 78643K 1025 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 254 82K 98K 78643K 17972 0 UVM aobj 131 4K 4K 78643K 131 0 memdesc 1 4K 4K 78643K 1 0 crypto data 1 1K 1K 78643K 1 0 ip6_options 0 0K 0K 78643K 203 0 NDP 11 0K 2K 78643K 145 0 temp 134 5770K 6794K 78643K 43015 0 kqueue 12 18K 26K 78643K 272 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 574 0 571 9 7 2 5 0 8 1 rtentry 112 381 0 327 4 1 3 4 0 8 0 unpcb 144 4387 0 4374 31 25 6 10 0 8 5 syncache 296 31 0 31 7 7 0 1 0 8 0 tcpqe 32 61 8 61 1 1 0 1 0 8 0 tcpcb 776 1174 0 1170 31 30 1 8 0 8 0 arp 88 48 0 40 1 0 1 1 0 8 0 ipq 40 3 0 3 1 1 0 1 0 8 0 ipqe 40 6 0 6 1 1 0 1 0 8 0 inpcb 336 2991 0 2983 42 36 6 16 0 8 5 nd6 48 93 0 84 1 0 1 1 0 8 0 pkpcb 40 39 0 39 1 1 0 1 0 8 0 kcovpl 48 23 0 15 1 0 1 1 0 8 0 mppekey 1024 5 0 5 2 1 1 1 0 8 1 ppxss 1160 51 0 51 5 4 1 1 0 8 1 pppxif 1360 22 0 22 5 4 1 1 0 8 1 pfstscr 40 4 0 3 1 0 1 1 0 8 0 pfanchor 1280 6 0 0 1 0 1 1 0 8 0 pfstitem 24 4 0 2 1 0 1 1 0 8 0 pfstkey 128 12 0 8 1 0 1 1 0 8 0 pfstate 352 6 0 5 1 0 1 1 0 8 0 art_heap8 4096 4 0 2 3 1 2 3 0 8 0 art_heap4 256 2015 0 1690 41 14 27 30 0 8 0 art_table 32 2019 0 1692 5 1 4 4 0 8 0 art_node 16 379 0 331 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 561 0 551 1 0 1 1 0 8 0 shmpl 112 128 0 0 4 0 4 4 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino2pl 256 4678 0 3253 90 0 90 90 0 8 0 ffsino 240 4678 0 3253 85 0 85 85 0 8 0 nchpl 144 9174 0 7545 63 1 62 63 0 8 0 rtmask 32 7 0 7 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 34562 0 34562 4 3 1 3 0 8 1 vmpool 664 9 0 9 3 3 0 1 0 8 0 kstatmem 264 160 0 138 4 2 2 3 0 8 0 scxspl 216 24726 0 24726 15 14 1 8 0 8 1 plimitpl 152 757 0 742 1 0 1 1 0 8 0 sigapl 424 2873 0 2813 8 0 8 8 0 8 0 futexpl 64 28564 0 28564 1 0 1 1 0 8 1 knotepl 120 48363 0 48281 31 23 8 16 0 8 3 kqueuepl 184 639 0 631 7 3 4 4 0 8 3 pipepl 288 769 0 741 15 9 6 7 0 8 3 fdescpl 432 2836 0 2813 4 0 4 4 0 8 0 filepl 120 25581 0 25348 42 28 14 16 0 8 6 lockfpl 104 725 0 723 2 1 1 2 0 8 0 lockfspl 48 202 0 200 1 0 1 1 0 8 0 sessionpl 144 38 0 22 1 0 1 1 0 8 0 pgrppl 48 123 0 107 1 0 1 1 0 8 0 ucredpl 104 2020 0 2009 1 0 1 1 0 8 0 zombiepl 144 2813 0 2813 2 1 1 1 0 8 1 processpl 1008 2873 0 2813 10 1 9 9 0 8 0 procpl 696 6612 0 6539 14 5 9 9 0 8 1 sosppl 168 14 0 14 1 1 0 1 0 8 0 sockpl 456 7993 0 7969 208 197 11 39 0 8 8 mcl64k 65536 114 0 114 7 6 1 1 0 8 1 mcl16k 16384 51 0 51 6 5 1 1 0 8 1 mcl12k 12288 89 0 89 9 8 1 1 0 8 1 mcl9k 9216 41 0 41 9 8 1 1 0 8 1 mcl8k 8192 226 0 226 2 1 1 1 0 8 1 mcl4k 4096 289 0 289 4 3 1 1 0 8 1 mcl2k2 2112 20 0 20 6 5 1 1 0 8 1 mcl2k 2048 78767 0 78695 37 26 11 31 0 8 1 mtagpl 96 243 0 226 7 3 4 4 0 8 0 mbufpl 256 167063 0 166779 382 349 33 130 0 8 8 bufpl 288 8204 0 1810 457 0 457 457 0 8 0 anonpl 24 580638 0 567084 128 21 107 126 0 188 0 amapchunkpl 152 56700 0 56104 52 22 30 42 0 158 2 amappl16 200 6323 0 5770 45 14 31 42 0 8 1 amappl15 192 6 0 6 1 1 0 1 0 8 0 amappl14 184 208 0 197 2 1 1 2 0 8 0 amappl13 176 8 0 8 1 1 0 1 0 8 0 amappl12 168 573 0 571 1 0 1 1 0 8 0 amappl11 160 46 0 35 1 0 1 1 0 8 0 amappl10 152 56 0 46 1 0 1 1 0 8 0 amappl9 144 978 0 977 2 1 1 1 0 8 0 amappl8 136 189 0 134 2 0 2 2 0 8 0 amappl7 128 173 0 150 2 0 2 2 0 8 0 amappl6 120 236 0 226 2 1 1 2 0 8 0 amappl5 112 214 0 206 1 0 1 1 0 8 0 amappl4 104 640 0 613 2 1 1 2 0 8 0 amappl3 96 7550 0 7511 2 0 2 2 0 8 0 amappl2 88 3369 0 3302 3 0 3 3 0 8 0 amappl1 80 65939 0 65319 32 15 17 26 0 8 0 amappl 88 17296 0 17152 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 130 0 0 3 0 3 3 0 8 0 uaddrrnd 24 2845 0 2822 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 2845 0 2822 1 0 1 1 0 8 0 vmmpekpl 168 26257 0 26199 3 0 3 3 0 8 0 vmmpepl 168 269796 0 267562 188 57 131 134 0 357 12 vmsppl 344 2844 0 2822 3 0 3 3 0 8 0 rwobjpl 24 76390 0 68762 47 0 47 47 0 8 0 pdppl 4096 5696 0 5644 248 184 64 68 0 8 12 pvpl 32 1211943 0 1193493 399 212 187 333 0 265 2 pmappl 216 2844 0 2822 2 0 2 2 0 8 0 extentpl 40 56 0 38 1 0 1 1 0 8 0 phpool 112 1436 0 644 25 1 24 24 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(ffff800000d6f000) at tun_clone_destroy+0x234 sys/net/if_tun.c:315 if_clone_destroy(ffff800026579a40) at if_clone_destroy+0x132 sys/net/if.c:1247 sys_ioctl(ffff8000216e4598,ffff800026579b50,ffff800026579ba0) at sys_ioctl+0x49e syscall(ffff800026579c20) at syscall+0x4a4 sys/arch/amd64/amd64/trap.c:625 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x7f7ffffd6210, 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(ffff800000d6f000) at tun_clone_destroy+0x234 sys/net/if_tun.c:315 if_clone_destroy(ffff800026579a40) at if_clone_destroy+0x132 sys/net/if.c:1247 sys_ioctl(ffff8000216e4598,ffff800026579b50,ffff800026579ba0) at sys_ioctl+0x49e syscall(ffff800026579c20) at syscall+0x4a4 sys/arch/amd64/amd64/trap.c:625 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x7f7ffffd6210, count: -8