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 * 89398 25128 0 0 0x4000000 0 syz-executor.7 db_enter() at db_enter+0x18 sys/arch/amd64/amd64/db_interface.c:437 panic(ffffffff82577471) at panic+0x161 sys/kern/subr_prf.c:198 __assert(ffffffff825ed10e,ffffffff826204f5,12f,ffffffff82601c44) at __assert+0x25 sys/kern/subr_prf.c:157 tun_clone_destroy(ffff800000cef800) at tun_clone_destroy+0x234 sys/net/if_tun.c:303 if_clone_destroy(ffff80002176f990) at if_clone_destroy+0x132 sys/net/if.c:1276 sys_ioctl(ffff80002178a7e8,ffff80002176faa8,ffff80002176fb00) at sys_ioctl+0x49e syscall(ffff80002176fb70) at syscall+0x447 sys/arch/amd64/amd64/trap.c:585 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0xa6d512e33b0, 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(ffffffff82577471) at panic+0x161 sys/kern/subr_prf.c:198 __assert(ffffffff825ed10e,ffffffff826204f5,12f,ffffffff82601c44) at __assert+0x25 sys/kern/subr_prf.c:157 tun_clone_destroy(ffff800000cef800) at tun_clone_destroy+0x234 sys/net/if_tun.c:303 if_clone_destroy(ffff80002176f990) at if_clone_destroy+0x132 sys/net/if.c:1276 sys_ioctl(ffff80002178a7e8,ffff80002176faa8,ffff80002176fb00) at sys_ioctl+0x49e syscall(ffff80002176fb70) at syscall+0x447 sys/arch/amd64/amd64/trap.c:585 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0xa6d512e33b0, count: -8 ddb> show registers rdi 0 rsi 0x1 rbp 0xffff80002176f820 rbx 0x80206979 __kernel_virt_to_phys+0x206979 rdx 0xffff800000c89800 rcx 0 rax 0xffff80002178a7e8 r8 0 r9 0x8080808080808080 r10 0xc439d57f14eb4dbb r11 0xdc64c82d72f99b48 r12 0 r13 0 r14 0 r15 0x1 rip 0xffffffff811b9268 db_enter+0x18 cs 0x8 rflags 0x246 rsp 0xffff80002176f810 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb> show proc PROC (syz-executor.7) pid=89398 stat=onproc flags process=0 proc=4000000 pri=32, usrpri=83, nice=20 forw=0xffffffffffffffff, list=0xffff80002803dcf0,0xffff80002178ba58 process=0xffff80002179f3b0 user=0xffff80002176a000, vmspace=0xfffffd807f014bb0 estcpu=33, cpticks=1, pctcpu=0.0 user=0, sys=1, intr=0 ddb> ps PID TID PPID UID S FLAGS WAIT COMMAND 82592 369603 90166 0 2 0 syz-executor.1 82592 155550 90166 0 3 0x4000080 fsleep syz-executor.1 66695 175762 75819 0 2 0 syz-executor.4 66695 406418 75819 0 3 0x4000080 fsleep syz-executor.4 60643 411200 1478 0 2 0 syz-executor.6 60643 439873 1478 0 3 0x4000080 fsleep syz-executor.6 56004 83634 50096 0 2 0 syz-executor.5 56004 510745 50096 0 3 0x4000080 fsleep syz-executor.5 25128 469976 8430 0 2 0 syz-executor.7 *25128 89398 8430 0 7 0x4000000 syz-executor.7 1478 308111 43843 0 3 0x82 nanoslp syz-executor.6 74268 181510 43843 0 3 0x82 nanoslp syz-executor.3 35922 169411 43843 0 3 0x82 nanoslp syz-executor.2 50096 303032 43843 0 3 0x82 nanoslp syz-executor.5 8430 171418 43843 0 3 0x82 nanoslp syz-executor.7 90166 314320 43843 0 2 0x482 syz-executor.1 21263 280959 43843 0 3 0x82 nanoslp syz-executor.0 75819 21717 43843 0 3 0x82 nanoslp syz-executor.4 89547 476913 0 0 3 0x14200 bored sosplice 32224 18049 1 0 3 0x100083 ttyin getty 43843 178694 9185 0 3 0x82 thrsleep syz-fuzzer 43843 438167 9185 0 3 0x4000082 thrsleep syz-fuzzer 43843 517342 9185 0 3 0x4000082 wait syz-fuzzer 43843 522802 9185 0 3 0x4000082 kqread syz-fuzzer 43843 142953 9185 0 3 0x4000082 wait syz-fuzzer 43843 94646 9185 0 3 0x4000082 thrsleep syz-fuzzer 43843 344064 9185 0 3 0x4000082 thrsleep syz-fuzzer 43843 53811 9185 0 3 0x4000082 wait syz-fuzzer 43843 286408 9185 0 3 0x4000082 thrsleep syz-fuzzer 43843 40631 9185 0 3 0x4000082 wait syz-fuzzer 43843 275646 9185 0 3 0x4000082 wait syz-fuzzer 43843 36298 9185 0 3 0x4000082 wait syz-fuzzer 43843 93438 9185 0 3 0x4000082 wait syz-fuzzer 43843 354289 9185 0 3 0x4000082 wait syz-fuzzer 9185 283798 27989 0 3 0x10008a sigsusp ksh 27989 143242 14956 0 3 0x9a kqread sshd 14956 143435 1 0 3 0x88 kqread sshd 54858 470009 29607 73 3 0x1100090 kqread syslogd 29607 192836 1 0 3 0x100082 netio syslogd 1408 129583 1 0 3 0x100080 kqread resolvd 20257 82348 21540 77 2 0x100092 dhcpleased 62728 49792 21540 77 3 0x100092 kqread dhcpleased 21540 506256 1 0 3 0x80 kqread dhcpleased 20189 24718 0 0 3 0x14200 bored smr 86855 439440 0 0 2 0x14200 zerothread 6683 310686 0 0 3 0x14200 aiodoned aiodoned 75644 340592 0 0 3 0x14200 syncer update 64141 268973 0 0 3 0x14200 cleaner cleaner 31387 320075 0 0 3 0x14200 reaper reaper 39302 79698 0 0 3 0x14200 pgdaemon pagedaemon 83240 455602 0 0 3 0x14200 bored viomb 89564 471710 0 0 3 0x40014200 acpi0 acpi0 17777 17468 0 0 3 0x14200 bored softnet 21365 441604 0 0 3 0x14200 bored softnet 70010 456407 0 0 3 0x14200 bored softnet 59587 310427 0 0 3 0x14200 bored softnet 41208 171440 0 0 3 0x14200 bored systqmp 79660 377530 0 0 3 0x14200 bored systq 9663 519783 0 0 2 0x40014200 softclock 91657 411579 0 0 3 0x40014200 idle0 1 379552 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 10203 6434K 7594K 78643K 28672 0 pcb 13 18K 22K 78643K 4380 0 rtable 199 11K 20K 78643K 12758 0 ifaddr 181 44K 45K 78643K 1716 0 sysctl 2 0K 0K 78643K 4 0 counters 26 17K 17K 78643K 304 0 ioctlops 0 0K 4K 78643K 3208 0 iov 0 0K 28K 78643K 1996 0 mount 1 1K 1K 78643K 1 0 log 0 0K 0K 78643K 4 0 vnodes 1578 99K 99K 78643K 9062 0 UFS quota 1 32K 32K 78643K 1 0 UFS mount 5 36K 36K 78643K 5 0 shm 2 1K 9K 78643K 164 0 VM map 2 0K 0K 78643K 2 0 sem 25 3K 6K 78643K 188 0 dirhash 12 2K 2K 78643K 12 0 ACPI 1697 195K 286K 78643K 12548 0 file desc 15 53K 73K 78643K 13431 0 sigio 0 0K 0K 78643K 955 0 proc 61 59K 75K 78643K 2997 0 subproc 104 6K 6K 78643K 1014 0 NFS srvsock 1 0K 0K 78643K 1 0 NFS daemon 1 16K 16K 78643K 1 0 ip_moptions 0 0K 0K 78643K 675 0 in_multi 68 4K 6K 78643K 1057 0 ether_multi 1 0K 0K 78643K 62 0 mrt 1 0K 0K 78643K 512 0 ISOFS mount 1 32K 32K 78643K 1 0 MSDOSFS mount 1 16K 16K 78643K 1 0 ttys 169 758K 758K 78643K 169 0 exec 0 0K 2K 78643K 4073 0 pfkey data 0 0K 0K 78643K 13 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 282 134K 710K 78643K 72514 0 UVM aobj 131 4K 4K 78643K 134 0 memdesc 1 4K 4K 78643K 1 0 crypto data 1 1K 1K 78643K 1 0 ip6_options 0 0K 0K 78643K 419 0 NDP 13 0K 2K 78643K 367 0 temp 134 4726K 5766K 78643K 137165 0 kqueue 12 18K 28K 78643K 1117 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 15090 0 15085 72 69 3 6 0 8 2 rtentry 112 1290 0 1212 4 1 3 4 0 8 0 unpcb 144 8873 0 8860 83 80 3 10 0 8 2 syncache 296 55 0 55 17 17 0 1 0 8 0 tcpqe 32 119 0 119 6 6 0 1 0 8 0 tcpcb 768 4399 0 4392 224 215 9 21 0 8 8 arp 88 168 0 154 1 0 1 1 0 8 0 ipq 40 14 0 14 4 4 0 1 0 8 0 ipqe 40 78 0 78 4 4 0 1 0 8 0 inpcb 336 13472 0 13461 216 207 9 15 0 8 8 nd6 48 249 0 230 1 0 1 1 0 8 0 pkpcb 40 81 0 81 4 4 0 1 0 8 0 kcovpl 48 78 0 70 1 0 1 1 0 8 0 ppxss 1160 157 0 157 19 18 1 1 0 8 1 pfstscr 40 83 0 76 1 0 1 1 0 8 0 pfosfp 40 7 0 5 1 0 1 1 0 8 0 pfosfpen 112 7 0 2 1 0 1 1 0 8 0 pfrke_plain 168 18 0 18 2 2 0 1 0 8 0 pfrktable 1344 214 0 212 6 5 1 2 0 8 0 pfanchor 1280 705 239 193 44 1 43 43 0 8 0 pftag 88 23 0 12 1 0 1 1 0 8 0 pfqueue 264 5 0 5 1 1 0 1 0 8 0 pfstitem 24 93 0 80 1 0 1 1 0 8 0 pfstkey 120 167 0 158 1 0 1 1 0 8 0 pfstate 336 87 0 80 1 0 1 1 0 8 0 pfrule 1360 725 0 697 15 12 3 7 0 8 0 rttmr 136 211 0 211 11 11 0 1 0 8 0 art_heap8 4096 7 0 6 6 5 1 2 0 8 0 art_heap4 256 4481 0 4173 62 40 22 29 0 8 2 art_table 32 4488 0 4179 6 3 3 4 0 8 0 art_node 16 1276 0 1209 1 0 1 1 0 8 0 sysvmsgpl 40 38 0 13 1 0 1 1 0 8 0 semapl 112 173 0 150 1 0 1 1 0 8 0 shmpl 112 131 0 3 4 0 4 4 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino2pl 256 19405 0 17930 93 0 93 93 0 8 0 ffsino 240 19405 0 17930 88 0 88 88 0 8 0 nchpl 144 37053 0 36561 63 41 22 63 0 8 0 rtmask 32 33 0 33 7 7 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 135758 0 135758 10 9 1 2 0 8 1 vcpupl 2048 3 0 0 1 0 1 1 0 8 0 vmpool 536 3 0 0 1 0 1 1 0 8 0 pfiaddrpl 120 308 0 308 10 9 1 2 0 8 1 kstatmem 264 410 0 384 11 8 3 3 0 8 0 scsiplug 72 14 0 14 3 3 0 1 0 8 0 scxspl 216 110276 0 110276 33 32 1 8 0 8 1 plimitpl 152 1639 0 1624 1 0 1 1 0 8 0 sigapl 424 13597 0 13551 8 1 7 8 0 8 0 futexpl 64 134065 0 134061 4 3 1 1 0 8 0 knotepl 120 186293 0 186213 108 100 8 18 0 8 4 kqueuepl 184 2902 0 2894 40 39 1 7 0 8 0 pipepl 288 2613 0 2585 66 63 3 7 0 8 1 fdescpl 432 13558 0 13532 4 0 4 4 0 8 0 filepl 120 102017 0 101777 135 123 12 17 0 8 4 lockfpl 104 3731 0 3729 10 9 1 3 0 8 0 lockfspl 48 1014 0 1012 1 0 1 1 0 8 0 sessionpl 144 94 0 78 1 0 1 1 0 8 0 pgrppl 48 138 0 122 1 0 1 1 0 8 0 ucredpl 104 10683 0 10671 1 0 1 1 0 8 0 zombiepl 144 13554 0 13551 3 2 1 1 0 8 0 processpl 1000 13597 0 13551 10 3 7 9 0 8 0 procpl 672 33642 0 33578 25 18 7 10 0 8 1 sosppl 168 105 0 105 17 17 0 1 0 8 0 sockpl 456 37570 0 37541 670 659 11 34 0 8 7 mcl64k 65536 444 0 444 26 25 1 1 0 8 1 mcl16k 16384 132 0 132 30 29 1 1 0 8 1 mcl12k 12288 452 0 452 24 23 1 1 0 8 1 mcl9k 9216 194 0 194 33 33 0 1 0 8 0 mcl8k 8192 1156 0 1156 14 13 1 1 0 8 1 mcl4k 4096 1858 0 1858 13 12 1 1 0 8 1 mcl2k2 2112 106 0 106 28 28 0 1 0 8 0 mcl2k 2048 98156 0 98092 55 45 10 18 0 8 0 mtagpl 96 1442 0 1393 18 15 3 7 0 8 0 mbufpl 256 305741 0 305452 957 934 23 160 0 8 0 bufpl 288 26578 0 20164 459 0 459 459 0 8 0 anonpl 24 2551653 0 2535930 318 199 119 144 0 188 4 amapchunkpl 152 240010 0 239377 403 376 27 342 0 158 0 amappl16 200 39116 0 38479 218 183 35 59 0 8 0 amappl15 192 1714 0 1709 1 0 1 1 0 8 0 amappl14 184 943 0 933 1 0 1 1 0 8 0 amappl13 176 919 0 916 1 0 1 1 0 8 0 amappl12 168 2599 0 2596 1 0 1 1 0 8 0 amappl11 160 2263 0 2244 1 0 1 1 0 8 0 amappl10 152 1705 0 1700 1 0 1 1 0 8 0 amappl9 144 2811 0 2808 1 0 1 1 0 8 0 amappl8 136 3514 0 3427 4 0 4 4 0 8 0 amappl7 128 1963 0 1941 1 0 1 1 0 8 0 amappl6 120 2945 0 2929 2 1 1 2 0 8 0 amappl5 112 11483 0 11472 1 0 1 1 0 8 0 amappl4 104 5968 0 5935 2 1 1 2 0 8 0 amappl3 96 40173 0 40121 2 0 2 2 0 8 0 amappl2 88 3272 0 3218 3 1 2 2 0 8 0 amappl1 80 328196 0 327490 34 17 17 21 0 8 0 amappl 88 70708 0 70549 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 133 0 3 3 0 3 3 0 8 0 uaddrrnd 24 13561 0 13532 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 13561 0 13532 1 0 1 1 0 8 0 vmmpekpl 168 100537 0 100483 3 0 3 3 0 8 0 vmmpepl 168 1332860 0 1330166 257 123 134 140 0 357 0 vmsppl 272 13560 0 13532 5 2 3 3 0 8 0 rwobjpl 24 317022 0 309243 53 4 49 50 0 8 0 pdppl 4096 27128 0 27067 846 779 67 68 0 8 6 pvpl 32 4951394 0 4930847 581 352 229 248 0 265 40 pmappl 216 13560 0 13532 2 0 2 2 0 8 0 extentpl 40 56 0 38 1 0 1 1 0 8 0 phpool 112 2969 0 2177 30 5 25 27 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(ffffffff82577471) at panic+0x161 sys/kern/subr_prf.c:198 __assert(ffffffff825ed10e,ffffffff826204f5,12f,ffffffff82601c44) at __assert+0x25 sys/kern/subr_prf.c:157 tun_clone_destroy(ffff800000cef800) at tun_clone_destroy+0x234 sys/net/if_tun.c:303 if_clone_destroy(ffff80002176f990) at if_clone_destroy+0x132 sys/net/if.c:1276 sys_ioctl(ffff80002178a7e8,ffff80002176faa8,ffff80002176fb00) at sys_ioctl+0x49e syscall(ffff80002176fb70) at syscall+0x447 sys/arch/amd64/amd64/trap.c:585 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0xa6d512e33b0, 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(ffffffff82577471) at panic+0x161 sys/kern/subr_prf.c:198 __assert(ffffffff825ed10e,ffffffff826204f5,12f,ffffffff82601c44) at __assert+0x25 sys/kern/subr_prf.c:157 tun_clone_destroy(ffff800000cef800) at tun_clone_destroy+0x234 sys/net/if_tun.c:303 if_clone_destroy(ffff80002176f990) at if_clone_destroy+0x132 sys/net/if.c:1276 sys_ioctl(ffff80002178a7e8,ffff80002176faa8,ffff80002176fb00) at sys_ioctl+0x49e syscall(ffff80002176fb70) at syscall+0x447 sys/arch/amd64/amd64/trap.c:585 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0xa6d512e33b0, count: -8