login: panic: kernel diagnostic assertion "sc->sc_dev == 0" failed: file "/syzkaller/managers/main/kernel/sys/net/if_tun.c", line 319 Stopped at db_enter+0x25: addq $0x8,%rsp TID PID UID PRFLAGS PFLAGS CPU COMMAND *145649 40958 0 0x2 0 0 ifconfig db_enter() at db_enter+0x25 sys/arch/amd64/amd64/db_interface.c:438 panic(ffffffff834adf53) at panic+0x1cf sys/kern/subr_prf.c:198 __assert(ffffffff834f0459,ffffffff8342614c,13f,ffffffff8342f7be) at __assert+0x29 sys/kern/subr_prf.c:-1 tun_clone_destroy(ffff800001614800) at tun_clone_destroy+0x32d if_clone_destroy(ffff80002a8578e0) at if_clone_destroy+0x1d5 sys/net/if.c:1464 sys_ioctl(ffff80002a7262a0,ffff80002a857ab0,ffff80002a857a00) at sys_ioctl+0x660 sys/kern/sys_generic.c:-1 syscall(ffff80002a857ab0) at syscall+0x962 mi_syscall sys/sys/syscall_mi.h:-1 [inline] syscall(ffff80002a857ab0) at syscall+0x962 sys/arch/amd64/amd64/trap.c:791 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x788ae69de9a0, count: 7 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> ddb> set $lines = 0 ddb> set $maxwidth = 0 ddb> show panic *cpu0: kernel diagnostic assertion "sc->sc_dev == 0" failed: file "/syzkaller/managers/main/kernel/sys/net/if_tun.c", line 319 ddb> show kasan No such command ddb> trace db_enter() at db_enter+0x25 sys/arch/amd64/amd64/db_interface.c:438 panic(ffffffff834adf53) at panic+0x1cf sys/kern/subr_prf.c:198 __assert(ffffffff834f0459,ffffffff8342614c,13f,ffffffff8342f7be) at __assert+0x29 sys/kern/subr_prf.c:-1 tun_clone_destroy(ffff800001614800) at tun_clone_destroy+0x32d if_clone_destroy(ffff80002a8578e0) at if_clone_destroy+0x1d5 sys/net/if.c:1464 sys_ioctl(ffff80002a7262a0,ffff80002a857ab0,ffff80002a857a00) at sys_ioctl+0x660 sys/kern/sys_generic.c:-1 syscall(ffff80002a857ab0) at syscall+0x962 mi_syscall sys/sys/syscall_mi.h:-1 [inline] syscall(ffff80002a857ab0) at syscall+0x962 sys/arch/amd64/amd64/trap.c:791 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x788ae69de9a0, count: -8 ddb> show registers rdi 0 rsi 0x1 rbp 0xffff80002a857770 rbx 0 rdx 0 rcx 0 rax 0xffff80002a7262a0 r8 0x101010101010101 r9 0x8080808080808080 r10 0x866c3ac84f248385 r11 0xa2c98fdf00574c03 r12 0 r13 0xffffffff838d8b40 tap_cloner r14 0 r15 0x1 rip 0xffffffff81720df5 db_enter+0x25 cs 0x8 rflags 0x246 rsp 0xffff80002a857760 ss 0x10 db_enter+0x25: addq $0x8,%rsp ddb> show proc PROC (ifconfig) tid=145649 pid=40958 tcnt=1 stat=onproc flags process=2 proc=0 runpri=50, usrpri=86, slppri=17, nice=20 wchan=0x0, wmesg=, ps_single=0x0 scnt=0 ecnt=0 forw=0xffffffffffffffff, list=0xffff80002a74c540,0xffffffff83a46400 process=0xffff80002a736448 user=0xffff80002a852000, vmspace=0xfffff2007f216000 estcpu=36, cpticks=2, pctcpu=0.0, user=0, sys=2, intr=0 ddb> ps PID TID PPID UID S PRLAGS PFLAGS WAIT COMMAND *40958 145649 60781 0 7 0x2 0 ifconfig 35734 164641 19818 0 2 0x2 0 ifconfig 60781 162092 39158 0 3 0x100002 0x88 sigsusp sh 19818 355335 92382 0 3 0x100002 0x88 sigsusp sh 9026 474072 82522 0 2 0 0 syz-executor 68279 207642 5830 0 2 0 0 syz-executor 62325 155138 98181 0 2 0 0 syz-executor 18266 342004 29830 0 2 0 0 syz-executor 18266 45305 29830 0 3 0 0x4000080 fsleep syz-executor 15638 322444 44121 0 2 0 0 syz-executor 15638 306046 44121 0 3 0 0x4000080 fsleep syz-executor 15638 516886 44121 0 3 0 0x4000080 fsleep syz-executor 39158 53569 68020 0 3 0x2 0x80 wait syz-executor 92382 53450 68020 0 3 0x2 0x80 wait syz-executor 6560 16009 68020 0 2 0x2 0xc80 syz-executor 5830 477221 68020 0 2 0x2 0 syz-executor 82522 220416 68020 0 3 0x2 0x80 nanoslp syz-executor 98181 138416 68020 0 2 0x2 0xc80 syz-executor 29830 268908 68020 0 2 0x2 0xc80 syz-executor 94064 387641 1 0 3 0x100003 0x80 ttyin getty 44121 167954 68020 0 2 0x2 0xc80 syz-executor 68020 76735 1 0 3 0x2 0x80 kqread syz-executor 88013 17683 1 73 3 0x1100010 0x80 kqread syslogd 20465 102491 0 0 3 0x14000 0x200 bored smr 58193 151225 0 0 2 0x14000 0x200 zerothread 14134 207091 0 0 3 0x14000 0x200 aiodoned aiodoned 16606 300724 0 0 3 0x14000 0x200 syncer update 64380 14760 0 0 3 0x14000 0x200 cleaner cleaner 32297 496695 0 0 3 0x14000 0x200 reaper reaper 64332 232625 0 0 3 0x14000 0x200 pgdaemon pagedaemon 41352 456785 0 0 3 0x14000 0x200 bored viomb 13699 5467 0 0 3 0x14000 0x40000200 acpi0 acpi0 50428 480416 0 0 3 0x14000 0x200 bored softnet0 47660 208634 0 0 3 0x14000 0x200 bored systqmp 23985 316232 0 0 3 0x14000 0x200 bored systq 55394 61625 0 0 3 0x14000 0x40000200 tmoslp softclock 22097 108715 0 0 3 0x14000 0x40000200 idle0 1 513919 0 0 3 0x2 0x80 wait init 0 0 -1 0 3 0x10010000 0x200 scheduler swapper ddb> show all locks No such command ddb> show malloc Type InUse MemUse HighUse Limit Requests Type Lim devbuf 11031 12117K 12300K 166960K 12526 0 pcb 17 14K 16K 166960K 136 0 rtable 218 7K 8K 166960K 1025 0 pf 31 13K 19K 166960K 117 0 ifaddr 39 7K 7K 166960K 149 0 ifgroup 48 2K 2K 166960K 166 0 sysctl 3 1K 9K 166960K 9 0 counters 33 17K 18K 166960K 72 0 ioctlops 0 0K 4K 166960K 225 0 iov 0 0K 12K 166960K 7 0 mount 1 1K 1K 166960K 1 0 log 0 0K 0K 166960K 4 0 vnodes 1303 82K 82K 166960K 1752 0 UFS quota 1 32K 32K 166960K 1 0 UFS mount 5 36K 36K 166960K 5 0 shm 2 1K 5K 166960K 4 0 VM map 2 1K 1K 166960K 2 0 sem 27 0K 0K 166960K 83 0 dirhash 12 2K 2K 166960K 12 0 ACPI 1734 201K 291K 166960K 11964 0 file desc 20 73K 97K 166960K 657 0 sigio 0 0K 0K 166960K 6 0 proc 34 42K 124K 166960K 1148 0 subproc 72 4K 4K 166960K 288 0 NFS srvsock 1 0K 0K 166960K 1 0 NFS daemon 1 16K 16K 166960K 1 0 ip_moptions 0 0K 0K 166960K 85 0 in_multi 88 5K 6K 166960K 346 0 ether_multi 1 0K 0K 166960K 2 0 mrt 1 0K 0K 166960K 16 0 ISOFS mount 1 32K 32K 166960K 1 0 MSDOSFS mount 1 16K 16K 166960K 1 0 ttys 73 334K 334K 166960K 73 0 exec 0 0K 1K 166960K 741 0 fusefs mount 1 32K 32K 166960K 1 0 tdb 3 0K 0K 166960K 3 0 VM swap 8 62K 64K 166960K 10 0 UVM amap 125 84K 164K 166960K 6470 0 UVM aobj 6 2K 2K 166960K 6 0 pinsyscall 24 48K 96K 166960K 2335 0 memdesc 1 4K 4K 166960K 1 0 crypto data 1 1K 1K 166960K 1 0 ip6_options 0 0K 0K 166960K 3 0 NDP 21 1K 1K 166960K 106 0 temp 37 9114K 9178K 166960K 8691 0 kqueue 3 4K 24K 166960K 58 0 SYN cache 2 16K 16K 166960K 2 0 ddb> show all pools Name Size Requests Fail Releases Pgreq Pgrel Npage Hiwat Minpg Maxpg Idle rtpcb 120 100 0 100 1 0 1 1 0 8 1 rtentry 136 356 0 255 4 0 4 4 0 8 0 unpcb 144 115 0 111 1 0 1 1 0 8 0 syncache 336 5 0 5 1 0 1 1 0 8 1 tcpcb 736 53 0 52 1 0 1 1 0 8 0 arp 96 63 0 46 1 0 1 1 0 8 0 ipq 40 2 0 0 1 0 1 1 0 8 0 ipqe 40 2 0 0 1 0 1 1 0 8 0 inpcb 328 334 0 331 7 0 7 7 0 8 6 ip6q 80 1 0 0 1 0 1 1 0 8 0 ip6af 40 1 0 0 1 0 1 1 0 8 0 nd6 112 91 0 70 1 0 1 1 0 8 0 pkpcb 40 1 0 1 1 0 1 1 0 8 1 kcovpl 48 32 0 24 1 0 1 1 0 8 0 ppxss 1072 16 0 15 1 0 1 1 0 8 0 pfstscr 40 2 0 0 1 0 1 1 0 8 0 pffrag 232 2 0 0 1 0 1 1 0 482 0 pffrnode 88 2 0 0 1 0 1 1 0 8 0 pffrent 40 4 0 2 1 0 1 1 0 8 0 pfosfp 40 2 0 0 1 0 1 1 0 8 0 pfosfpen 112 2 0 0 1 0 1 1 0 8 0 pfanchor 1288 3 0 0 1 0 1 1 0 8 0 pfstitem 24 2 0 0 1 0 1 1 0 8 0 pfstkey 128 2 0 0 1 0 1 1 0 8 0 pfstate 384 1 0 0 1 0 1 1 0 8 0 art_heap8 4096 1 0 0 1 0 1 1 0 8 0 art_heap4 256 1464 0 1017 34 0 34 34 0 8 0 art_table 40 1465 0 1017 6 0 6 6 0 8 0 art_node 32 356 0 265 1 0 1 1 0 8 0 sysvmsgpl 40 2 0 2 1 0 1 1 0 8 1 semapl 72 81 0 56 1 0 1 1 0 8 0 shmpl 120 3 0 0 1 0 1 1 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino2pl 256 1959 0 444 95 0 95 95 0 8 0 ffsino 256 1959 0 444 95 0 95 95 0 8 0 nchpl 144 2410 0 605 67 0 67 67 0 8 0 rtmask 32 2 0 2 1 0 1 1 0 8 1 vnodes 216 2343 0 0 131 0 131 131 0 8 0 namei 1024 10662 0 10662 4 0 4 4 0 8 4 kstatmem 264 93 0 70 2 0 2 2 0 8 0 scxspl 216 12300 0 12300 3 0 3 3 1 8 3 plimitpl 152 78 0 67 1 0 1 1 0 8 0 sigapl 424 898 0 862 6 0 6 6 0 8 2 knotepl 120 8015 0 7993 9 0 9 9 0 8 7 kqueuepl 184 73 0 71 1 0 1 1 0 8 0 pipepl 304 216 0 189 3 0 3 3 0 8 0 fdescpl 448 884 0 861 5 0 5 5 0 8 1 filepl 120 3211 0 3040 9 0 9 9 0 8 3 lockfpl 104 105 0 103 1 0 1 1 0 8 0 lockfspl 48 43 0 42 1 0 1 1 0 8 0 sessionpl 144 57 0 53 1 0 1 1 0 8 0 pgrppl 48 91 0 79 1 0 1 1 0 8 0 ucredpl 104 267 0 262 1 0 1 1 0 8 0 zombiepl 144 863 0 862 1 0 1 1 0 8 0 processpl 1160 898 0 862 4 0 4 4 0 8 1 procpl 664 1247 0 1208 7 0 7 7 0 8 3 sosppl 176 2 0 2 1 0 1 1 0 8 1 sockpl 552 558 0 551 7 0 7 7 0 8 6 mcl64k 65536 17 0 16 1 0 1 1 0 8 0 mcl16k 16384 3 0 3 1 0 1 1 0 8 1 mcl12k 12288 2 0 2 1 0 1 1 0 8 1 mcl8k 8192 18 0 18 1 0 1 1 0 8 1 mcl4k 4096 2823 0 2773 14 0 14 14 0 8 7 mcl2k 2048 571 0 567 4 0 4 4 0 8 3 mextrefs 64 173 0 173 1 0 1 1 0 8 1 mtagpl 96 5 0 5 1 0 1 1 0 8 1 mbufpl 256 7556 0 7435 16 0 16 16 0 8 6 bufpl 272 4822 0 89 316 0 316 316 0 8 0 anonpl 24 129760 0 128037 43 0 43 43 0 187 14 amapchunkpl 152 18092 0 17794 27 0 27 27 0 158 12 amappl16 200 2067 0 2060 14 4 10 14 0 8 8 amappl15 192 3 0 3 1 0 1 1 0 8 1 amappl14 184 664 0 662 1 0 1 1 0 8 0 amappl13 176 158 0 156 1 0 1 1 0 8 0 amappl12 168 1209 0 1192 2 0 2 2 0 8 0 amappl11 160 11 0 11 1 0 1 1 0 8 1 amappl10 152 61 0 59 1 0 1 1 0 8 0 amappl9 144 284 0 284 1 0 1 1 0 8 1 amappl8 136 177 0 174 1 0 1 1 0 8 0 amappl7 128 181 0 178 1 0 1 1 0 8 0 amappl6 120 252 0 249 1 0 1 1 0 8 0 amappl5 112 216 0 213 1 0 1 1 0 8 0 amappl4 104 331 0 325 1 0 1 1 0 8 0 amappl3 96 3654 0 3583 4 0 4 4 0 8 1 amappl2 88 529 0 515 2 0 2 2 0 8 0 amappl1 80 13387 0 13218 13 0 13 13 0 8 7 amappl 88 5403 0 5301 5 0 5 5 0 92 2 uvmvnodes 80 101 0 0 3 0 3 3 0 8 0 dma4096 4096 1 0 1 1 0 1 1 0 8 1 dma1024 1024 1 0 0 1 0 1 1 0 8 0 dma256 256 6 0 6 1 0 1 1 0 8 1 dma128 128 253 0 253 1 0 1 1 0 8 1 dma64 64 6 0 6 1 0 1 1 0 8 1 dma32 32 7 0 7 1 0 1 1 0 8 1 dma16 16 18 0 17 1 0 1 1 0 8 0 aobjpl 72 5 0 0 1 0 1 1 0 8 0 uaddrrnd 24 884 0 861 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 884 0 861 1 0 1 1 0 8 0 vmmpekpl 168 8512 0 8466 3 0 3 3 0 8 0 vmmpepl 168 65561 0 64644 91 0 91 91 0 357 50 vmsppl 368 883 0 861 4 0 4 4 0 8 1 rwobjpl 40 20741 0 20267 13 0 13 13 0 8 1 pdppl 4096 1774 0 1722 106 54 52 82 0 8 0 pvpl 32 371032 0 367013 108 0 108 108 0 265 39 pmappl 216 883 0 861 3 0 3 3 0 8 1 extentpl 40 46 0 28 1 0 1 1 0 8 0 phpool 112 705 0 54 19 0 19 19 0 8 0 ddb> machine ddbcpu 0 No such command ddb> trace db_enter() at db_enter+0x25 sys/arch/amd64/amd64/db_interface.c:438 panic(ffffffff834adf53) at panic+0x1cf sys/kern/subr_prf.c:198 __assert(ffffffff834f0459,ffffffff8342614c,13f,ffffffff8342f7be) at __assert+0x29 sys/kern/subr_prf.c:-1 tun_clone_destroy(ffff800001614800) at tun_clone_destroy+0x32d if_clone_destroy(ffff80002a8578e0) at if_clone_destroy+0x1d5 sys/net/if.c:1464 sys_ioctl(ffff80002a7262a0,ffff80002a857ab0,ffff80002a857a00) at sys_ioctl+0x660 sys/kern/sys_generic.c:-1 syscall(ffff80002a857ab0) at syscall+0x962 mi_syscall sys/sys/syscall_mi.h:-1 [inline] syscall(ffff80002a857ab0) at syscall+0x962 sys/arch/amd64/amd64/trap.c:791 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x788ae69de9a0, count: -8 ddb> machine ddbcpu 1 No such command ddb> trace db_enter() at db_enter+0x25 sys/arch/amd64/amd64/db_interface.c:438 panic(ffffffff834adf53) at panic+0x1cf sys/kern/subr_prf.c:198 __assert(ffffffff834f0459,ffffffff8342614c,13f,ffffffff8342f7be) at __assert+0x29 sys/kern/subr_prf.c:-1 tun_clone_destroy(ffff800001614800) at tun_clone_destroy+0x32d if_clone_destroy(ffff80002a8578e0) at if_clone_destroy+0x1d5 sys/net/if.c:1464 sys_ioctl(ffff80002a7262a0,ffff80002a857ab0,ffff80002a857a00) at sys_ioctl+0x660 sys/kern/sys_generic.c:-1 syscall(ffff80002a857ab0) at syscall+0x962 mi_syscall sys/sys/syscall_mi.h:-1 [inline] syscall(ffff80002a857ab0) at syscall+0x962 sys/arch/amd64/amd64/trap.c:791 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x788ae69de9a0, count: -8 ddb>