panic: kernel diagnostic assertion "sc->sc_dev == 0" failed: file "/syzkaller/managers/multicore/kernel/sys/net/if_tun.c", line 323 Stopped at db_enter+0x25: addq $0x8,%rsp TID PID UID PRFLAGS PFLAGS CPU COMMAND 139297 37565 0 0 0 1 syz-executor *422519 54856 0 0x2 0 0K ifconfig db_enter() at db_enter+0x25 sys/arch/amd64/amd64/db_interface.c:438 panic(ffffffff833b1ba4) at panic+0x1e5 sys/kern/subr_prf.c:198 __assert(ffffffff833f0663,ffffffff83440e86,143,ffffffff83331f25) at __assert+0x29 sys/kern/subr_prf.c:-1 tun_clone_destroy(ffff80000159d800) at tun_clone_destroy+0x38a if_clone_destroy(ffff80002ebc3d70) at if_clone_destroy+0x205 sys/net/if.c:1478 ifioctl(ffff8000016fa438,80206979,ffff80002ebc3d70,ffff80003c42aa88) at ifioctl+0x59d sys/net/if.c:2159 sys_ioctl(ffff80003c42aa88,ffff80002ebc3f50,ffff80002ebc3ea0) at sys_ioctl+0x674 sys/kern/sys_generic.c:-1 syscall(ffff80002ebc3f50) at syscall+0xbd4 mi_syscall sys/sys/syscall_mi.h:176 [inline] syscall(ffff80002ebc3f50) at syscall+0xbd4 sys/arch/amd64/amd64/trap.c:775 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x777ddb137d30, 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 323 ddb{0}> trace db_enter() at db_enter+0x25 sys/arch/amd64/amd64/db_interface.c:438 panic(ffffffff833b1ba4) at panic+0x1e5 sys/kern/subr_prf.c:198 __assert(ffffffff833f0663,ffffffff83440e86,143,ffffffff83331f25) at __assert+0x29 sys/kern/subr_prf.c:-1 tun_clone_destroy(ffff80000159d800) at tun_clone_destroy+0x38a if_clone_destroy(ffff80002ebc3d70) at if_clone_destroy+0x205 sys/net/if.c:1478 ifioctl(ffff8000016fa438,80206979,ffff80002ebc3d70,ffff80003c42aa88) at ifioctl+0x59d sys/net/if.c:2159 sys_ioctl(ffff80003c42aa88,ffff80002ebc3f50,ffff80002ebc3ea0) at sys_ioctl+0x674 sys/kern/sys_generic.c:-1 syscall(ffff80002ebc3f50) at syscall+0xbd4 mi_syscall sys/sys/syscall_mi.h:176 [inline] syscall(ffff80002ebc3f50) at syscall+0xbd4 sys/arch/amd64/amd64/trap.c:775 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x777ddb137d30, count: -9 ddb{0}> show registers rdi 0 rsi 0x1 rbp 0xffff80002ebc3b20 rbx 0xffffffff837bfe07 cpu_info_full_primary+0x2e07 rdx 0 rcx 0xffff80003c42aa88 rax 0xffffffff837beff0 cpu_info_full_primary+0x1ff0 r8 0x101010101010101 r9 0x8080808080808080 r10 0x44a93c5ea2dacf6d r11 0xa6051508727601fd r12 0xffffffff837bfc08 cpu_info_full_primary+0x2c08 r13 0 r14 0 r15 0x1 rip 0xffffffff82e49265 db_enter+0x25 cs 0x8 rflags 0x246 rsp 0xffff80002ebc3b10 ss 0x10 db_enter+0x25: addq $0x8,%rsp ddb{0}> show proc PROC (ifconfig) tid=422519 pid=54856 tcnt=1 stat=onproc flags process=2 proc=0 runpri=86, usrpri=86, slppri=32, nice=20 wchan=0x0, wmesg=, ps_single=0x0 scnt=0 ecnt=0 forw=0xffffffffffffffff, list=0xffff80003c42a028,0xffff80003c42a568 process=0xffff80002a3a21d8 user=0xffff80002ebbf000, vmspace=0xfffffd806eb0e3e0 estcpu=36, cpticks=2, pctcpu=0.0, user=0, sys=2, intr=0 ddb{0}> ps PID TID PPID UID S FLAGS WAIT COMMAND 37565 139297 11260 0 7 0 syz-executor 29627 159641 71437 0 2 0 syz-executor 29627 417967 71437 0 3 0x4000080 fsleep syz-executor *54856 422519 75165 0 7 0x2 ifconfig 75165 19868 90227 0 3 0x10008a sigsusp sh 90227 348354 67592 0 3 0x82 wait syz-executor 63988 341715 87874 0 2 0x10 syz-executor 63988 37063 87874 0 3 0x4000090 fsleep syz-executor 65793 440847 88705 60929 2 0x10 syz-executor 65793 523393 88705 60929 3 0x4000090 fsleep syz-executor 65793 182600 88705 60929 3 0x4000090 fsleep syz-executor 22683 295040 1 0 3 0x100083 ttyopn getty 88705 139078 67592 0 3 0x82 nanoslp syz-executor 87874 205624 67592 0 3 0x82 nanoslp syz-executor 63338 510459 67592 0 3 0x82 nanoslp syz-executor 60514 292438 67592 0 2 0x2 syz-executor 11260 505056 67592 0 3 0x82 nanoslp syz-executor 2085 52608 67592 0 3 0x82 nanoslp syz-executor 71437 177747 67592 0 3 0x82 nanoslp syz-executor 67592 493158 26906 0 3 0x82 kqread syz-executor 26906 133033 53043 0 3 0x10008a sigsusp ksh 53043 422197 19003 0 3 0x98 kqread sshd-session 19003 507601 71981 0 3 0x92 kqread sshd-session 71981 223047 1 0 3 0x88 kqread sshd 23868 315066 13559 74 3 0x1100092 bpf pflogd 13559 111187 1 0 3 0x80 sbwait pflogd 7400 267038 95725 73 3 0x1100090 kqread syslogd 95725 427748 1 0 3 0x100082 sbwait syslogd 62422 281205 1 0 3 0x100080 kqread resolvd 59207 84017 2466 77 2 0x100092 dhcpleased 25379 380054 2466 77 3 0x100092 kqread dhcpleased 2466 103447 1 0 3 0x80 kqread dhcpleased 72091 500515 0 0 3 0x14200 bored smr 20386 506611 0 0 2 0x14200 zerothread 77995 473692 0 0 3 0x14200 aiodoned aiodoned 38007 68476 0 0 3 0x14200 syncer update 43215 54723 0 0 3 0x14200 cleaner cleaner 79212 47543 0 0 3 0x14200 reaper reaper 52005 24201 0 0 3 0x14200 pgdaemon pagedaemon 88451 191038 0 0 3 0x14200 bored viomb 40205 106331 0 0 3 0x40014200 acpi0 acpi0 39992 280421 0 0 3 0x40014200 idle1 9794 341207 0 0 3 0x14200 bored softnet1 67867 379242 0 0 2 0x14200 softnet0 82545 242201 0 0 3 0x14200 bored systqmp 54359 153559 0 0 3 0x14200 bored systq 72775 489947 0 0 3 0x14200 tmoslp softclockmp 9700 72322 0 0 3 0x40014200 tmoslp softclock 38666 714 0 0 3 0x40014200 idle0 1 315211 0 0 3 0x80082 wait init 0 0 -1 0 3 0x10010200 scheduler swapper ddb{0}> show all locks Process 54856 (ifconfig) thread 0xffff80003c42aa88 (422519) Process 60514 (syz-executor) thread 0xffff80002a281240 (292438) ddb{0}> show malloc Type InUse MemUse HighUse Limit Requests Type Lim devbuf 11100 12115K 13105K 166960K 14712 0 pcb 17 16K 17K 166960K 689 0 rtable 216 13K 14K 166960K 943 0 pf 35 17K 81K 166960K 293 0 ifaddr 35 6K 8K 166960K 197 0 ifgroup 51 2K 2K 166960K 341 0 sysctl 4 1K 9K 166960K 30 0 counters 68 36K 38K 166960K 340 0 ioctlops 0 0K 4K 166960K 2353 0 iov 0 0K 24K 166960K 288 0 mount 1 1K 1K 166960K 1 0 log 0 0K 0K 166960K 4 0 vnodes 1446 91K 92K 166960K 3518 0 UFS quota 1 32K 32K 166960K 1 0 UFS mount 5 36K 36K 166960K 5 0 shm 2 1K 5K 166960K 8 0 VM map 2 1K 1K 166960K 2 0 sem 12 0K 0K 166960K 167 0 dirhash 12 2K 2K 166960K 72 0 ACPI 1692 195K 286K 166960K 12470 0 file desc 18 65K 240K 166960K 2653 0 sigio 0 0K 0K 166960K 80 0 proc 79 131K 163K 166960K 1038 0 subproc 72 4K 4K 166960K 153 0 NFS srvsock 1 0K 0K 166960K 1 0 NFS daemon 1 16K 16K 166960K 1 0 ip_moptions 0 0K 0K 166960K 350 0 in_multi 66 4K 7K 166960K 326 0 ether_multi 1 0K 0K 166960K 39 0 mrt 1 0K 0K 166960K 19 0 ISOFS mount 1 32K 32K 166960K 1 0 MSDOSFS mount 1 16K 16K 166960K 1 0 ttys 241 1076K 1076K 166960K 241 0 exec 0 0K 1K 166960K 1274 0 fusefs mount 1 32K 32K 166960K 1 0 pfkey data 0 0K 0K 166960K 6 0 tdb 3 0K 0K 166960K 3 0 VM swap 8 62K 64K 166960K 10 0 UVM amap 239 160K 177K 166960K 25261 0 UVM aobj 14 22K 24K 166960K 17 0 pinsyscall 43 86K 103K 166960K 4029 0 memdesc 1 4K 4K 166960K 1 0 crypto data 1 1K 1K 166960K 1 0 ip6_options 0 0K 1K 166960K 348 0 NDP 11 0K 2K 166960K 138 0 temp 79 8688K 8764K 166960K 136205 0 kqueue 14 22K 36K 166960K 506 0 SYN cache 2 8K 16K 166960K 3 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 200 0 197 1 0 1 1 0 8 0 rtentry 176 282 0 204 6 1 5 6 0 8 0 unpcb 144 1769 0 1752 15 10 5 6 0 8 4 syncache 336 15 0 15 6 5 1 1 0 8 1 tcpqe 32 6 0 6 4 3 1 1 0 8 1 tcpcb 736 1012 0 1005 22 15 7 7 0 8 6 arp 136 40 0 27 1 0 1 1 0 8 0 inpcb 328 3560 0 3548 31 22 9 12 0 8 7 ip6q 72 1 0 1 1 1 0 1 0 8 0 ip6af 40 10 0 10 1 1 0 1 0 8 0 nd6 152 62 0 45 2 0 2 2 0 8 0 pkpcb 40 24 0 24 4 3 1 1 0 8 1 kcovpl 48 17 0 9 1 0 1 1 0 8 0 mppekey 1024 1 0 1 1 1 0 1 0 8 0 ppxss 1192 95 0 95 3 2 1 1 0 8 1 pppxif 1504 16 0 16 5 4 1 1 0 8 1 pffrag 232 24 0 14 1 0 1 1 0 482 0 pffrnode 88 23 0 14 1 0 1 1 0 8 0 pffrent 40 48 0 36 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 pfrktable 1344 4 0 2 1 0 1 1 0 8 0 pfanchor 1288 1 0 0 1 0 1 1 0 8 0 pfrule 1360 6 0 3 2 1 1 1 0 8 0 rttmr 136 4 0 4 4 4 0 1 0 8 0 art_heap8 4096 4 0 0 4 0 4 4 0 8 0 art_heap4 256 1325 0 976 40 13 27 31 0 8 3 art_table 40 1329 0 976 5 0 5 5 0 8 0 art_node 32 281 0 214 1 0 1 1 0 8 0 sysvmsgpl 40 8 0 3 1 0 1 1 0 8 0 semupl 112 2 0 2 2 2 0 1 0 8 0 semapl 112 163 0 153 1 0 1 1 0 8 0 shmpl 112 1 0 0 1 0 1 1 0 8 0 dirhash 1024 58 0 41 3 0 3 3 0 8 0 dino2pl 256 6481 0 4965 96 0 96 96 0 8 0 ffsino 296 6481 0 4965 118 0 118 118 0 8 0 nchpl 144 10090 0 8364 65 0 65 65 0 8 0 rtmask 32 21 0 21 4 3 1 1 0 8 1 vnodes 216 5926 0 0 330 0 330 330 0 8 0 namei 1024 36372 0 36372 3 1 2 2 0 8 2 percpumem 16 185 0 136 1 0 1 1 0 8 0 vcpupl 3968 11 0 1 2 0 2 2 0 8 0 vmpool 848 13 0 3 2 0 2 2 0 8 0 kstatmem 264 206 0 180 4 1 3 3 0 8 0 acpiwqpl 32 1 0 1 1 0 1 1 1 8 1 scsiplug 72 13 0 13 6 5 1 1 0 8 1 scxspl 216 91180 0 91180 13 10 3 8 1 8 3 plimitpl 152 675 0 657 1 0 1 1 0 8 0 sigapl 424 2934 0 2886 7 1 6 7 0 8 0 knotepl 120 621 0 0 17 0 17 17 0 8 0 kqueuepl 224 1170 0 1159 14 12 2 5 0 8 1 pipepl 344 395 0 368 6 3 3 6 0 8 0 fdescpl 528 2905 0 2873 3 0 3 3 0 8 0 filepl 160 20982 0 20761 36 17 19 22 0 8 5 lockfpl 104 1089 0 1087 1 0 1 1 0 8 0 lockfspl 48 342 0 340 1 0 1 1 0 8 0 sessionpl 144 47 0 38 1 0 1 1 0 8 0 pgrppl 48 130 0 113 1 0 1 1 0 8 0 ucredpl 104 4150 0 4135 1 0 1 1 0 8 0 zombiepl 144 2888 0 2886 1 0 1 1 0 8 0 processpl 1232 2934 0 2886 6 1 5 5 0 8 0 procpl 664 6839 0 6787 7 1 6 7 0 8 0 sosppl 176 20 0 20 5 4 1 1 0 8 1 sockpl 752 5637 0 5605 49 35 14 18 0 8 9 mcl64k 65536 5 0 0 1 0 1 1 0 8 0 mcl16k 16384 1 0 0 1 0 1 1 0 8 0 mcl12k 12288 1 0 0 1 0 1 1 0 8 0 mcl9k 9216 1 0 0 1 0 1 1 0 8 0 mcl8k 8192 2 0 0 1 0 1 1 0 8 0 mcl4k 4096 128 0 0 16 0 16 16 0 8 0 mcl2k 2048 38 0 0 5 0 5 5 0 8 0 mtagpl 96 7 0 0 1 0 1 1 0 8 0 mbufpl 256 426 0 0 25 0 25 25 0 8 0 bufpl 280 39022 0 32886 439 0 439 439 0 8 0 anonpl 32 15996 0 0 129 0 129 129 0 246 0 amapchunkpl 152 87702 0 87219 48 21 27 30 0 158 2 amappl16 200 12848 0 12816 110 90 20 43 0 8 8 amappl15 192 10 0 10 1 1 0 1 0 8 0 amappl14 184 5 0 5 1 1 0 1 0 8 0 amappl13 176 522 0 520 1 0 1 1 0 8 0 amappl12 168 3358 0 3316 3 0 3 3 0 8 0 amappl11 160 65 0 65 1 1 0 1 0 8 0 amappl10 152 46 0 32 1 0 1 1 0 8 0 amappl9 144 250 0 250 1 1 0 1 0 8 0 amappl8 136 27 0 25 1 0 1 1 0 8 0 amappl7 128 115 0 113 1 0 1 1 0 8 0 amappl6 120 400 0 384 1 0 1 1 0 8 0 amappl5 112 87 0 76 1 0 1 1 0 8 0 amappl4 104 541 0 511 1 0 1 1 0 8 0 amappl3 96 15329 0 15233 4 1 3 3 0 8 0 amappl2 88 3097 0 3020 4 2 2 3 0 8 0 amappl1 80 23188 0 22593 18 3 15 16 0 8 0 amappl 88 23873 0 23712 5 0 5 5 0 92 0 uvmvnodes 80 219 0 0 5 0 5 5 0 8 0 dma65536 65536 1 0 1 1 1 0 1 0 8 0 dma16384 16384 1 0 1 1 1 0 1 0 8 0 dma8192 8192 1 0 1 1 1 0 1 0 8 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 258 0 258 6 5 1 1 0 8 1 dma64 64 7 0 7 2 2 0 1 0 8 0 dma32 32 7 0 7 1 1 0 1 0 8 0 dma16 16 21 0 20 1 0 1 1 0 8 0 aobjpl 72 16 0 3 1 0 1 1 0 8 0 uaddrrnd 24 2905 0 2873 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 2905 0 2873 1 0 1 1 0 8 0 vmmpekpl 168 22690 0 22633 4 0 4 4 0 8 0 vmmpepl 168 193263 0 191337 152 42 110 120 0 357 4 vmsppl 488 2904 0 2873 6 1 5 5 0 8 0 rwobjpl 80 53934 0 52758 44 8 36 39 0 8 0 pdppl 4096 5844 0 5762 140 54 86 86 0 8 4 pvpl 32 23180 0 0 187 0 187 187 0 265 0 pmappl 256 2917 0 2876 3 0 3 3 0 8 0 extentpl 40 45 0 27 1 0 1 1 0 8 0 phpool 112 375 0 95 8 0 8 8 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(ffffffff833b1ba4) at panic+0x1e5 sys/kern/subr_prf.c:198 __assert(ffffffff833f0663,ffffffff83440e86,143,ffffffff83331f25) at __assert+0x29 sys/kern/subr_prf.c:-1 tun_clone_destroy(ffff80000159d800) at tun_clone_destroy+0x38a if_clone_destroy(ffff80002ebc3d70) at if_clone_destroy+0x205 sys/net/if.c:1478 ifioctl(ffff8000016fa438,80206979,ffff80002ebc3d70,ffff80003c42aa88) at ifioctl+0x59d sys/net/if.c:2159 sys_ioctl(ffff80003c42aa88,ffff80002ebc3f50,ffff80002ebc3ea0) at sys_ioctl+0x674 sys/kern/sys_generic.c:-1 syscall(ffff80002ebc3f50) at syscall+0xbd4 mi_syscall sys/sys/syscall_mi.h:176 [inline] syscall(ffff80002ebc3f50) at syscall+0xbd4 sys/arch/amd64/amd64/trap.c:775 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x777ddb137d30, 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 __mp_lock(ffffffff8394a580) at __mp_lock+0x199 __mp_lock_spin sys/kern/kern_lock.c:142 [inline] __mp_lock(ffffffff8394a580) at __mp_lock+0x199 sys/kern/kern_lock.c:173 syscall(ffff80002ebca2b0) at syscall+0xaf4 mi_syscall sys/sys/syscall_mi.h:175 [inline] syscall(ffff80002ebca2b0) at syscall+0xaf4 sys/arch/amd64/amd64/trap.c:775 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x7d1f47e56c20, count: 9 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 __mp_lock(ffffffff8394a580) at __mp_lock+0x199 __mp_lock_spin sys/kern/kern_lock.c:142 [inline] __mp_lock(ffffffff8394a580) at __mp_lock+0x199 sys/kern/kern_lock.c:173 syscall(ffff80002ebca2b0) at syscall+0xaf4 mi_syscall sys/sys/syscall_mi.h:175 [inline] syscall(ffff80002ebca2b0) at syscall+0xaf4 sys/arch/amd64/amd64/trap.c:775 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x7d1f47e56c20, count: -6