panic: kernel diagnostic assertion "sc->sc_dev == 0" failed: file "/syzkaller/managers/multicore/kernel/sys/net/if_tun.c", line 322 Stopped at db_enter+0x25: addq $0x8,%rsp TID PID UID PRFLAGS PFLAGS CPU COMMAND *418337 47504 0 0x2 0 0K ifconfig db_enter() at db_enter+0x25 sys/arch/amd64/amd64/db_interface.c:438 panic(ffffffff83455a6c) at panic+0x1e5 sys/kern/subr_prf.c:198 __assert(ffffffff8340267d,ffffffff833d8362,142,ffffffff833e1e36) at __assert+0x29 sys/kern/subr_prf.c:-1 tun_clone_destroy(ffff80000148d800) at tun_clone_destroy+0x38a sys/net/if_tun.c:322 if_clone_destroy(ffff80003c41bdd0) at if_clone_destroy+0x1d7 sys/net/if.c:1387 ifioctl(ffff800010fe0010,80206979,ffff80003c41bdd0,ffff8000ffff07d8) at ifioctl+0x5c5 sys/net/if.c:-1 sys_ioctl(ffff8000ffff07d8,ffff80003c41bfb0,ffff80003c41bf00) at sys_ioctl+0x5c3 sys/kern/sys_generic.c:-1 syscall(ffff80003c41bfb0) at syscall+0xbc6 mi_syscall sys/sys/syscall_mi.h:176 [inline] syscall(ffff80003c41bfb0) at syscall+0xbc6 sys/arch/amd64/amd64/trap.c:577 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x7047b3eafb50, 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 322 ddb{0}> trace db_enter() at db_enter+0x25 sys/arch/amd64/amd64/db_interface.c:438 panic(ffffffff83455a6c) at panic+0x1e5 sys/kern/subr_prf.c:198 __assert(ffffffff8340267d,ffffffff833d8362,142,ffffffff833e1e36) at __assert+0x29 sys/kern/subr_prf.c:-1 tun_clone_destroy(ffff80000148d800) at tun_clone_destroy+0x38a sys/net/if_tun.c:322 if_clone_destroy(ffff80003c41bdd0) at if_clone_destroy+0x1d7 sys/net/if.c:1387 ifioctl(ffff800010fe0010,80206979,ffff80003c41bdd0,ffff8000ffff07d8) at ifioctl+0x5c5 sys/net/if.c:-1 sys_ioctl(ffff8000ffff07d8,ffff80003c41bfb0,ffff80003c41bf00) at sys_ioctl+0x5c3 sys/kern/sys_generic.c:-1 syscall(ffff80003c41bfb0) at syscall+0xbc6 mi_syscall sys/sys/syscall_mi.h:176 [inline] syscall(ffff80003c41bfb0) at syscall+0xbc6 sys/arch/amd64/amd64/trap.c:577 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x7047b3eafb50, count: -9 ddb{0}> show registers rdi 0 rsi 0x1 rbp 0xffff80003c41bb80 rbx 0xffffffff83829dcf cpu_info_full_primary+0x2dcf rdx 0 rcx 0xffff8000ffff07d8 rax 0xffffffff83828ff0 cpu_info_full_primary+0x1ff0 r8 0 r9 0x8080808080808080 r10 0x1d0ad9b7cd3224f1 r11 0x74b06cae065dc1d1 r12 0xffffffff83829bd0 cpu_info_full_primary+0x2bd0 r13 0 r14 0 r15 0x1 rip 0xffffffff8224c1f5 db_enter+0x25 cs 0x8 rflags 0x246 rsp 0xffff80003c41bb70 ss 0x10 db_enter+0x25: addq $0x8,%rsp ddb{0}> show proc PROC (ifconfig) tid=418337 pid=47504 tcnt=1 stat=onproc flags process=2 proc=0 runpri=50, usrpri=50, slppri=17, nice=20 wchan=0x0, wmesg=, ps_single=0x0 scnt=0 ecnt=0 forw=0xffffffffffffffff, list=0xffff80002a281c50,0xffffffff8397b330 process=0xffff8000fffe8e18 user=0xffff80003c417000, vmspace=0xfffffd806ebf8008 estcpu=36, cpticks=1, pctcpu=0.0, user=0, sys=1, intr=0 ddb{0}> ps PID TID PPID UID S FLAGS WAIT COMMAND *47504 418337 36301 0 7 0x2 ifconfig 36301 331252 67525 0 3 0x10008a sigsusp sh 65850 511902 42911 0 2 0 syz-executor 65850 278565 42911 0 3 0x4000080 fsleep syz-executor 55379 470054 74508 0 2 0 syz-executor 55379 139995 74508 0 2 0x4000000 syz-executor 76005 229085 99237 0 2 0 syz-executor 67525 249116 29576 0 3 0x82 wait syz-executor 84537 108680 73604 0 2 0x10 syz-executor 84537 285110 73604 0 2 0x4000010 syz-executor 5526 214408 9996 0 2 0 syz-executor 5526 482347 9996 0 3 0x4000080 bell syz-executor 5526 373803 9996 0 3 0x4000080 fsleep syz-executor 49420 370913 6210 0 2 0x10 syz-executor 49420 27728 6210 0 3 0x4000090 fsleep syz-executor 30982 311011 94506 60929 2 0x10 syz-executor 30982 392819 94506 60929 3 0x4000090 fsleep syz-executor 22619 329065 1 0 3 0x100083 ttyin getty 53989 328071 0 0 3 0x14200 bored sosplice 42911 388965 29576 0 3 0x82 nanoslp syz-executor 74508 38389 29576 0 2 0x2 syz-executor 9996 81631 29576 0 2 0x482 syz-executor 94506 487028 29576 0 2 0x482 syz-executor 99237 234620 29576 0 2 0x2 syz-executor 73604 348448 29576 0 2 0x482 syz-executor 6210 184487 29576 0 2 0x482 syz-executor 29576 180567 15842 0 3 0x82 kqread syz-executor 15842 288056 29685 0 3 0x10008a sigsusp ksh 29685 425373 79842 0 3 0x98 kqread sshd-session 79842 367370 13515 0 3 0x92 kqread sshd-session 13515 275593 1 0 3 0x88 kqread sshd 91672 215984 84711 74 3 0x1100092 bpf pflogd 84711 448214 1 0 3 0x80 sbwait pflogd 40143 82412 28092 73 3 0x1100090 kqread syslogd 28092 206204 1 0 3 0x100082 sbwait syslogd 3466 332615 1 0 3 0x100080 kqread resolvd 11193 413344 33037 77 2 0x100092 dhcpleased 8324 497614 33037 77 3 0x100092 kqread dhcpleased 33037 260380 1 0 3 0x80 kqread dhcpleased 53322 307541 0 0 3 0x14200 bored smr 13342 318461 0 0 2 0x14200 zerothread 9174 369613 0 0 3 0x14200 aiodoned aiodoned 80616 391436 0 0 3 0x14200 syncer update 38084 392567 0 0 3 0x14200 cleaner cleaner 82814 509418 0 0 3 0x14200 reaper reaper 20820 395676 0 0 3 0x14200 pgdaemon pagedaemon 24990 166897 0 0 3 0x14200 bored viomb 95214 143287 0 0 3 0x40014200 acpi0 acpi0 37046 375557 0 0 7 0x40014200 idle1 79950 149369 0 0 3 0x14200 bored softnet3 42608 146653 0 0 3 0x14200 bored softnet2 89374 257503 0 0 3 0x14200 bored softnet1 42335 120801 0 0 3 0x14200 bored softnet0 91432 484964 0 0 3 0x14200 bored systqmp 8091 14367 0 0 3 0x14200 bored systq 13135 421875 0 0 3 0x14200 tmoslp softclockmp 94112 431326 0 0 2 0x40014200 softclock 8438 175799 0 0 3 0x40014200 idle0 1 243109 0 0 3 0x82 wait init 0 0 -1 0 3 0x10200 scheduler swapper ddb{0}> show all locks Process 47504 (ifconfig) thread 0xffff8000ffff07d8 (418337) ddb{0}> show malloc Type InUse MemUse HighUse Limit Requests Type Lim devbuf 10224 11043K 12505K 166960K 11961 0 pcb 17 14K 16K 166960K 141 0 rtable 206 7K 7K 166960K 393 0 pf 33 17K 21K 166960K 74 0 ifaddr 36 6K 7K 166960K 56 0 ifgroup 51 2K 2K 166960K 88 0 sysctl 3 1K 1K 166960K 3 0 counters 62 36K 36K 166960K 82 0 ioctlops 0 0K 4K 166960K 1508 0 iov 0 0K 12K 166960K 16 0 mount 1 1K 1K 166960K 1 0 log 0 0K 0K 166960K 4 0 vnodes 1403 88K 89K 166960K 1665 0 UFS quota 1 32K 32K 166960K 1 0 UFS mount 5 36K 36K 166960K 5 0 shm 2 1K 9K 166960K 5 0 VM map 2 1K 1K 166960K 2 0 sem 11 0K 0K 166960K 12 0 dirhash 12 2K 2K 166960K 15 0 ACPI 1692 195K 286K 166960K 12470 0 file desc 19 69K 97K 166960K 445 0 sigio 0 0K 0K 166960K 3 0 proc 79 103K 128K 166960K 578 0 subproc 72 4K 4K 166960K 81 0 NFS srvsock 1 0K 0K 166960K 1 0 NFS daemon 1 16K 16K 166960K 1 0 ip_moptions 0 0K 0K 166960K 55 0 in_multi 77 5K 7K 166960K 109 0 ether_multi 1 0K 0K 166960K 4 0 mrt 0 0K 0K 166960K 2 0 ISOFS mount 1 32K 32K 166960K 1 0 MSDOSFS mount 1 16K 16K 166960K 1 0 ttys 247 1102K 1102K 166960K 247 0 exec 0 0K 1K 166960K 400 0 fusefs mount 1 32K 32K 166960K 1 0 pfkey data 0 0K 0K 166960K 1 0 tdb 3 0K 0K 166960K 3 0 VM swap 8 62K 64K 166960K 10 0 UVM amap 236 176K 188K 166960K 5754 0 UVM aobj 15 2K 2K 166960K 16 0 pinsyscall 44 88K 105K 166960K 1546 0 memdesc 1 4K 4K 166960K 1 0 crypto data 1 1K 1K 166960K 1 0 ip6_options 0 0K 0K 166960K 29 0 NDP 11 0K 2K 166960K 36 0 temp 75 8691K 8755K 166960K 13171 0 kqueue 13 20K 28K 166960K 81 0 SYN cache 2 16K 16K 166960K 2 0 ddb{0}> show all pools Name Size Requests Fail Releases Pgreq Pgrel Npage Hiwat Minpg Maxpg Idle plcache 128 26 0 0 1 0 1 1 0 8 0 rtpcb 120 62 0 57 1 0 1 1 0 8 0 rtentry 176 116 0 24 6 0 6 6 0 8 0 unpcb 144 318 0 296 1 0 1 1 0 8 0 syncache 336 4 0 4 1 1 0 1 0 8 0 tcpqe 32 1 0 1 1 1 0 1 0 8 0 tcpcb 808 91 0 85 2 0 2 2 0 8 0 arp 128 18 0 4 1 0 1 1 0 8 0 inpcb 384 383 0 372 9 7 2 9 0 8 0 nd6 144 27 0 6 1 0 1 1 0 8 0 pkpcb 40 4 0 4 1 1 0 1 0 8 0 kcovpl 48 9 0 1 1 0 1 1 0 8 0 mppekey 1024 1 0 1 1 1 0 1 0 8 0 ppxss 1192 2 0 2 1 1 0 1 0 8 0 pppxif 1504 1 0 1 1 1 0 1 0 8 0 pffrag 232 4 0 1 1 0 1 1 0 482 0 pffrnode 88 3 0 1 1 0 1 1 0 8 0 pffrent 40 5 0 2 1 0 1 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 1288 1 0 0 1 0 1 1 0 8 0 pftag 88 2 0 2 1 1 0 1 0 8 0 pfstitem 24 38 0 3 1 0 1 1 0 8 0 pfstkey 128 38 0 3 2 0 2 2 0 8 0 pfstate 384 38 0 3 4 0 4 4 0 8 0 pfrule 1344 24 0 19 2 1 1 2 0 8 0 art_heap8 4096 2 0 0 2 0 2 2 0 8 0 art_heap4 256 464 0 94 29 4 25 29 0 8 0 art_table 32 466 0 94 4 0 4 4 0 8 0 art_node 16 115 0 31 1 0 1 1 0 8 0 sysvmsgpl 40 1 0 0 1 0 1 1 0 8 0 semapl 112 10 0 1 1 0 1 1 0 8 0 shmpl 112 13 0 1 1 0 1 1 0 8 0 dirhash 1024 19 0 2 3 0 3 3 0 8 0 dino2pl 256 2107 0 601 95 0 95 95 0 8 0 ffsino 288 2107 0 601 109 0 109 109 0 8 0 nchpl 144 2759 0 1069 64 1 63 64 0 8 0 uvmvnodes 80 2398 0 0 49 0 49 49 0 8 0 vnodes 216 2398 0 0 134 0 134 134 0 8 0 namei 1024 9065 0 9065 3 2 1 2 0 8 1 percpumem 16 56 0 10 1 0 1 1 0 8 0 kstatmem 264 40 0 18 2 0 2 2 0 8 0 scxspl 216 8414 0 8414 3 2 1 2 1 8 1 plimitpl 152 128 0 109 1 0 1 1 0 8 0 sigapl 424 747 0 695 8 2 6 7 0 8 0 futexpl 64 4985 0 4981 1 0 1 1 0 8 0 knotepl 120 534 0 0 17 0 17 17 0 8 0 kqueuepl 224 110 0 101 1 0 1 1 0 8 0 pipepl 336 131 0 104 3 0 3 3 0 8 0 fdescpl 520 728 0 695 3 0 3 3 0 8 0 filepl 160 3765 0 3537 18 8 10 18 0 8 0 lockfpl 104 93 0 90 1 0 1 1 0 8 0 lockfspl 48 45 0 42 1 0 1 1 0 8 0 sessionpl 144 25 0 16 1 0 1 1 0 8 0 pgrppl 48 37 0 20 1 0 1 1 0 8 0 ucredpl 104 423 0 407 1 0 1 1 0 8 0 zombiepl 144 695 0 695 2 1 1 1 0 8 1 processpl 1192 747 0 695 5 0 5 5 0 8 0 procpl 656 1232 0 1173 7 1 6 6 0 8 0 srpgc 96 4 0 4 2 2 0 1 0 8 0 sosppl 168 1 0 1 1 1 0 1 0 8 0 sockpl 728 804 0 766 10 6 4 10 0 8 0 mcl64k 65536 3 0 0 1 0 1 1 0 8 0 mcl8k 8192 1 0 0 1 0 1 1 0 8 0 mcl4k 4096 127 0 0 16 0 16 16 0 8 0 mcl2k2 2112 1 0 0 1 0 1 1 0 8 0 mcl2k 2048 26 0 0 4 0 4 4 0 8 0 mtagpl 96 44 0 0 2 0 2 2 0 8 0 mbufpl 256 191 0 0 12 0 12 12 0 8 0 bufpl 280 3889 0 124 269 0 269 269 0 8 0 anonpl 32 9616 0 0 78 0 78 78 0 246 0 amapchunkpl 152 17786 0 17318 27 8 19 27 0 158 0 amappl16 200 2580 0 2553 23 20 3 15 0 8 0 amappl15 192 6 0 6 2 2 0 1 0 8 0 amappl14 184 135 0 123 1 0 1 1 0 8 0 amappl13 176 4 0 4 1 1 0 1 0 8 0 amappl12 168 1376 0 1344 4 2 2 3 0 8 0 amappl11 160 51 0 37 1 0 1 1 0 8 0 amappl10 152 22 0 22 1 1 0 1 0 8 0 amappl9 144 247 0 247 1 1 0 1 0 8 0 amappl8 136 26 0 23 1 0 1 1 0 8 0 amappl7 128 110 0 98 1 0 1 1 0 8 0 amappl6 120 189 0 184 1 0 1 1 0 8 0 amappl5 112 125 0 115 1 0 1 1 0 8 0 amappl4 104 332 0 311 1 0 1 1 0 8 0 amappl3 96 3319 0 3211 5 2 3 4 0 8 0 amappl2 88 642 0 579 2 0 2 2 0 8 0 amappl1 80 9789 0 9181 16 2 14 15 0 8 0 amappl 88 4997 0 4837 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 15 0 1 1 0 1 1 0 8 0 uaddrrnd 24 728 0 695 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 728 0 695 1 0 1 1 0 8 0 vmmpekpl 168 7458 0 7418 3 0 3 3 0 8 0 vmmpepl 168 52035 0 50046 106 16 90 106 0 357 1 vmsppl 480 727 0 695 5 0 5 5 0 8 0 rwobjpl 72 18859 0 15509 63 2 61 63 0 8 0 pdppl 4096 1463 0 1390 111 38 73 87 0 8 0 pvpl 32 15992 0 0 129 0 129 129 0 265 0 pmappl 256 727 0 695 3 0 3 3 0 8 0 extentpl 40 45 0 27 1 0 1 1 0 8 0 phpool 112 399 0 48 11 0 11 11 0 8 0 ddb{0}> machine ddbcpu 0 Invalid cpu 0 ddb{0}> trace db_enter() at db_enter+0x25 sys/arch/amd64/amd64/db_interface.c:438 panic(ffffffff83455a6c) at panic+0x1e5 sys/kern/subr_prf.c:198 __assert(ffffffff8340267d,ffffffff833d8362,142,ffffffff833e1e36) at __assert+0x29 sys/kern/subr_prf.c:-1 tun_clone_destroy(ffff80000148d800) at tun_clone_destroy+0x38a sys/net/if_tun.c:322 if_clone_destroy(ffff80003c41bdd0) at if_clone_destroy+0x1d7 sys/net/if.c:1387 ifioctl(ffff800010fe0010,80206979,ffff80003c41bdd0,ffff8000ffff07d8) at ifioctl+0x5c5 sys/net/if.c:-1 sys_ioctl(ffff8000ffff07d8,ffff80003c41bfb0,ffff80003c41bf00) at sys_ioctl+0x5c3 sys/kern/sys_generic.c:-1 syscall(ffff80003c41bfb0) at syscall+0xbc6 mi_syscall sys/sys/syscall_mi.h:176 [inline] syscall(ffff80003c41bfb0) at syscall+0xbc6 sys/arch/amd64/amd64/trap.c:577 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x7047b3eafb50, count: -9 ddb{0}> machine ddbcpu 1 Stopped at x86_ipi_db+0x27: addq $0x8,%rsp x86_ipi_db(ffff8000299ddff0) at x86_ipi_db+0x27 sys/arch/amd64/amd64/db_interface.c:394 x86_ipi_handler() at x86_ipi_handler+0xd9 sys/arch/amd64/amd64/ipi.c:106 Xresume_lapic_ipi() at Xresume_lapic_ipi+0x27 acpicpu_idle() at acpicpu_idle+0x41e sys/dev/acpi/acpicpu.c:1218 sched_idle(ffff8000299ddff0) at sched_idle+0x558 sys/kern/kern_sched.c:182 end trace frame: 0x0, count: 10 ddb{1}> trace x86_ipi_db(ffff8000299ddff0) at x86_ipi_db+0x27 sys/arch/amd64/amd64/db_interface.c:394 x86_ipi_handler() at x86_ipi_handler+0xd9 sys/arch/amd64/amd64/ipi.c:106 Xresume_lapic_ipi() at Xresume_lapic_ipi+0x27 acpicpu_idle() at acpicpu_idle+0x41e sys/dev/acpi/acpicpu.c:1218 sched_idle(ffff8000299ddff0) at sched_idle+0x558 sys/kern/kern_sched.c:182 end trace frame: 0x0, count: -5