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 *379359 37031 0 0x2 0 0 ifconfig db_enter() at db_enter+0x25 sys/arch/amd64/amd64/db_interface.c:438 panic(ffffffff834b4ffd) at panic+0x1cf sys/kern/subr_prf.c:198 __assert(ffffffff834f00bc,ffffffff834285dc,13f,ffffffff8343217e) at __assert+0x29 sys/kern/subr_prf.c:-1 tun_clone_destroy(ffff8000015e9000) at tun_clone_destroy+0x32d if_clone_destroy(ffff80002a847d30) at if_clone_destroy+0x1d5 sys/net/if.c:1464 sys_ioctl(ffff80003c9894f0,ffff80002a847f00,ffff80002a847e50) at sys_ioctl+0x660 sys/kern/sys_generic.c:-1 syscall(ffff80002a847f00) at syscall+0x962 mi_syscall sys/sys/syscall_mi.h:-1 [inline] syscall(ffff80002a847f00) at syscall+0x962 sys/arch/amd64/amd64/trap.c:791 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x7791f40d0520, 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(ffffffff834b4ffd) at panic+0x1cf sys/kern/subr_prf.c:198 __assert(ffffffff834f00bc,ffffffff834285dc,13f,ffffffff8343217e) at __assert+0x29 sys/kern/subr_prf.c:-1 tun_clone_destroy(ffff8000015e9000) at tun_clone_destroy+0x32d if_clone_destroy(ffff80002a847d30) at if_clone_destroy+0x1d5 sys/net/if.c:1464 sys_ioctl(ffff80003c9894f0,ffff80002a847f00,ffff80002a847e50) at sys_ioctl+0x660 sys/kern/sys_generic.c:-1 syscall(ffff80002a847f00) at syscall+0x962 mi_syscall sys/sys/syscall_mi.h:-1 [inline] syscall(ffff80002a847f00) at syscall+0x962 sys/arch/amd64/amd64/trap.c:791 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x7791f40d0520, count: -8 ddb> show registers rdi 0 rsi 0x1 rbp 0xffff80002a847bc0 rbx 0 rdx 0 rcx 0 rax 0xffff80003c9894f0 r8 0x101010101010101 r9 0x8080808080808080 r10 0x6551ceeb7452466a r11 0x96cdd577f71ce368 r12 0 r13 0xffffffff8392fc10 tap_cloner r14 0 r15 0x1 rip 0xffffffff815c9105 db_enter+0x25 cs 0x8 rflags 0x246 rsp 0xffff80002a847bb0 ss 0x10 db_enter+0x25: addq $0x8,%rsp ddb> show proc PROC (ifconfig) tid=379359 pid=37031 tcnt=1 stat=onproc flags process=2 proc=0 runpri=32, usrpri=86, slppri=32, nice=20 wchan=0x0, wmesg=, ps_single=0x0 scnt=0 ecnt=0 forw=0xffffffffffffffff, list=0xffff80003c9887f8,0xffff80003c988aa0 process=0xffff800045ff96c8 user=0xffff80002a842000, vmspace=0xfffff0007f215cf0 estcpu=36, cpticks=1, pctcpu=0.0, user=0, sys=1, intr=0 ddb> ps PID TID PPID UID S PRLAGS PFLAGS WAIT COMMAND 15015 490566 43958 0 3 0x2 0 clonelk ifconfig *37031 379359 64608 0 7 0x2 0 ifconfig 43958 290915 81660 0 3 0x100002 0x88 sigsusp sh 64608 75444 91341 0 3 0x100002 0x88 sigsusp sh 22913 412778 20598 0 3 0x1000 0x2000 suspend syz-executor 22913 508043 20598 0 2 0x1000 0x4080000 syz-executor 22913 226254 20598 0 3 0x1000 0x4080000 inode syz-executor 22913 48986 20598 0 3 0x1000 0x4080000 inode syz-executor 81660 109120 92123 0 3 0x2 0x80 wait syz-executor 91341 389836 92123 0 3 0x2 0x80 wait syz-executor 68914 103903 21589 0 2 0 0xc80 syz-executor 68914 418547 21589 0 3 0 0x4000080 lockf syz-executor 68914 356692 21589 0 3 0 0x4000080 fsleep syz-executor 7062 157401 92123 0 2 0x2 0 syz-executor 94672 40508 92123 0 2 0x2 0 syz-executor 95255 63564 92123 0 2 0x2 0 syz-executor 20598 315545 92123 0 3 0x2 0x80 nanoslp syz-executor 21589 265465 92123 0 2 0x2 0xc80 syz-executor 82217 7974 0 0 3 0x14000 0x280 nfsidl nfsio 10882 134036 0 0 3 0x14000 0x280 nfsidl nfsio 50945 178895 0 0 3 0x14000 0x280 nfsidl nfsio 87685 254226 0 0 3 0x14000 0x280 nfsidl nfsio 92546 55872 0 0 3 0x14000 0x280 nfsidl nfsio 50070 182917 0 0 3 0x14000 0x280 nfsidl nfsio 19058 2840 0 0 3 0x14000 0x280 nfsidl nfsio 75958 351700 0 0 3 0x14000 0x280 nfsidl nfsio 38448 210579 0 0 3 0x14000 0x280 nfsidl nfsio 30573 81109 0 0 3 0x14000 0x280 nfsidl nfsio 80169 422636 0 0 3 0x14000 0x280 nfsidl nfsio 83568 519842 0 0 3 0x14000 0x280 nfsidl nfsio 66031 283828 0 0 3 0x14000 0x280 nfsidl nfsio 13373 386632 0 0 3 0x14000 0x280 nfsidl nfsio 68022 112442 0 0 3 0x14000 0x280 nfsidl nfsio 2468 195970 0 0 3 0x14000 0x280 nfsidl nfsio 87291 409823 0 0 3 0x14000 0x280 nfsidl nfsio 89608 373560 0 0 3 0x14000 0x280 nfsidl nfsio 94372 117414 0 0 3 0x14000 0x280 nfsidl nfsio 52767 110475 0 0 3 0x14000 0x280 nfsidl nfsio 92123 198736 3869 0 3 0x2 0x80 nanoslp syz-executor 3869 374391 53475 0 3 0x100002 0x88 sigsusp ksh 53475 251907 92644 0 3 0x10 0x88 kqread sshd-session 92644 467014 31436 0 3 0x12 0x80 kqread sshd-session 2537 313369 1 0 3 0x100003 0x80 ttyin getty 31436 281325 1 0 3 0 0x88 kqread sshd 27385 522506 35880 73 3 0x1100010 0x80 kqread syslogd 35880 252571 1 0 3 0x100002 0x80 sbwait syslogd-parent 12743 49156 1 0 3 0x100000 0x80 kqread resolvd 4487 267547 81129 77 2 0x100012 0 dhcpleased 45802 294449 81129 77 3 0x100012 0x80 kqread dhcpleased 81129 61568 1 0 3 0 0x80 kqread dhcpleased 39015 166256 0 0 3 0x14000 0x200 bored smr 60901 516071 0 0 2 0x14000 0x200 zerothread 43399 191966 0 0 3 0x14000 0x200 aiodoned aiodoned 29558 321508 0 0 3 0x14000 0x200 syncer update 55665 64747 0 0 3 0x14000 0x200 cleaner cleaner 13037 107505 0 0 3 0x14000 0x200 reaper reaper 18391 420314 0 0 3 0x14000 0x200 pgdaemon pagedaemon 41427 447320 0 0 3 0x14000 0x200 bored viomb 48157 428393 0 0 3 0x14000 0x40000200 acpi0 acpi0 12607 479249 0 0 2 0x14000 0x200 softnet0 82096 194368 0 0 3 0x14000 0x200 smrbar systqmp 75356 217136 0 0 3 0x14000 0x200 bored systq 31632 109539 0 0 3 0x14000 0x40000200 tmoslp softclock 86069 334429 0 0 3 0x14000 0x40000200 idle0 1 421462 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 11024 12098K 12184K 166960K 12565 0 pcb 18 14K 16K 166960K 265 0 rtable 293 8K 11K 166960K 3426 0 pf 26 12K 13K 166960K 206 0 ifaddr 23 4K 7K 166960K 371 0 ifgroup 42 1K 2K 166960K 384 0 sysctl 4 1K 9K 166960K 10 0 counters 31 17K 17K 166960K 119 0 ioctlops 0 0K 4K 166960K 164 0 iov 0 0K 12K 166960K 16 0 mount 1 1K 1K 166960K 1 0 log 0 0K 0K 166960K 4 0 vnodes 1326 83K 84K 166960K 2392 0 UFS quota 1 32K 32K 166960K 1 0 UFS mount 5 36K 36K 166960K 5 0 shm 3 5K 5K 166960K 6 0 VM map 2 1K 1K 166960K 2 0 sem 22 1K 1K 166960K 29 0 dirhash 15 2K 3K 166960K 24 0 ACPI 1734 201K 291K 166960K 11964 0 file desc 15 53K 93K 166960K 1609 0 sigio 0 0K 0K 166960K 2 0 proc 73 75K 108K 166960K 2784 0 subproc 63 3K 4K 166960K 838 0 NFS srvsock 1 0K 0K 166960K 1 0 NFS daemon 1 16K 16K 166960K 1 0 ip_moptions 0 0K 0K 166960K 22 0 in_multi 33 2K 6K 166960K 972 0 ether_multi 1 0K 0K 166960K 1 0 mrt 0 0K 0K 166960K 24 0 ISOFS mount 1 32K 32K 166960K 1 0 MSDOSFS mount 1 16K 16K 166960K 1 0 ttys 49 228K 228K 166960K 49 0 exec 0 0K 1K 166960K 1444 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 177 135K 156K 166960K 11728 0 UVM aobj 10 2K 6K 166960K 12 0 pinsyscall 36 72K 95K 166960K 4781 0 memdesc 1 4K 4K 166960K 1 0 crypto data 1 1K 1K 166960K 1 0 ip6_options 0 0K 0K 166960K 12 0 NDP 11 0K 2K 166960K 269 0 temp 31 9118K 9182K 166960K 21398 0 kqueue 13 20K 28K 166960K 63 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 534 0 530 3 0 3 3 0 8 2 rtentry 136 1148 0 1100 4 0 4 4 0 8 0 unpcb 144 605 0 590 6 0 6 6 0 8 5 syncache 336 10 0 10 1 0 1 1 0 8 1 tcpqe 32 2 0 2 1 0 1 1 0 8 1 tcpcb 736 88 0 82 1 0 1 1 0 8 0 arp 96 176 0 170 1 0 1 1 0 8 0 ipq 40 4 0 1 1 0 1 1 0 8 0 ipqe 40 38 0 34 1 0 1 1 0 8 0 inpcb 328 1512 0 1435 13 3 10 13 0 8 3 ip6q 80 2 0 0 1 0 1 1 0 8 0 ip6af 40 2 0 0 1 0 1 1 0 8 0 nd6 112 262 0 256 1 0 1 1 0 8 0 pkpcb 40 5 0 5 1 0 1 1 0 8 1 kcovpl 48 93 0 86 1 0 1 1 0 8 0 ppxss 1072 3 0 3 1 0 1 1 0 8 1 pfosfp 40 1 0 0 1 0 1 1 0 8 0 pfosfpen 112 1 0 0 1 0 1 1 0 8 0 pfrule 1360 1 0 0 1 0 1 1 0 8 0 art_heap8 4096 3 0 0 3 0 3 3 0 8 0 art_heap4 256 3998 0 3678 34 2 32 32 0 8 6 art_table 40 4001 0 3678 6 0 6 6 0 8 0 art_node 32 1148 0 1095 2 0 2 2 0 8 0 semupl 112 2 0 2 1 0 1 1 0 8 1 semapl 72 26 0 6 1 0 1 1 0 8 0 shmpl 120 7 0 0 1 0 1 1 0 8 0 dirhash 1024 25 0 6 3 0 3 3 0 8 0 dino2pl 256 2128 0 473 104 0 104 104 0 8 0 ffsino 256 2128 0 473 104 0 104 104 0 8 0 nchpl 144 2661 0 662 75 0 75 75 0 8 0 vnodes 216 3161 0 0 176 0 176 176 0 8 0 namei 1024 18498 0 18497 4 0 4 4 0 8 3 vcpupl 3968 32 0 32 4 0 4 4 0 8 4 vmpool 808 2 0 2 1 0 1 1 0 8 1 kstatmem 264 191 0 172 2 0 2 2 0 8 0 scsiplug 72 1 0 1 1 0 1 1 0 8 1 scxspl 216 24883 0 24883 8 0 8 8 1 8 8 plimitpl 152 435 0 419 1 0 1 1 0 8 0 sigapl 424 1746 0 1686 8 0 8 8 0 8 0 knotepl 120 25847 0 25800 10 0 10 10 0 8 7 kqueuepl 184 372 0 363 3 0 3 3 0 8 2 pipepl 304 391 0 364 3 0 3 3 0 8 0 fdescpl 448 1713 0 1686 5 0 5 5 0 8 1 filepl 120 7660 0 7366 13 0 13 13 0 8 3 lockfpl 104 259 0 255 2 0 2 2 0 8 1 lockfspl 48 42 0 39 1 0 1 1 0 8 0 sessionpl 144 117 0 109 1 0 1 1 0 8 0 pgrppl 48 211 0 196 1 0 1 1 0 8 0 ucredpl 104 350 0 339 1 0 1 1 0 8 0 zombiepl 144 1687 0 1686 1 0 1 1 0 8 0 processpl 1160 1746 0 1686 5 0 5 5 0 8 0 procpl 664 2281 0 2216 8 0 8 8 0 8 1 sosppl 176 2 0 2 1 0 1 1 0 8 1 sockpl 552 2663 0 2567 21 10 11 17 0 8 4 mcl64k 65536 11 0 9 1 0 1 1 0 8 0 mcl16k 16384 2 0 2 1 0 1 1 0 8 1 mcl12k 12288 1 0 1 1 0 1 1 0 8 1 mcl9k128 9344 1 0 1 1 0 1 1 0 8 1 mcl8k 8192 14 0 14 1 0 1 1 0 8 1 mcl4k 4096 2860 0 2808 15 0 15 15 0 8 8 mcl2k 2048 1741 0 1722 3 0 3 3 0 8 0 mextrefs 64 348 0 329 1 0 1 1 0 8 0 mtagpl 96 4 0 4 1 0 1 1 0 8 1 mbufpl 256 16245 0 16074 132 114 18 72 0 8 7 bufpl 272 10935 0 4712 415 0 415 415 0 8 0 anonpl 24 213793 0 210334 49 0 49 49 0 187 13 amapchunkpl 152 31497 0 31161 24 0 24 24 0 158 10 amappl16 200 3384 0 3337 32 22 10 14 0 8 7 amappl15 192 11 0 11 1 0 1 1 0 8 1 amappl14 184 1359 0 1355 1 0 1 1 0 8 0 amappl13 176 277 0 267 1 0 1 1 0 8 0 amappl12 168 2367 0 2342 2 0 2 2 0 8 0 amappl11 160 8 0 8 1 0 1 1 0 8 1 amappl10 152 57 0 49 1 0 1 1 0 8 0 amappl9 144 281 0 281 1 0 1 1 0 8 1 amappl8 136 410 0 407 1 0 1 1 0 8 0 amappl7 128 300 0 289 1 0 1 1 0 8 0 amappl6 120 633 0 630 1 0 1 1 0 8 0 amappl5 112 454 0 446 1 0 1 1 0 8 0 amappl4 104 543 0 530 1 0 1 1 0 8 0 amappl3 96 6747 0 6662 4 0 4 4 0 8 1 amappl2 88 758 0 708 2 0 2 2 0 8 0 amappl1 80 21418 0 20877 13 0 13 13 0 8 1 amappl 88 9664 0 9548 4 0 4 4 0 92 0 uvmvnodes 80 103 0 0 3 0 3 3 0 8 0 dma4096 4096 1 0 1 1 0 1 1 0 8 1 dma1024 1024 2 0 1 1 0 1 1 0 8 0 dma256 256 8 0 8 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 11 0 2 1 0 1 1 0 8 0 uaddrrnd 24 1713 0 1686 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 1713 0 1686 1 0 1 1 0 8 0 vmmpekpl 168 14143 0 14083 4 0 4 4 0 8 0 vmmpepl 168 119073 0 117507 90 0 90 90 0 357 15 vmsppl 368 1712 0 1686 4 0 4 4 0 8 1 rwobjpl 40 35469 0 34527 13 0 13 13 0 8 0 pdppl 4096 3436 0 3376 159 91 68 80 0 8 8 pvpl 32 621911 0 613863 110 0 110 110 0 265 25 pmappl 216 1714 0 1688 3 0 3 3 0 8 1 extentpl 40 46 0 28 1 0 1 1 0 8 0 phpool 112 995 0 207 24 0 24 24 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(ffffffff834b4ffd) at panic+0x1cf sys/kern/subr_prf.c:198 __assert(ffffffff834f00bc,ffffffff834285dc,13f,ffffffff8343217e) at __assert+0x29 sys/kern/subr_prf.c:-1 tun_clone_destroy(ffff8000015e9000) at tun_clone_destroy+0x32d if_clone_destroy(ffff80002a847d30) at if_clone_destroy+0x1d5 sys/net/if.c:1464 sys_ioctl(ffff80003c9894f0,ffff80002a847f00,ffff80002a847e50) at sys_ioctl+0x660 sys/kern/sys_generic.c:-1 syscall(ffff80002a847f00) at syscall+0x962 mi_syscall sys/sys/syscall_mi.h:-1 [inline] syscall(ffff80002a847f00) at syscall+0x962 sys/arch/amd64/amd64/trap.c:791 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x7791f40d0520, 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(ffffffff834b4ffd) at panic+0x1cf sys/kern/subr_prf.c:198 __assert(ffffffff834f00bc,ffffffff834285dc,13f,ffffffff8343217e) at __assert+0x29 sys/kern/subr_prf.c:-1 tun_clone_destroy(ffff8000015e9000) at tun_clone_destroy+0x32d if_clone_destroy(ffff80002a847d30) at if_clone_destroy+0x1d5 sys/net/if.c:1464 sys_ioctl(ffff80003c9894f0,ffff80002a847f00,ffff80002a847e50) at sys_ioctl+0x660 sys/kern/sys_generic.c:-1 syscall(ffff80002a847f00) at syscall+0x962 mi_syscall sys/sys/syscall_mi.h:-1 [inline] syscall(ffff80002a847f00) at syscall+0x962 sys/arch/amd64/amd64/trap.c:791 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x7791f40d0520, count: -8