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 *473724 58101 0 0x2 0 0 ifconfig db_enter() at db_enter+0x25 sys/arch/amd64/amd64/db_interface.c:438 panic(ffffffff834895e5) at panic+0x1cf sys/kern/subr_prf.c:198 __assert(ffffffff834c9b16,ffffffff83403bf8,13f,ffffffff8340d045) at __assert+0x29 sys/kern/subr_prf.c:-1 tun_clone_destroy(ffff8000015e2000) at tun_clone_destroy+0x32d if_clone_destroy(ffff80002a85ee60) at if_clone_destroy+0x1d5 sys/net/if.c:1479 sys_ioctl(ffff80002a7a1a08,ffff80002a85f030,ffff80002a85ef80) at sys_ioctl+0x660 sys/kern/sys_generic.c:-1 syscall(ffff80002a85f030) at syscall+0x962 mi_syscall sys/sys/syscall_mi.h:-1 [inline] syscall(ffff80002a85f030) at syscall+0x962 sys/arch/amd64/amd64/trap.c:791 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x7ee41e2577b0, 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(ffffffff834895e5) at panic+0x1cf sys/kern/subr_prf.c:198 __assert(ffffffff834c9b16,ffffffff83403bf8,13f,ffffffff8340d045) at __assert+0x29 sys/kern/subr_prf.c:-1 tun_clone_destroy(ffff8000015e2000) at tun_clone_destroy+0x32d if_clone_destroy(ffff80002a85ee60) at if_clone_destroy+0x1d5 sys/net/if.c:1479 sys_ioctl(ffff80002a7a1a08,ffff80002a85f030,ffff80002a85ef80) at sys_ioctl+0x660 sys/kern/sys_generic.c:-1 syscall(ffff80002a85f030) at syscall+0x962 mi_syscall sys/sys/syscall_mi.h:-1 [inline] syscall(ffff80002a85f030) at syscall+0x962 sys/arch/amd64/amd64/trap.c:791 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x7ee41e2577b0, count: -8 ddb> show registers rdi 0 rsi 0x1 rbp 0xffff80002a85ecf0 rbx 0 rdx 0 rcx 0 rax 0xffff80002a7a1a08 r8 0x101010101010101 r9 0x8080808080808080 r10 0x85cc6b6978b5f2b r11 0xa92e9f845dc594be r12 0 r13 0xffffffff83903b70 tap_cloner r14 0 r15 0x1 rip 0xffffffff8207d895 db_enter+0x25 cs 0x8 rflags 0x246 rsp 0xffff80002a85ece0 ss 0x10 db_enter+0x25: addq $0x8,%rsp ddb> show proc PROC (ifconfig) tid=473724 pid=58101 tcnt=1 stat=onproc flags process=2 proc=0 runpri=32, usrpri=71, slppri=32, nice=20 wchan=0x0, wmesg=, ps_single=0x0 scnt=0 ecnt=0 forw=0xffffffffffffffff, list=0xffff80002a767a00,0xffff80002a7a0d20 process=0xffff80002a76b190 user=0xffff80002a85a000, vmspace=0xffffef8070dbc5c8 estcpu=21, cpticks=1, pctcpu=0.0, user=0, sys=1, intr=0 ddb> ps PID TID PPID UID S PRLAGS PFLAGS WAIT COMMAND 79570 491339 63998 0 3 0x2 0 clonelk ifconfig 72211 380301 75609 0 3 0x2 0 clonelk ifconfig 75609 392899 74594 0 3 0x100002 0x88 sigsusp sh 63998 230768 15372 0 3 0x100002 0x88 sigsusp sh 15372 452547 41478 0 3 0x2 0x80 wait syz-executor 74594 484968 41478 0 3 0x2 0x80 wait syz-executor *58101 473724 34678 0 7 0x2 0 ifconfig 34678 429862 51616 0 3 0x100002 0x88 sigsusp sh 67569 146201 42499 0 2 0 0xc80 syz-executor 67569 24151 42499 0 3 0 0x4000080 ttyout syz-executor 67569 275898 42499 0 3 0 0x4000080 kqsel syz-executor 67569 200653 42499 0 3 0 0x4000080 kqsel syz-executor 67569 60750 42499 0 3 0 0x4000080 fsleep syz-executor 51616 138062 41478 0 3 0x2 0x80 wait syz-executor 56420 246016 1 0 3 0x100003 0x80 ttyin getty 42499 340448 41478 0 2 0x2 0xc80 syz-executor 85615 141975 41478 0 3 0x2 0x80 piperd syz-executor 57802 209847 41478 0 3 0x2 0x80 piperd syz-executor 87219 139773 0 0 3 0x14000 0x280 nfsidl nfsio 71320 383038 0 0 3 0x14000 0x280 nfsidl nfsio 39583 339325 0 0 3 0x14000 0x280 nfsidl nfsio 22108 513264 0 0 3 0x14000 0x280 nfsidl nfsio 95524 95090 0 0 3 0x14000 0x280 nfsidl nfsio 35473 142086 0 0 3 0x14000 0x280 nfsidl nfsio 41578 51221 0 0 3 0x14000 0x280 nfsidl nfsio 44504 335364 0 0 3 0x14000 0x280 nfsidl nfsio 44724 74665 0 0 3 0x14000 0x280 nfsidl nfsio 71077 512671 0 0 3 0x14000 0x280 nfsidl nfsio 79380 225786 0 0 3 0x14000 0x280 nfsidl nfsio 75097 220429 0 0 3 0x14000 0x280 nfsidl nfsio 46619 348284 0 0 3 0x14000 0x280 nfsidl nfsio 91556 233675 0 0 3 0x14000 0x280 nfsidl nfsio 25431 211775 0 0 3 0x14000 0x280 nfsidl nfsio 9761 361507 0 0 3 0x14000 0x280 nfsidl nfsio 49940 487765 0 0 3 0x14000 0x280 nfsidl nfsio 44645 490334 0 0 3 0x14000 0x280 nfsidl nfsio 96640 148538 0 0 3 0x14000 0x280 nfsidl nfsio 26020 93783 0 0 3 0x14000 0x280 nfsidl nfsio 41478 141768 1 0 3 0x2 0x80 wait syz-executor 86869 297611 0 0 3 0x14000 0x200 bored smr 17070 188871 0 0 3 0x14000 0x200 pgzero zerothread 70121 110666 0 0 3 0x14000 0x200 aiodoned aiodoned 81956 345117 0 0 3 0x14000 0x200 syncer update 23262 227019 0 0 3 0x14000 0x200 cleaner cleaner 86938 311875 0 0 3 0x14000 0x200 reaper reaper 71617 75663 0 0 3 0x14000 0x200 pgdaemon pagedaemon 33372 313501 0 0 3 0x14000 0x200 bored viomb 10061 65085 0 0 3 0x14000 0x40000200 acpi0 acpi0 98853 513680 0 0 3 0x14000 0x200 bored softnet0 17135 44820 0 0 3 0x14000 0x200 smrbar systqmp 2522 33321 0 0 3 0x14000 0x200 bored systq 16217 176890 0 0 3 0x14000 0x40000200 tmoslp softclock 89886 4696 0 0 3 0x14000 0x40000200 idle0 1 288132 0 0 3 0x2 0x80 wait init 0 0 -1 0 3 0x10000 0x200 scheduler swapper ddb> show all locks No such command ddb> show malloc Type InUse MemUse HighUse Limit Requests Type Lim devbuf 11043 12100K 16227K 166960K 12960 0 pcb 17 14K 16K 166960K 280 0 rtable 175 7K 10K 166960K 3192 0 pf 25 12K 16K 166960K 265 0 ifaddr 29 5K 8K 166960K 439 0 ifgroup 35 1K 2K 166960K 474 0 sysctl 3 1K 9K 166960K 10 0 counters 30 17K 18K 166960K 214 0 ioctlops 0 0K 4K 166960K 392 0 iov 1 0K 16K 166960K 89 0 mount 1 1K 1K 166960K 1 0 log 0 0K 0K 166960K 4 0 vnodes 1387 87K 88K 166960K 2700 0 UFS quota 1 32K 32K 166960K 1 0 UFS mount 5 36K 36K 166960K 5 0 shm 2 20K 28K 166960K 11 0 VM map 2 1K 1K 166960K 2 0 sem 28 641K 641K 166960K 46 0 dirhash 15 2K 2K 166960K 24 0 ACPI 1692 195K 286K 166960K 12470 0 file desc 16 61K 97K 166960K 2051 0 sigio 0 0K 0K 166960K 262 0 proc 41 50K 124K 166960K 3157 0 subproc 72 4K 4K 166960K 936 0 NFS srvsock 1 0K 0K 166960K 1 0 NFS daemon 1 16K 16K 166960K 1 0 ip_moptions 0 0K 0K 166960K 46 0 in_multi 59 3K 6K 166960K 1123 0 ether_multi 1 0K 0K 166960K 2 0 mrt 0 0K 0K 166960K 43 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 0K 1K 166960K 1626 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 104 84K 168K 166960K 15086 0 UVM aobj 9 2K 2K 166960K 9 0 pinsyscall 19 38K 96K 166960K 5567 0 memdesc 1 4K 4K 166960K 1 0 crypto data 1 1K 1K 166960K 1 0 ip6_options 0 0K 0K 166960K 21 0 NDP 8 0K 2K 166960K 320 0 temp 44 9107K 9171K 166960K 40926 0 kqueue 1 2K 27K 166960K 180 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 244 0 244 1 0 1 1 0 8 1 rtentry 136 1138 0 1069 4 0 4 4 0 8 0 unpcb 144 437 0 437 4 0 4 4 0 8 4 syncache 336 9 0 9 1 0 1 1 0 8 1 tcpqe 32 4 0 4 1 0 1 1 0 8 1 tcpcb 736 372 0 367 5 0 5 5 0 8 4 arp 96 205 0 194 1 0 1 1 0 8 0 ipq 40 1 0 1 1 0 1 1 0 8 1 ipqe 40 1 0 1 1 0 1 1 0 8 1 inpcb 328 1328 0 1320 9 0 9 9 0 8 7 ip6q 80 4 0 2 1 0 1 1 0 8 0 ip6af 40 4 0 4 1 0 1 1 0 8 1 nd6 112 303 0 291 1 0 1 1 0 8 0 pkpcb 40 5 0 5 1 0 1 1 0 8 1 kcovpl 48 104 0 96 1 0 1 1 0 8 0 ppxss 1072 81 0 81 1 0 1 1 0 8 1 pppxif 1416 3 0 3 1 0 1 1 0 8 1 pfstscr 40 3 0 1 1 0 1 1 0 8 0 pfanchor 1288 1 0 1 1 0 1 1 0 8 1 pfstitem 24 2 0 0 1 0 1 1 0 8 0 pfstkey 128 4 0 2 1 0 1 1 0 8 0 pfstate 384 2 0 1 1 0 1 1 0 8 0 pfrule 1360 3 0 3 1 0 1 1 0 8 1 art_heap8 4096 3 0 0 3 0 3 3 0 8 0 art_heap4 256 4583 0 4251 33 1 32 32 0 8 5 art_table 40 4586 0 4251 6 0 6 6 0 8 1 art_node 32 1137 0 1065 1 0 1 1 0 8 0 sysvmsgpl 40 3 0 1 1 0 1 1 0 8 0 semupl 112 1 0 1 1 0 1 1 0 8 1 semapl 72 41 0 15 1 0 1 1 0 8 0 shmpl 112 6 0 0 1 0 1 1 0 8 0 dirhash 1024 25 0 6 3 0 3 3 0 8 0 dino2pl 256 2691 0 1032 104 0 104 104 0 8 0 ffsino 256 2691 0 1032 104 0 104 104 0 8 0 nchpl 144 3655 0 1568 78 0 78 78 0 8 0 rtmask 32 4 0 4 1 0 1 1 0 8 1 vnodes 216 3906 0 0 217 0 217 217 0 8 0 namei 1024 23309 0 23309 3 0 3 3 0 8 3 acpiwqpl 32 1 0 1 1 0 1 1 1 8 1 kstatmem 264 241 0 224 2 0 2 2 0 8 0 scsiplug 72 3 0 3 1 0 1 1 0 8 1 scxspl 216 12811 0 12811 8 0 8 8 1 8 8 plimitpl 152 237 0 226 1 0 1 1 0 8 0 sigapl 424 2176 0 2124 8 0 8 8 0 8 0 knotepl 120 21283 0 21270 10 0 10 10 0 8 6 kqueuepl 184 309 0 306 4 0 4 4 0 8 3 pipepl 304 497 0 470 8 0 8 8 0 8 5 fdescpl 448 2143 0 2124 5 0 5 5 0 8 1 filepl 120 8705 0 8551 12 0 12 12 0 8 4 lockfpl 104 501 0 500 2 0 2 2 0 8 1 lockfspl 48 108 0 107 1 0 1 1 0 8 0 sessionpl 144 137 0 133 1 0 1 1 0 8 0 pgrppl 48 242 0 230 1 0 1 1 0 8 0 ucredpl 104 770 0 767 1 0 1 1 0 8 0 zombiepl 144 2126 0 2124 1 0 1 1 0 8 0 processpl 1152 2176 0 2124 5 0 5 5 0 8 0 procpl 664 3219 0 3163 7 0 7 7 0 8 1 sockpl 552 2064 0 2056 10 0 10 10 0 8 8 mcl64k 65536 18 0 18 1 0 1 1 0 8 1 mcl16k 16384 2 0 2 1 0 1 1 0 8 1 mcl12k 12288 2 0 2 1 0 1 1 0 8 1 mcl8k 8192 13 0 13 1 0 1 1 0 8 1 mcl4k 4096 3165 0 3100 14 0 14 14 0 8 5 mcl2k2 2112 1 0 1 1 0 1 1 0 8 1 mcl2k 2048 1929 0 1929 1 0 1 1 0 8 1 mextrefs 64 436 0 436 1 0 1 1 0 8 1 mtagpl 96 5 0 5 1 0 1 1 0 8 1 mbufpl 256 16976 0 16861 50 32 18 50 0 8 7 bufpl 272 4715 0 103 308 0 308 308 0 8 0 anonpl 24 228943 0 227521 34 0 34 34 0 187 14 amapchunkpl 152 42661 0 42404 24 0 24 24 0 158 12 amappl16 200 2258 0 2253 6 0 6 6 0 8 4 amappl15 192 2 0 2 1 0 1 1 0 8 1 amappl14 184 1520 0 1517 1 0 1 1 0 8 0 amappl13 176 302 0 301 1 0 1 1 0 8 0 amappl12 168 2784 0 2769 2 0 2 2 0 8 0 amappl11 160 7 0 7 1 0 1 1 0 8 1 amappl10 152 60 0 60 1 0 1 1 0 8 1 amappl9 144 305 0 305 1 0 1 1 0 8 1 amappl8 136 475 0 472 1 0 1 1 0 8 0 amappl7 128 328 0 326 1 0 1 1 0 8 0 amappl6 120 1078 0 1071 1 0 1 1 0 8 0 amappl5 112 93 0 92 1 0 1 1 0 8 0 amappl4 104 629 0 626 1 0 1 1 0 8 0 amappl3 96 8027 0 7980 3 0 3 3 0 8 0 amappl2 88 1916 0 1895 2 0 2 2 0 8 0 amappl1 80 24353 0 24232 13 0 13 13 0 8 7 amappl 88 12727 0 12640 4 0 4 4 0 92 0 uvmvnodes 80 115 0 0 3 0 3 3 0 8 0 dma32768 32768 1 0 1 1 0 1 1 0 8 1 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 254 0 254 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 8 0 0 1 0 1 1 0 8 0 uaddrrnd 24 2143 0 2124 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 2143 0 2124 1 0 1 1 0 8 0 vmmpekpl 168 17617 0 17563 3 0 3 3 0 8 0 vmmpepl 168 143606 0 142964 81 0 81 81 0 357 46 vmsppl 368 2142 0 2124 4 0 4 4 0 8 1 rwobjpl 40 40216 0 39771 11 0 11 11 0 8 0 pdppl 4096 4292 0 4248 174 130 44 82 0 8 0 pvpl 32 738040 0 734539 98 0 98 98 0 265 53 pmappl 216 2142 0 2124 3 0 3 3 0 8 1 extentpl 40 45 0 27 1 0 1 1 0 8 0 phpool 112 820 0 163 20 0 20 20 0 8 0 ddb>