panic: kernel diagnostic assertion "sc->sc_dev == 0" failed: file "/syzkaller/managers/multicore/kernel/sys/net/if_tun.c", line 315 Stopped at db_enter+0x18: addq $0x8,%rsp TID PID UID PRFLAGS PFLAGS CPU COMMAND *521093 83318 0 0x2 0 0K ifconfig db_enter() at db_enter+0x18 sys/arch/amd64/amd64/db_interface.c:437 panic(ffffffff82751deb) at panic+0x177 sys/kern/subr_prf.c:198 __assert(ffffffff827cd2be,ffffffff82818b32,13b,ffffffff827e01fc) at __assert+0x25 sys/kern/subr_prf.c:157 tun_clone_destroy(ffff800000df4000) at tun_clone_destroy+0x278 sys/net/if_tun.c:315 if_clone_destroy(ffff80002e563080) at if_clone_destroy+0x132 sys/net/if.c:1247 ifioctl(fffffd8061ea93d8,80206979,ffff80002e563080,ffff8000212096f8) at ifioctl+0x3b4 sys/net/if.c:1924 sys_ioctl(ffff8000212096f8,ffff80002e563190,ffff80002e5631e0) at sys_ioctl+0x4a2 syscall(ffff80002e563260) at syscall+0x606 mi_syscall sys/sys/syscall_mi.h:110 [inline] syscall(ffff80002e563260) at syscall+0x606 sys/arch/amd64/amd64/trap.c:625 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x7f7fffffbc80, count: 6 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{0}> ddb{0}> set $lines = 0 ddb{0}> set $maxwidth = 0 ddb{0}> show panic *cpu0: kernel diagnostic assertion "sc->sc_dev == 0" failed: file "/syzkaller/managers/multicore/kernel/sys/net/if_tun.c", line 315 ddb{0}> trace db_enter() at db_enter+0x18 sys/arch/amd64/amd64/db_interface.c:437 panic(ffffffff82751deb) at panic+0x177 sys/kern/subr_prf.c:198 __assert(ffffffff827cd2be,ffffffff82818b32,13b,ffffffff827e01fc) at __assert+0x25 sys/kern/subr_prf.c:157 tun_clone_destroy(ffff800000df4000) at tun_clone_destroy+0x278 sys/net/if_tun.c:315 if_clone_destroy(ffff80002e563080) at if_clone_destroy+0x132 sys/net/if.c:1247 ifioctl(fffffd8061ea93d8,80206979,ffff80002e563080,ffff8000212096f8) at ifioctl+0x3b4 sys/net/if.c:1924 sys_ioctl(ffff8000212096f8,ffff80002e563190,ffff80002e5631e0) at sys_ioctl+0x4a2 syscall(ffff80002e563260) at syscall+0x606 mi_syscall sys/sys/syscall_mi.h:110 [inline] syscall(ffff80002e563260) at syscall+0x606 sys/arch/amd64/amd64/trap.c:625 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x7f7fffffbc80, count: -9 ddb{0}> show registers rdi 0 rsi 0x1 rbp 0xffff80002e562e30 rbx 0xffffffff82b25b8f cpu_info_full_primary+0x2b8f rdx 0 rcx 0 rax 0xffff8000212096f8 r8 0 r9 0x8080808080808080 r10 0x63a0dc1912ed6eac r11 0xdc7b4e3d2d0886ce r12 0xffffffff82b25990 cpu_info_full_primary+0x2990 r13 0 r14 0 r15 0x1 rip 0xffffffff81b420b8 db_enter+0x18 cs 0x8 rflags 0x246 rsp 0xffff80002e562e20 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb{0}> show proc PROC (ifconfig) pid=521093 stat=onproc flags process=2 proc=0 pri=50, usrpri=50, nice=20 forw=0xffffffffffffffff, list=0xffff800021208960,0xffffffff82ca0df8 process=0xffff8000212a7ab8 user=0xffff80002e55e000, vmspace=0xfffffd806cde3540 estcpu=0, cpticks=1, pctcpu=0.0 user=0, sys=1, intr=0 ddb{0}> ps PID TID PPID UID S FLAGS WAIT COMMAND *83318 521093 27342 0 7 0x2 ifconfig 27342 53408 26444 0 3 0x10008a sigsusp sh 26444 386263 51989 0 3 0x82 wait syz-executor.0 3762 300900 76819 0 3 0x80 nanoslp syz-executor.1 3762 286354 76819 0 3 0x4000080 fsleep syz-executor.1 3762 184085 76819 0 3 0x4000080 ttyout syz-executor.1 3762 503807 76819 0 3 0x4000080 fsleep syz-executor.1 76596 177556 51989 0 3 0x82 piperd syz-executor.6 96540 8059 51989 0 3 0x82 piperd syz-executor.7 28586 520851 51989 0 3 0x82 piperd syz-executor.3 38669 230512 0 0 3 0x14280 nfsidl nfsio 52905 32566 0 0 3 0x14280 nfsidl nfsio 69177 82060 0 0 3 0x14280 nfsidl nfsio 12683 253590 0 0 3 0x14280 nfsidl nfsio 13059 327433 0 0 3 0x14280 nfsidl nfsio 82327 307328 0 0 3 0x14280 nfsidl nfsio 92727 251527 0 0 3 0x14280 nfsidl nfsio 65363 80518 0 0 3 0x14280 nfsidl nfsio 65832 381147 0 0 3 0x14280 nfsidl nfsio 8475 255357 0 0 3 0x14280 nfsidl nfsio 79540 133012 0 0 3 0x14280 nfsidl nfsio 50474 338486 0 0 3 0x14280 nfsidl nfsio 66143 338064 0 0 3 0x14280 nfsidl nfsio 22652 283887 0 0 3 0x14280 nfsidl nfsio 22353 200922 0 0 3 0x14280 nfsidl nfsio 95670 108565 0 0 3 0x14280 nfsidl nfsio 32916 53672 0 0 3 0x14280 nfsidl nfsio 46922 6880 0 0 3 0x14280 nfsidl nfsio 40605 429911 0 0 3 0x14280 nfsidl nfsio 31817 325580 0 0 3 0x14280 nfsidl nfsio 48343 374161 51989 0 3 0x82 piperd syz-executor.5 55134 151279 0 0 3 0x14200 acct acct 22034 296556 51989 0 3 0x82 piperd syz-executor.2 32495 260054 1 0 3 0x100083 ttyin getty 59612 90497 51989 0 3 0x82 piperd syz-executor.4 76819 117564 51989 0 3 0x82 nanoslp syz-executor.1 21251 227263 0 0 3 0x14200 bored sosplice 51989 300554 17006 0 3 0x82 thrsleep syz-fuzzer 51989 384527 17006 0 2 0x4000482 syz-fuzzer 51989 25673 17006 0 3 0x4000082 wait syz-fuzzer 51989 24718 17006 0 3 0x4000082 wait syz-fuzzer 51989 274367 17006 0 3 0x4000082 thrsleep syz-fuzzer 51989 126491 17006 0 3 0x4000082 wait syz-fuzzer 51989 234807 17006 0 3 0x4000082 kqread syz-fuzzer 51989 415465 17006 0 3 0x4000082 wait syz-fuzzer 51989 345144 17006 0 3 0x4000082 thrsleep syz-fuzzer 51989 517507 17006 0 3 0x4000082 thrsleep syz-fuzzer 51989 500832 17006 0 3 0x4000082 thrsleep syz-fuzzer 51989 144932 17006 0 3 0x4000082 wait syz-fuzzer 51989 81205 17006 0 3 0x4000082 wait syz-fuzzer 51989 5 17006 0 3 0x4000082 thrsleep syz-fuzzer 51989 289045 17006 0 3 0x4000082 thrsleep syz-fuzzer 51989 18860 17006 0 3 0x4000082 wait syz-fuzzer 51989 106596 17006 0 3 0x4000082 wait syz-fuzzer 17006 25440 32689 0 3 0x10008a sigsusp ksh 32689 286632 55279 0 3 0x9a kqread sshd 55279 109109 1 0 3 0x88 kqread sshd 19203 130073 91115 74 3 0x1100092 bpf pflogd 91115 209679 1 0 3 0x80 netio pflogd 25705 249582 36643 73 3 0x1100090 kqread syslogd 36643 368128 1 0 3 0x100082 netio syslogd 87644 81070 1 0 3 0x100080 kqread resolvd 37353 123661 17028 77 2 0x100092 dhcpleased 62374 414795 17028 77 3 0x100092 kqread dhcpleased 17028 399044 1 0 3 0x80 kqread dhcpleased 65289 74297 0 0 3 0x14200 bored smr 672 114952 0 0 2 0x14200 zerothread 7073 294814 0 0 3 0x14200 aiodoned aiodoned 67226 456145 0 0 3 0x14200 syncer update 3499 122436 0 0 3 0x14200 cleaner cleaner 39369 398888 0 0 3 0x14200 reaper reaper 84663 178209 0 0 3 0x14200 pgdaemon pagedaemon 76628 330442 0 0 3 0x14200 bored viomb 31787 338375 0 0 3 0x40014200 acpi0 acpi0 87610 512704 0 0 7 0x40014200 idle1 75728 306836 0 0 3 0x14200 bored softnet 6238 517295 0 0 3 0x14200 bored softnet 56595 80045 0 0 3 0x14200 bored softnet 46578 518386 0 0 3 0x14200 bored softnet 73788 396691 0 0 3 0x14200 bored systqmp 79478 6083 0 0 3 0x14200 bored systq 10211 514930 0 0 2 0x40014200 softclock 18319 42228 0 0 3 0x40014200 idle0 1 267199 0 0 3 0x80082 wait init 0 0 -1 0 3 0x10200 scheduler swapper ddb{0}> show all locks ddb{0}> show malloc Type InUse MemUse HighUse Limit Requests Type Lim devbuf 10276 6515K 14710K 78643K 59042 0 pcb 13 20K 24K 78643K 3726 0 rtable 195 17K 19K 78643K 4534 0 ifaddr 81 28K 33K 78643K 2173 0 sysctl 3 1K 5K 78643K 12 0 counters 58 35K 36K 78643K 1500 0 ioctlops 0 0K 4K 78643K 3549 0 iov 0 0K 44K 78643K 2425 0 mount 1 1K 1K 78643K 1 0 log 0 0K 0K 78643K 4 0 vnodes 1673 105K 105K 78643K 17942 0 UFS quota 1 32K 32K 78643K 1 0 UFS mount 5 36K 36K 78643K 5 0 shm 2 1K 9K 78643K 171 0 VM map 2 1K 1K 78643K 2 0 sem 24 10K 20K 78643K 1349 0 dirhash 12 2K 2K 78643K 12 0 ACPI 1697 195K 286K 78643K 12548 0 file desc 13 45K 85K 78643K 22618 0 sigio 0 0K 0K 78643K 573 0 proc 84 104K 127K 78643K 3756 0 subproc 104 6K 7K 78643K 1236 0 NFS srvsock 1 0K 0K 78643K 1 0 NFS daemon 1 16K 16K 78643K 1 0 ip_moptions 0 0K 0K 78643K 1428 0 in_multi 67 4K 7K 78643K 1546 0 ether_multi 1 0K 0K 78643K 106 0 mrt 1 0K 0K 78643K 83 0 ISOFS mount 1 32K 32K 78643K 1 0 MSDOSFS mount 1 16K 16K 78643K 1 0 ttys 379 1685K 1685K 78643K 379 0 exec 0 0K 1K 78643K 3503 0 pfkey data 0 0K 0K 78643K 71 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 454 95K 108K 78643K 152109 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 731 0 NDP 15 0K 1K 78643K 704 0 temp 141 5778K 6808K 78643K 178202 0 kqueue 12 18K 26K 78643K 1624 0 SYN cache 2 2352K 2360K 78643K 3 0 ddb{0}> show all pools Name Size Requests Fail Releases Pgreq Pgrel Npage Hiwat Minpg Maxpg Idle plcache 128 22 0 0 1 0 1 1 0 8 0 rtpcb 120 1697 0 1694 26 23 3 5 0 8 2 rtentry 112 1493 0 1417 8 5 3 4 0 8 0 unpcb 144 83336 0 83321 306 300 6 15 0 8 5 syncache 296 194 0 194 24 24 0 1 0 8 0 tcpqe 32 121 310 121 8 8 0 1 0 8 0 tcpcb 776 9911 0 9899 279 277 2 18 0 8 0 arp 120 241 0 228 1 0 1 1 0 8 0 inpcb 368 23592 0 23576 360 358 2 22 0 8 0 nd6 48 325 0 306 1 0 1 1 0 8 0 pkpcb 40 39 0 39 13 13 0 1 0 8 0 kcovpl 48 94 0 86 1 0 1 1 0 8 0 mppekey 1024 34 0 34 13 13 0 1 0 8 0 ppxss 1256 395 0 395 50 50 0 1 0 8 0 pppxif 1456 173 0 173 33 33 0 1 0 8 0 pfstscr 40 75 0 75 2 2 0 1 0 8 0 pffrag 232 39 0 39 11 11 0 1 0 482 0 pffrnode 88 39 0 39 11 11 0 1 0 8 0 pffrent 40 147 0 147 14 14 0 1 0 8 0 pfosfp 40 1428 0 1005 5 0 5 5 0 8 0 pfosfpen 112 1428 0 714 21 0 21 21 0 8 0 pfanchor 1280 259 0 68 22 5 17 22 0 8 0 pfqueue 264 3 0 3 1 1 0 1 0 8 0 pfstitem 24 58 0 56 1 0 1 1 0 8 0 pfstkey 128 202 0 198 2 1 1 2 0 8 0 pfstate 384 128 0 126 4 3 1 4 0 8 0 pfrule 1344 21 0 20 2 1 1 2 0 8 0 rttmr 136 11 0 11 3 3 0 1 0 8 0 art_heap8 4096 5 0 4 5 4 1 2 0 8 0 art_heap4 256 6505 0 6190 86 65 21 30 0 8 0 art_table 32 6510 0 6194 5 1 4 4 0 8 0 art_node 16 1475 0 1411 1 0 1 1 0 8 0 sysvmsgpl 40 15 0 5 1 0 1 1 0 8 0 semupl 112 4 0 4 1 1 0 1 0 8 0 semapl 112 1332 0 1310 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 32066 0 30549 96 0 96 96 0 8 0 ffsino 272 32066 0 30549 102 0 102 102 0 8 0 nchpl 144 63584 0 61938 63 0 63 63 0 8 0 rtmask 32 19 0 19 7 7 0 1 0 8 0 uvmvnodes 80 7423 0 0 152 0 152 152 0 8 0 vnodes 216 7423 0 0 413 0 413 413 0 8 0 namei 1024 219097 0 219097 8 7 1 2 0 8 1 percpumem 16 763 0 721 1 0 1 1 0 8 0 vmpool 696 173 0 173 10 10 0 1 0 8 0 kstatmem 264 998 0 968 5 2 3 3 0 8 0 scsiplug 72 10 0 10 4 4 0 1 0 8 0 scxspl 216 195966 0 195966 34 33 1 8 0 8 1 plimitpl 152 2705 0 2688 1 0 1 1 0 8 0 sigapl 424 22819 0 22754 12 4 8 8 0 8 0 futexpl 64 227622 0 227620 7 6 1 1 0 8 0 knotepl 120 1627 0 0 15 1 14 15 0 8 0 kqueuepl 216 3725 0 3717 57 56 1 8 0 8 0 pipepl 320 21080 0 21052 259 252 7 13 0 8 4 fdescpl 496 22739 0 22713 8 4 4 5 0 8 0 filepl 152 235945 0 235703 398 379 19 26 0 8 8 lockfpl 104 5123 0 5121 10 9 1 4 0 8 0 lockfspl 48 1782 0 1780 1 0 1 1 0 8 0 sessionpl 144 117 0 100 1 0 1 1 0 8 0 pgrppl 48 355 0 338 1 0 1 1 0 8 0 ucredpl 104 16392 0 16380 1 0 1 1 0 8 0 zombiepl 144 22754 0 22754 2 1 1 1 0 8 1 processpl 1072 22819 0 22754 5 0 5 5 0 8 0 procpl 696 60416 0 60332 40 30 10 10 0 8 1 srpgc 96 139 0 139 37 37 0 1 0 8 0 sosppl 168 223 0 222 21 20 1 1 0 8 0 sockpl 488 108805 0 108771 2292 2271 21 52 0 8 15 mcl64k 65536 18 0 0 3 0 3 3 0 8 0 mcl16k 16384 17 0 0 3 0 3 3 0 8 0 mcl12k 12288 41 0 0 2 0 2 2 0 8 0 mcl9k 9216 17 0 0 2 0 2 2 0 8 0 mcl8k 8192 33 0 0 5 2 3 3 0 8 0 mcl4k 4096 45 0 0 5 2 3 4 0 8 0 mcl2k2 2112 11 0 0 1 0 1 1 0 8 0 mcl2k 2048 677 0 0 62 34 28 62 0 8 0 mtagpl 96 1552 0 0 20 2 18 18 0 8 0 mbufpl 256 2973 0 0 120 0 120 120 0 8 0 bufpl 288 37175 0 29750 531 0 531 531 0 8 0 anonpl 24 4585361 0 4569243 503 342 161 191 0 186 30 amapchunkpl 152 450203 0 449464 215 179 36 64 0 158 0 amappl16 200 39036 0 38437 235 202 33 45 0 8 0 amappl15 192 14 0 13 1 0 1 1 0 8 0 amappl14 184 486 0 468 10 9 1 2 0 8 0 amappl13 176 13 0 12 1 0 1 1 0 8 0 amappl12 168 1536 0 1529 1 0 1 1 0 8 0 amappl11 160 56 0 42 1 0 1 1 0 8 0 amappl10 152 132 0 118 1 0 1 1 0 8 0 amappl9 144 1051 0 1051 5 5 0 1 0 8 0 amappl8 136 1195 0 1001 7 0 7 7 0 8 0 amappl7 128 395 0 365 2 0 2 2 0 8 0 amappl6 120 667 0 650 2 1 1 2 0 8 0 amappl5 112 807 0 797 1 0 1 1 0 8 0 amappl4 104 1574 0 1534 2 0 2 2 0 8 0 amappl3 96 67060 0 67009 2 0 2 2 0 8 0 amappl2 88 24479 0 24393 8 5 3 4 0 8 0 amappl1 80 517009 0 516290 30 11 19 28 0 8 0 amappl 88 150175 0 149968 7 1 6 6 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 22912 0 22886 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 22912 0 22886 1 0 1 1 0 8 0 vmmpekpl 168 236888 0 236825 4 0 4 4 0 8 0 vmmpepl 168 2090768 0 2088001 452 286 166 178 0 357 11 vmsppl 440 22911 0 22886 5 1 4 4 0 8 0 rwobjpl 56 543818 0 534327 159 23 136 136 0 8 0 pdppl 4096 45831 0 45772 1313 1246 67 79 0 8 8 pvpl 32 8984000 0 8962166 931 638 293 339 0 265 68 pmappl 248 22911 0 22886 3 0 3 3 0 8 0 extentpl 40 56 0 38 1 0 1 1 0 8 0 phpool 112 2768 0 1783 29 0 29 29 0 8 0 ddb{0}> machine ddbcpu 0 Invalid cpu 0 ddb{0}> trace db_enter() at db_enter+0x18 sys/arch/amd64/amd64/db_interface.c:437 panic(ffffffff82751deb) at panic+0x177 sys/kern/subr_prf.c:198 __assert(ffffffff827cd2be,ffffffff82818b32,13b,ffffffff827e01fc) at __assert+0x25 sys/kern/subr_prf.c:157 tun_clone_destroy(ffff800000df4000) at tun_clone_destroy+0x278 sys/net/if_tun.c:315 if_clone_destroy(ffff80002e563080) at if_clone_destroy+0x132 sys/net/if.c:1247 ifioctl(fffffd8061ea93d8,80206979,ffff80002e563080,ffff8000212096f8) at ifioctl+0x3b4 sys/net/if.c:1924 sys_ioctl(ffff8000212096f8,ffff80002e563190,ffff80002e5631e0) at sys_ioctl+0x4a2 syscall(ffff80002e563260) at syscall+0x606 mi_syscall sys/sys/syscall_mi.h:110 [inline] syscall(ffff80002e563260) at syscall+0x606 sys/arch/amd64/amd64/trap.c:625 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x7f7fffffbc80, count: -9 ddb{0}> machine ddbcpu 1 Stopped at x86_ipi_db+0x1a: addq $0x8,%rsp x86_ipi_db(ffff800020d68ff0) at x86_ipi_db+0x1a sys/arch/amd64/amd64/db_interface.c:393 x86_ipi_handler() at x86_ipi_handler+0xb7 sys/arch/amd64/amd64/ipi.c:106 Xresume_lapic_ipi() at Xresume_lapic_ipi+0x23 acpicpu_idle() at acpicpu_idle+0x312 sys/dev/acpi/acpicpu.c:1206 sched_idle(ffff800020d68ff0) at sched_idle+0x417 sys/kern/kern_sched.c:175 end trace frame: 0x0, count: 10 ddb{1}> trace x86_ipi_db(ffff800020d68ff0) at x86_ipi_db+0x1a sys/arch/amd64/amd64/db_interface.c:393 x86_ipi_handler() at x86_ipi_handler+0xb7 sys/arch/amd64/amd64/ipi.c:106 Xresume_lapic_ipi() at Xresume_lapic_ipi+0x23 acpicpu_idle() at acpicpu_idle+0x312 sys/dev/acpi/acpicpu.c:1206 sched_idle(ffff800020d68ff0) at sched_idle+0x417 sys/kern/kern_sched.c:175 end trace frame: 0x0, count: -5