login: panic: kernel diagnostic assertion "sc->sc_dev == 0" failed: file "/syzkaller/managers/multicore/kernel/sys/net/if_tun.c", line 319 Stopped at db_enter+0x25: addq $0x8,%rsp TID PID UID PRFLAGS PFLAGS CPU COMMAND *399610 37796 0 0x2 0 1K ifconfig db_enter() at db_enter+0x25 sys/arch/amd64/amd64/db_interface.c:438 panic(ffffffff834f410b) at panic+0x1e5 sys/kern/subr_prf.c:198 __assert(ffffffff8352f7a0,ffffffff8357d82e,13f,ffffffff834712fc) at __assert+0x29 sys/kern/subr_prf.c:-1 tun_clone_destroy(ffff800001605800) at tun_clone_destroy+0x38a if_clone_destroy(ffff80002a313cf0) at if_clone_destroy+0x205 sys/net/if.c:1464 ifioctl(ffff80000158a8d8,80206979,ffff80002a313cf0,ffff80002a3814e8) at ifioctl+0x59d sys/net/if.c:2142 sys_ioctl(ffff80002a3814e8,ffff80002a313ed0,ffff80002a313e20) at sys_ioctl+0x674 sys/kern/sys_generic.c:-1 syscall(ffff80002a313ed0) at syscall+0xbd4 mi_syscall sys/sys/syscall_mi.h:176 [inline] syscall(ffff80002a313ed0) at syscall+0xbd4 sys/arch/amd64/amd64/trap.c:791 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x74ecdd5c1690, 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{1}> ddb{1}> set $lines = 0 ddb{1}> set $maxwidth = 0 ddb{1}> show panic *cpu1: kernel diagnostic assertion "sc->sc_dev == 0" failed: file "/syzkaller/managers/multicore/kernel/sys/net/if_tun.c", line 319 ddb{1}> show kasan No such command ddb{1}> trace db_enter() at db_enter+0x25 sys/arch/amd64/amd64/db_interface.c:438 panic(ffffffff834f410b) at panic+0x1e5 sys/kern/subr_prf.c:198 __assert(ffffffff8352f7a0,ffffffff8357d82e,13f,ffffffff834712fc) at __assert+0x29 sys/kern/subr_prf.c:-1 tun_clone_destroy(ffff800001605800) at tun_clone_destroy+0x38a if_clone_destroy(ffff80002a313cf0) at if_clone_destroy+0x205 sys/net/if.c:1464 ifioctl(ffff80000158a8d8,80206979,ffff80002a313cf0,ffff80002a3814e8) at ifioctl+0x59d sys/net/if.c:2142 sys_ioctl(ffff80002a3814e8,ffff80002a313ed0,ffff80002a313e20) at sys_ioctl+0x674 sys/kern/sys_generic.c:-1 syscall(ffff80002a313ed0) at syscall+0xbd4 mi_syscall sys/sys/syscall_mi.h:176 [inline] syscall(ffff80002a313ed0) at syscall+0xbd4 sys/arch/amd64/amd64/trap.c:791 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x74ecdd5c1690, count: -9 ddb{1}> show registers rdi 0 rsi 0x1 rbp 0xffff80002a313ab0 rbx 0xffff80002999ee0f rdx 0 rcx 0xffff80002a3814e8 rax 0xffff80002999dff0 r8 0x101010101010101 r9 0x8080808080808080 r10 0x19826a0eb42a3dc9 r11 0x91b3d1aec77b2145 r12 0xffff80002999ec10 r13 0 r14 0 r15 0x1 rip 0xffffffff816de9f5 db_enter+0x25 cs 0x8 rflags 0x246 rsp 0xffff80002a313aa0 ss 0x10 db_enter+0x25: addq $0x8,%rsp ddb{1}> show proc PROC (ifconfig) tid=399610 pid=37796 tcnt=1 stat=onproc flags process=2 proc=0 runpri=32, usrpri=81, slppri=32, nice=20 wchan=0x0, wmesg=, ps_single=0x0 scnt=0 ecnt=0 forw=0xffffffffffffffff, list=0xffff80002a3802c0,0xffff80002a381a28 process=0xffff800045ff0018 user=0xffff80002a30e000, vmspace=0xfffff4800b1f73d0 estcpu=31, cpticks=2, pctcpu=0.1, user=0, sys=2, intr=0 ddb{1}> ps PID TID PPID UID S PRLAGS PFLAGS WAIT COMMAND 90929 278872 68624 0 3 0x2 0 clonelk ifconfig 68624 179833 15474 0 3 0x100002 0x88 sigsusp sh 15474 277939 13566 0 3 0x2 0x80 wait syz-executor *37796 399610 61049 0 7 0x2 0 ifconfig 61049 280534 57009 0 3 0x100002 0x88 sigsusp sh 57009 198602 13566 0 3 0x2 0x80 wait syz-executor 9994 398328 13566 0 3 0x2 0 clonelk syz-executor 25221 188821 1 0 3 0x100003 0x80 ttyin getty 84676 153839 13566 0 3 0x2 0x80 piperd syz-executor 6287 182500 0 0 3 0x14000 0x200 acct acct 13566 440339 1 0 3 0x2 0x80 wait syz-executor 21122 334035 10953 74 3 0x1100012 0x80 bpf pflogd 10953 184148 1 0 3 0 0x80 sbwait pflogd 74956 208312 0 0 3 0x14000 0x200 bored smr 8400 485848 0 0 2 0x14000 0x200 zerothread 39197 497435 0 0 3 0x14000 0x200 aiodoned aiodoned 51775 281417 0 0 3 0x14000 0x200 syncer update 5040 3318 0 0 3 0x14000 0x200 cleaner cleaner 29187 271877 0 0 3 0x14000 0x200 reaper reaper 36895 81712 0 0 3 0x14000 0x200 pgdaemon pagedaemon 63074 334385 0 0 3 0x14000 0x200 bored viomb 7955 409188 0 0 3 0x14000 0x40000200 acpi0 acpi0 38222 175867 0 0 3 0x14000 0x40000200 idle1 65485 398974 0 0 3 0x14000 0x200 bored softnet1 79389 310859 0 0 3 0x14000 0x200 bored softnet0 61673 45484 0 0 3 0x14000 0x200 smrbar systqmp 19688 167024 0 0 3 0x14000 0x200 bored systq 77719 202593 0 0 3 0x14000 0x200 tmoslp softclockmp 13984 286610 0 0 3 0x14000 0x40000200 tmoslp softclock 58971 253648 0 0 3 0x14000 0x40000200 idle0 1 451520 0 0 3 0x2 0x80 wait init 0 0 -1 0 3 0x10000 0x200 scheduler swapper ddb{1}> show all locks Process 37796 (ifconfig) thread 0xffff80002a3814e8 (399610) Process 61673 (systqmp) thread 0xffff800045ffe530 (45484) ddb{1}> show malloc Type InUse MemUse HighUse Limit Requests Type Lim devbuf 11065 12079K 12391K 166960K 12834 0 pcb 17 13K 14K 166960K 126 0 rtable 79 3K 7K 166960K 2470 0 pf 24 15K 19K 166960K 227 0 ifaddr 19 3K 7K 166960K 348 0 ifgroup 35 1K 2K 166960K 385 0 sysctl 4 1K 9K 166960K 12 0 counters 60 35K 37K 166960K 244 0 ioctlops 0 0K 4K 166960K 1706 0 iov 0 0K 16K 166960K 204 0 mount 1 1K 1K 166960K 1 0 log 0 0K 0K 166960K 4 0 vnodes 1418 89K 89K 166960K 2603 0 UFS quota 1 32K 32K 166960K 1 0 UFS mount 5 36K 36K 166960K 5 0 shm 2 1K 5K 166960K 11 0 VM map 2 1K 1K 166960K 2 0 sem 26 1K 1K 166960K 34 0 dirhash 21 3K 3K 166960K 24 0 ACPI 1692 195K 286K 166960K 12472 0 file desc 11 41K 93K 166960K 1576 0 sigio 0 0K 0K 166960K 3 0 proc 46 82K 180K 166960K 2586 0 subproc 54 3K 4K 166960K 729 0 NFS srvsock 1 0K 0K 166960K 1 0 NFS daemon 1 16K 16K 166960K 1 0 ip_moptions 0 0K 0K 166960K 202 0 in_multi 24 1K 6K 166960K 872 0 ether_multi 1 0K 0K 166960K 1 0 mrt 0 0K 0K 166960K 45 0 ISOFS mount 1 32K 32K 166960K 1 0 MSDOSFS mount 1 16K 16K 166960K 1 0 ttys 223 996K 996K 166960K 223 0 exec 0