panic: kernel diagnostic assertion "sc->sc_dev == 0" failed: file "/syzkaller/managers/multicore/kernel/sys/net/if_tun.c", line 316 Stopped at db_enter+0x25: addq $0x8,%rsp TID PID UID PRFLAGS PFLAGS CPU COMMAND *416271 99790 0 0x2 0 0K ifconfig db_enter() at db_enter+0x25 sys/arch/amd64/amd64/db_interface.c:438 panic(ffffffff83384093) at panic+0x1e5 sys/kern/subr_prf.c:198 __assert(ffffffff833c56b7,ffffffff8340efbf,13c,ffffffff833026df) at __assert+0x29 sys/kern/subr_prf.c:-1 tun_clone_destroy(ffff800001481800) at tun_clone_destroy+0x38a if_clone_destroy(ffff80003c4472f0) at if_clone_destroy+0x1d5 sys/net/if.c:1415 ifioctl(ffff80000142f790,80206979,ffff80003c4472f0,ffff80003c434028) at ifioctl+0x59d sys/net/if.c:2092 sys_ioctl(ffff80003c434028,ffff80003c4474d0,ffff80003c447420) at sys_ioctl+0x674 sys/kern/sys_generic.c:-1 syscall(ffff80003c4474d0) at syscall+0xbd4 mi_syscall sys/sys/syscall_mi.h:176 [inline] syscall(ffff80003c4474d0) at syscall+0xbd4 sys/arch/amd64/amd64/trap.c:748 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x7eec180a3d30, 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 316 ddb{0}> trace db_enter() at db_enter+0x25 sys/arch/amd64/amd64/db_interface.c:438 panic(ffffffff83384093) at panic+0x1e5 sys/kern/subr_prf.c:198 __assert(ffffffff833c56b7,ffffffff8340efbf,13c,ffffffff833026df) at __assert+0x29 sys/kern/subr_prf.c:-1 tun_clone_destroy(ffff800001481800) at tun_clone_destroy+0x38a if_clone_destroy(ffff80003c4472f0) at if_clone_destroy+0x1d5 sys/net/if.c:1415 ifioctl(ffff80000142f790,80206979,ffff80003c4472f0,ffff80003c434028) at ifioctl+0x59d sys/net/if.c:2092 sys_ioctl(ffff80003c434028,ffff80003c4474d0,ffff80003c447420) at sys_ioctl+0x674 sys/kern/sys_generic.c:-1 syscall(ffff80003c4474d0) at syscall+0xbd4 mi_syscall sys/sys/syscall_mi.h:176 [inline] syscall(ffff80003c4474d0) at syscall+0xbd4 sys/arch/amd64/amd64/trap.c:748 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x7eec180a3d30, count: -9 ddb{0}> show registers rdi 0 rsi 0x1 rbp 0xffff80003c4470a0 rbx 0xffffffff837a7ddf cpu_info_full_primary+0x2ddf rdx 0 rcx 0xffff80003c434028 rax 0xffffffff837a6ff0 cpu_info_full_primary+0x1ff0 r8 0x101010101010101 r9 0x8080808080808080 r10 0xd6e48c0b4697d1aa r11 0x895baee09b56df75 r12 0xffffffff837a7be0 cpu_info_full_primary+0x2be0 r13 0 r14 0 r15 0x1 rip 0xffffffff8151f265 db_enter+0x25 cs 0x8 rflags 0x246 rsp 0xffff80003c447090 ss 0x10 db_enter+0x25: addq $0x8,%rsp ddb{0}> show proc PROC (ifconfig) tid=416271 pid=99790 tcnt=1 stat=onproc flags process=2 proc=0 runpri=84, usrpri=84, slppri=17, nice=20 wchan=0x0, wmesg=, ps_single=0x0 scnt=0 ecnt=0 forw=0xffffffffffffffff, list=0xffff80003a3f8d38,0xffff80003a3f8ab0 process=0xffff80003c4d79e8 user=0xffff80003c442000, vmspace=0xfffffd80657983f0 estcpu=34, cpticks=2, pctcpu=0.0, user=0, sys=2, intr=0 ddb{0}> ps PID TID PPID UID S FLAGS WAIT COMMAND 79985 467572 7513 0 2 0 syz-executor 79985 7519 7513 0 2 0x4000000 syz-executor *99790 416271 86312 0 7 0x2 ifconfig 60654 405383 92862 0 3 0 vmmaplk syz-executor 60654 78677 92862 0 2 0x4000000 syz-executor 44972 196042 54972 0 2 0xc80 syz-executor 44972 153910 54972 0 3 0x4000080 kqpoll syz-executor 44972 123027 54972 0 3 0x4000080 fsleep syz-executor 62939 168222 29495 0 2 0x1 syz-executor 62939 447318 29495 0 3 0x4000080 fsleep syz-executor 86312 434603 84408 0 3 0x10008a sigsusp sh 30070 447482 37650 0 2 0x1 syz-executor 30070 216842 37650 0 3 0x4000080 fsleep syz-executor 30070 284954 37650 0 3 0x4000080 fsleep syz-executor 30070 81214 37650 0 3 0x4000080 fsleep syz-executor 84408 86782 39526 0 3 0x82 wait syz-executor 54972 521734 39526 0 2 0xc82 syz-executor 29403 85984 39526 0 2 0x2 syz-executor 87534 63395 0 0 3 0x14280 nfsidl nfsio 86883 230872 0 0 3 0x14280 nfsidl nfsio 82268 217187 0 0 3 0x14280 nfsidl nfsio 96309 150951 0 0 3 0x14280 nfsidl nfsio 11497 436373 0 0 3 0x14280 nfsidl nfsio 43717 184101 0 0 3 0x14280 nfsidl nfsio 67784 388157 0 0 3 0x14280 nfsidl nfsio 71999 127314 0 0 3 0x14200 bored sosplice 37650 349147 39526 0 2 0xc82 syz-executor 7513 396161 39526 0 2 0xc82 syz-executor 88685 296895 39526 0 2 0x2 syz-executor 29495 248729 39526 0 2 0xc82 syz-executor 92862 195724 39526 0 2 0xc82 syz-executor 39526 312464 87969 0 3 0x82 kqread syz-executor 87969 14208 30992 0 3 0x10008a sigsusp ksh 30992 180951 56833 0 3 0x98 kqread sshd-session 56833 374220 41355 0 3 0x92 kqread sshd-session 13244 242301 1 0 3 0x100083 ttyin getty 41355 461692 1 0 3 0x88 kqread sshd 74383 491787 39651 74 3 0x1100092 bpf pflogd 39651 241395 1 0 3 0x80 sbwait pflogd 84318 128448 25354 73 3 0x1100090 kqread syslogd 25354 54045 1 0 3 0x100082 sbwait syslogd 54296 45740 1 0 3 0x100080 kqread resolvd 35672 478532 16509 77 2 0x100092 dhcpleased 57487 118402 16509 77 3 0x100092 kqread dhcpleased 16509 510837 1 0 3 0x80 kqread dhcpleased 14759 321740 0 0 3 0x14200 bored smr 63271 144824 0 0 2 0x14200 zerothread 66021 227155 0 0 3 0x14200 aiodoned aiodoned 75527 289163 0 0 3 0x14200 syncer update 97618 4510 0 0 3 0x14200 cleaner cleaner 72497 346611 0 0 3 0x14200 reaper reaper 73206 215746 0 0 3 0x14200 pgdaemon pagedaemon 2450 509816 0 0 3 0x14200 bored viomb 50057 260975 0 0 3 0x40014200 acpi0 acpi0 61666 380952 0 0 7 0x40014200 idle1 86761 18110 0 0 3 0x14200 bored softnet1 71914 121757 0 0 3 0x14200 bored softnet0 55060 303921 0 0 3 0x14200 bored systqmp 28486 271627 0 0 3 0x14200 bored systq 79764 264300 0 0 3 0x14200 tmoslp softclockmp 54731 426578 0 0 3 0x40014200 tmoslp softclock 44193 519450 0 0 3 0x40014200 idle0 1 371267 0 0 3 0x82 wait init 0 0 -1 0 3 0x10010200 scheduler swapper ddb{0}> show all locks Process 99790 (ifconfig) thread 0xffff80003c434028 (416271) Process 60654 (syz-executor) thread 0xffff80003a3f8d38 (78677) Process 29403 (syz-executor) thread 0xffff80003a3f9a30 (85984) Process 88685 (syz-executor) thread 0xffff8000fffefa08 (296895) ddb{0}> show malloc Type InUse MemUse HighUse Limit Requests Type Lim devbuf 10244 11137K 11349K 166960K 13378 0 pcb 17 16K 18K 166960K 526 0 rtable 219 12K 13K 166960K 678 0 pf 39 18K 67485K 166960K 282 0 ifaddr 38 7K 9K 166960K 164 0 ifgroup 62 2K 2K 166960K 296 0 sysctl 4 1K 9K 166960K 24 0 counters 70 37K 38K 166960K 326 0 ioctlops 0 0K 4K 166960K 2085 0 iov 0 0K 28K 166960K 230 0 mount 1 1K 1K 166960K 1 0 log 0 0K 0K 166960K 4 0 vnodes 1423 90K 90K 166960K 3280 0 UFS quota 1 32K 32K 166960K 1 0 UFS mount 5 36K 36K 166960K 5 0 shm 2 1K 9K 166960K 14 0 VM map 2 1K 1K 166960K 2 0 sem 26 33K 33K 166960K 120 0 dirhash 12 2K 3K 166960K 54 0 ACPI 1692 195K 286K 166960K 12470 0 file desc 18 65K 240K 166960K 2508 0 sigio 0 0K 0K 166960K 109 0 proc 79 131K 180K 166960K 853 0 subproc 72 4K 4K 166960K 118 0 NFS srvsock 1 0K 0K 166960K 1 0 NFS daemon 1 16K 16K 166960K 1 0 ip_moptions 1 0K 0K 166960K 301 0 in_multi 73 5K 7K 166960K 253 0 ether_multi 1 0K 0K 166960K 22 0 mrt 2 0K 0K 166960K 29 0 ISOFS mount 1 32K 32K 166960K 1 0 MSDOSFS mount 1 16K 16K 166960K 1 0 ttys 259 1155K 1155K 166960K 259 0 exec 0 0K 1K 166960K 812 0 fusefs mount 1 32K 32K 166960K 1 0 pfkey data 0 0K 0K 166960K 2 0 tdb 3 0K 0K 166960K 3 0 VM swap 8 62K 64K 166960K 10 0 UVM amap 234 162K 178K 166960K 24167 0 UVM aobj 38 6K 6K 166960K 42 0 pinsyscall 43 86K 104K 166960K 3724 0 memdesc 1 4K 4K 166960K 1 0 crypto data 1 1K 1K 166960K 1 0 ip6_options 0 0K 0K 166960K 143 0 NDP 13 0K 2K 166960K 123 0 temp 79 8656K 8784K 166960K 150447 0 kqueue 13 20K 33K 166960K 503 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 188 0 185 1 0 1 1 0 8 0 rtentry 176 210 0 130 5 0 5 5 0 8 0 unpcb 144 2388 0 2371 28 26 2 9 0 8 1 syncache 336 15 0 15 7 7 0 1 0 8 0 tcpqe 32 7 0 7 4 4 0 1 0 8 0 tcpcb 736 1113 0 1104 26 23 3 7 0 8 2 arp 136 27 0 16 1 0 1 1 0 8 0 inpcb 328 3478 0 3462 48 45 3 12 0 8 1 nd6 152 37 0 21 1 0 1 1 0 8 0 pkpcb 40 14 0 14 6 6 0 1 0 8 0 kcovpl 48 13 0 5 1 0 1 1 0 8 0 mppekey 1024 4 0 4 3 3 0 1 0 8 0 ppxss 1192 103 0 103 4 3 1 1 0 8 1 pppxif 1504 7 0 7 4 4 0 1 0 8 0 pffrag 232 19 0 10 1 0 1 1 0 482 0 pffrnode 88 18 0 10 1 0 1 1 0 8 0 pffrent 40 37 0 28 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 13 0 13 4 4 0 1 0 8 0 pfanchor 1288 4 0 2 2 1 1 1 0 8 0 pftag 88 1 0 1 1 1 0 1 0 8 0 pfstitem 24 164 0 89 1 0 1 1 0 8 0 pfstkey 128 164 0 89 3 0 3 3 0 8 0 pfstate 384 164 0 89 9 0 9 9 0 8 0 pfrule 1344 27 0 22 2 1 1 2 0 8 0 rttmr 136 7 0 7 5 5 0 1 0 8 0 art_heap8 4096 4 0 0 4 0 4 4 0 8 0 art_heap4 256 949 0 590 38 10 28 31 0 8 0 art_table 40 953 0 590 5 0 5 5 0 8 0 art_node 32 207 0 139 1 0 1 1 0 8 0 sysvmsgpl 40 15 0 9 1 0 1 1 0 8 0 semupl 112 7 0 7 4 4 0 1 0 8 0 semapl 112 109 0 85 1 0 1 1 0 8 0 shmpl 112 39 0 4 1 0 1 1 0 8 0 dirhash 1024 45 0 28 3 0 3 3 0 8 0 dino2pl 256 6145 0 4635 95 0 95 95 0 8 0 ffsino 296 6145 0 4635 117 0 117 117 0 8 0 nchpl 144 9560 0 7861 64 0 64 64 0 8 0 rtmask 32 13 0 13 4 4 0 1 0 8 0 uvmvnodes 80 4486 0 0 92 0 92 92 0 8 0 vnodes 216 4486 0 0 250 0 250 250 0 8 0 namei 1024 34702 0 34702 5 4 1 2 0 8 1 percpumem 16 178 0 128 1 0 1 1 0 8 0 pfiaddrpl 120 3 0 3 2 2 0 1 0 8 0 kstatmem 264 200 0 170 5 2 3 3 0 8 0 acpiwqpl 32 1 0 1 1 0 1 1 1 8 1 scsiplug 72 15 0 15 6 5 1 1 0 8 1 scxspl 216 61464 0 61464 16 15 1 8 1 8 1 plimitpl 152 891 0 873 1 0 1 1 0 8 0 sigapl 424 2818 0 2762 9 2 7 8 0 8 0 knotepl 120 792 0 0 24 0 24 24 0 8 0 kqueuepl 224 1143 0 1133 18 17 1 7 0 8 0 pipepl 344 307 0 280 4 1 3 4 0 8 0 fdescpl 528 2768 0 2736 3 0 3 3 0 8 0 filepl 160 19678 0 19460 46 34 12 21 0 8 0 lockfpl 104 1057 0 1055 2 1 1 2 0 8 0 lockfspl 48 419 0 417 1 0 1 1 0 8 0 sessionpl 144 37 0 28 1 0 1 1 0 8 0 pgrppl 48 111 0 94 1 0 1 1 0 8 0 ucredpl 104 2969 0 2956 1 0 1 1 0 8 0 zombiepl 144 3357 0 3357 3 2 1 1 0 8 1 processpl 1232 2818 0 2762 6 1 5 6 0 8 0 procpl 664 6770 0 6706 9 2 7 8 0 8 0 sosppl 168 15 0 15 6 6 0 1 0 8 0 sockpl 752 6158 0 6122 88 82 6 24 0 8 2 mcl64k 65536 6 0 0 1 0 1 1 0 8 0 mcl16k 16384 3 0 0 1 0 1 1 0 8 0 mcl12k 12288 1 0 0 1 0 1 1 0 8 0 mcl9k 9216 2 0 0 1 0 1 1 0 8 0 mcl8k 8192 2 0 0 1 0 1 1 0 8 0 mcl4k 4096 143 0 0 17 0 17 17 0 8 0 mcl2k 2048 33 0 0 5 0 5 5 0 8 0 mtagpl 96 8 0 0 1 0 1 1 0 8 0 mbufpl 256 1767 0 0 111 0 111 111 0 8 0 bufpl 280 26587 0 20444 440 0 440 440 0 8 0 anonpl 32 12326 0 0 100 0 100 100 0 246 0 amapchunkpl 152 83434 0 82868 59 29 30 31 0 158 4 amappl16 200 10954 0 10917 63 53 10 27 0 8 2 amappl15 192 37 0 37 2 2 0 1 0 8 0 amappl14 184 145 0 133 1 0 1 1 0 8 0 amappl13 176 9 0 8 1 0 1 1 0 8 0 amappl12 168 3484 0 3453 3 1 2 2 0 8 0 amappl11 160 54 0 39 1 0 1 1 0 8 0 amappl10 152 20 0 20 1 1 0 1 0 8 0 amappl9 144 286 0 284 1 0 1 1 0 8 0 amappl8 136 79 0 76 1 0 1 1 0 8 0 amappl7 128 153 0 141 1 0 1 1 0 8 0 amappl6 120 227 0 221 1 0 1 1 0 8 0 amappl5 112 215 0 203 1 0 1 1 0 8 0 amappl4 104 339 0 319 1 0 1 1 0 8 0 amappl3 96 14831 0 14738 5 1 4 4 0 8 0 amappl2 88 3082 0 3001 2 0 2 2 0 8 0 amappl1 80 20174 0 19563 18 3 15 15 0 8 0 amappl 88 22965 0 22804 5 0 5 5 0 92 0 dma65536 65536 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 7 0 7 2 2 0 1 0 8 0 dma128 128 255 0 255 3 3 0 1 0 8 0 dma64 64 9 0 9 4 4 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 41 0 4 1 0 1 1 0 8 0 uaddrrnd 24 2768 0 2736 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 2768 0 2736 1 0 1 1 0 8 0 vmmpekpl 168 22168 0 22113 4 0 4 4 0 8 0 vmmpepl 168 180889 0 178898 130 30 100 113 0 357 0 vmsppl 488 2767 0 2736 6 1 5 5 0 8 0 rwobjpl 80 52916 0 47419 123 5 118 123 0 8 0 pdppl 4096 5544 0 5472 129 55 74 88 0 8 2 pvpl 32 21002 0 0 170 1 169 169 0 265 0 pmappl 256 2767 0 2736 3 0 3 3 0 8 0 extentpl 40 45 0 27 1 0 1 1 0 8 0 phpool 112 454 0 106 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(ffffffff83384093) at panic+0x1e5 sys/kern/subr_prf.c:198 __assert(ffffffff833c56b7,ffffffff8340efbf,13c,ffffffff833026df) at __assert+0x29 sys/kern/subr_prf.c:-1 tun_clone_destroy(ffff800001481800) at tun_clone_destroy+0x38a if_clone_destroy(ffff80003c4472f0) at if_clone_destroy+0x1d5 sys/net/if.c:1415 ifioctl(ffff80000142f790,80206979,ffff80003c4472f0,ffff80003c434028) at ifioctl+0x59d sys/net/if.c:2092 sys_ioctl(ffff80003c434028,ffff80003c4474d0,ffff80003c447420) at sys_ioctl+0x674 sys/kern/sys_generic.c:-1 syscall(ffff80003c4474d0) at syscall+0xbd4 mi_syscall sys/sys/syscall_mi.h:176 [inline] syscall(ffff80003c4474d0) at syscall+0xbd4 sys/arch/amd64/amd64/trap.c:748 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x7eec180a3d30, count: -9 ddb{0}> machine ddbcpu 1 Stopped at x86_ipi_db+0x27: addq $0x8,%rsp x86_ipi_db(ffff8000299edff0) 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+0x457 sys/dev/acpi/acpicpu_x86.c:1224 sched_idle(ffff8000299edff0) at sched_idle+0x391 sys/kern/kern_sched.c:191 end trace frame: 0x0, count: 10 ddb{1}> trace x86_ipi_db(ffff8000299edff0) 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+0x457 sys/dev/acpi/acpicpu_x86.c:1224 sched_idle(ffff8000299edff0) at sched_idle+0x391 sys/kern/kern_sched.c:191 end trace frame: 0x0, count: -5