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 *448006 7498 0 0x2 0 0 ifconfig db_enter() at db_enter+0x25 sys/arch/amd64/amd64/db_interface.c:438 panic(ffffffff83497e2e) at panic+0x1cf sys/kern/subr_prf.c:198 __assert(ffffffff834d27d8,ffffffff8340f574,13f,ffffffff8341912e) at __assert+0x29 sys/kern/subr_prf.c:-1 tun_clone_destroy(ffff800001601000) at tun_clone_destroy+0x32d if_clone_destroy(ffff80002a854ff0) at if_clone_destroy+0x1d5 sys/net/if.c:1479 sys_ioctl(ffff8000380d22b8,ffff80002a8551c0,ffff80002a855110) at sys_ioctl+0x660 sys/kern/sys_generic.c:-1 syscall(ffff80002a8551c0) at syscall+0x962 mi_syscall sys/sys/syscall_mi.h:-1 [inline] syscall(ffff80002a8551c0) at syscall+0x962 sys/arch/amd64/amd64/trap.c:791 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x7cb218a35460, 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(ffffffff83497e2e) at panic+0x1cf sys/kern/subr_prf.c:198 __assert(ffffffff834d27d8,ffffffff8340f574,13f,ffffffff8341912e) at __assert+0x29 sys/kern/subr_prf.c:-1 tun_clone_destroy(ffff800001601000) at tun_clone_destroy+0x32d if_clone_destroy(ffff80002a854ff0) at if_clone_destroy+0x1d5 sys/net/if.c:1479 sys_ioctl(ffff8000380d22b8,ffff80002a8551c0,ffff80002a855110) at sys_ioctl+0x660 sys/kern/sys_generic.c:-1 syscall(ffff80002a8551c0) at syscall+0x962 mi_syscall sys/sys/syscall_mi.h:-1 [inline] syscall(ffff80002a8551c0) at syscall+0x962 sys/arch/amd64/amd64/trap.c:791 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x7cb218a35460, count: -8 ddb> show registers rdi 0 rsi 0x1 rbp 0xffff80002a854e80 rbx 0 rdx 0 rcx 0 rax 0xffff8000380d22b8 r8 0x101010101010101 r9 0x8080808080808080 r10 0xb5ae209d96b6fa55 r11 0x734802fbdbfd71d9 r12 0 r13 0xffffffff83983330 tap_cloner r14 0 r15 0x1 rip 0xffffffff82592255 db_enter+0x25 cs 0x8 rflags 0x246 rsp 0xffff80002a854e70 ss 0x10 db_enter+0x25: addq $0x8,%rsp ddb> show proc PROC (ifconfig) tid=448006 pid=7498 tcnt=1 stat=onproc flags process=2 proc=0 runpri=32, usrpri=50, slppri=32, nice=20 wchan=0x0, wmesg=, ps_single=0x0 scnt=0 ecnt=0 forw=0xffffffffffffffff, list=0xffff8000380d3778,0xffff8000380d2560 process=0xffff8000380d9fd0 user=0xffff80002a850000, vmspace=0xfffffb806d1885d0 estcpu=36, cpticks=0, pctcpu=0.0, user=0, sys=0, intr=0 ddb> ps PID TID PPID UID S PRLAGS PFLAGS WAIT COMMAND 3456 255528 2579 0 2 0 0 syz-executor * 7498 448006 46367 0 7 0x2 0 ifconfig 46367 268411 34579 0 3 0x100002 0x88 sigsusp sh 34579 397275 2579 0 3 0x2 0x80 wait syz-executor 68911 143625 50333 0 2 0x2 0 ifconfig 50333 27006 23316 0 3 0x100002 0x88 sigsusp sh 23316 230858 2579 0 3 0x2 0x80 wait syz-executor 74563 502778 48398 0 2 0x2 0 ifconfig 48398 302585 34703 0 3 0x100002 0x88 sigsusp sh 34703 259619 2579 0 3 0x2 0x80 wait syz-executor 26411 427651 2579 0 3 0x2 0x80 piperd syz-executor 97199 66368 0 0 3 0x14000 0x280 nfsidl nfsio 79425 39340 0 0 3 0x14000 0x280 nfsidl nfsio 59628 226599 0 0 3 0x14000 0x280 nfsidl nfsio 73872 286268 0 0 3 0x14000 0x280 nfsidl nfsio 86302 241410 0 0 3 0x14000 0x280 nfsidl nfsio 9299 492009 0 0 3 0x14000 0x280 nfsidl nfsio 65757 486968 0 0 3 0x14000 0x280 nfsidl nfsio 84656 110848 0 0 3 0x14000 0x280 nfsidl nfsio 97595 381877 0 0 3 0x14000 0x280 nfsidl nfsio 58948 256034 0 0 3 0x14000 0x280 nfsidl nfsio 40076 178181 0 0 3 0x14000 0x280 nfsidl nfsio 84042 511890 0 0 3 0x14000 0x280 nfsidl nfsio 25644 464573 0 0 3 0x14000 0x280 nfsidl nfsio 93027 416206 0 0 3 0x14000 0x280 nfsidl nfsio 13972 37373 0 0 3 0x14000 0x280 nfsidl nfsio 85565 348685 0 0 3 0x14000 0x280 nfsidl nfsio 59157 134996 0 0 3 0x14000 0x280 nfsidl nfsio 63283 80867 0 0 3 0x14000 0x280 nfsidl nfsio 69649 205945 0 0 3 0x14000 0x280 nfsidl nfsio 96131 343712 0 0 3 0x14000 0x280 nfsidl nfsio 59081 328888 2579 0 3 0x2 0x80 piperd syz-executor 92466 344454 2579 0 3 0x2 0x80 piperd syz-executor 2579 286753 19394 0 2 0x2 0 syz-executor 19394 256344 45456 0 3 0x100002 0x88 sigsusp ksh 45456 209704 19748 0 3 0x10 0x88 kqread sshd-session 19748 434877 27550 0 3 0x12 0x80 kqread sshd-session 68587 104296 1 0 3 0x100003 0x80 ttyin getty 27550 254360 1 0 3 0 0x88 kqread sshd 39682 327944 92951 73 3 0x1100010 0x80 kqread syslogd 92951 225011 1 0 3 0x100002 0x80 sbwait syslogd 71772 177508 1 0 3 0x100000 0x80 kqread resolvd 56623 215216 96953 77 2 0x100012 0 dhcpleased 38230 229372 96953 77 3 0x100012 0x80 kqread dhcpleased 96953 412322 1 0 3 0 0x80 kqread dhcpleased 18850 516663 0 0 3 0x14000 0x200 bored smr 91058 89420 0 0 2 0x14000 0x200 zerothread 89346 232067 0 0 3 0x14000 0x200 aiodoned aiodoned 26 467606 0 0 3 0x14000 0x200 syncer update 41265 373553 0 0 3 0x14000 0x200 cleaner cleaner 88691 219498 0 0 3 0x14000 0x200 reaper reaper 9268 72152 0 0 3 0x14000 0x200 pgdaemon pagedaemon 70801 171845 0 0 3 0x14000 0x200 bored viomb 27933 5262 0 0 3 0x14000 0x40000200 acpi0 acpi0 21602 243485 0 0 3 0x14000 0x200 bored softnet0 37415 116444 0 0 3 0x14000 0x200 smrbar systqmp 64408 177625 0 0 3 0x14000 0x200 bored systq 99580 250138 0 0 3 0x14000 0x40000200 tmoslp softclock 6636 150076 0 0 3 0x14000 0x40000200 idle0 1 185994 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 11018 12095K 12604K 166960K 12452 0 pcb 17 13K 13K 166960K 35 0 rtable 138 6K 9K 166960K 1307 0 pf 25 12K 653K 166960K 118 0 ifaddr 23 4K 7K 166960K 181 0 ifgroup 34 1K 2K 166960K 205 0 sysctl 1 1K 9K 166960K 5 0 counters 29 17K 18K 166960K 77 0 ioctlops 0 0K 4K 166960K 103 0 iov 0 0K 12K 166960K 4 0 mount 1 1K 1K 166960K 1 0 log 0 0K 0K 166960K 4 0 vnodes 1318 83K 83K 166960K 1824 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 10 0K 0K 166960K 14 0 dirhash 12 2K 2K 166960K 18 0 ACPI 1692 195K 286K 166960K 12470 0 file desc 15 50K 240K 166960K 771 0 sigio 0 0K 0K 166960K 2 0 proc 81 83K 91K 166960K 1417 0 subproc 54 3K 4K 166960K 387 0 NFS srvsock 1 0K 0K 166960K 1 0 NFS daemon 1 16K 16K 166960K 1 0 ip_moptions 0 0K 0K 166960K 8 0 in_multi 44 2K 6K 166960K 440 0 ether_multi 1 0K 0K 166960K 1 0 mrt 0 0K 0K 166960K 13 0 ISOFS mount 1 32K 32K 166960K 1 0 MSDOSFS mount 1 16K 16K 166960K 1 0 ttys 61 281K 281K 166960K 61 0 exec 0 0K 1K 166960K 795 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 161 128K 158K 166960K 6758 0 UVM aobj 5 2K 2K 166960K 5 0 pinsyscall 36 72K 92K 166960K 2690 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 9 0K 2K 166960K 129 0 temp 29 9110K 9158K 166960K 7725 0 kqueue 13 20K 26K 166960K 51 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 364 0 361 3 0 3 3 0 8 2 rtentry 136 453 0 398 4 0 4 4 0 8 0 unpcb 144 164 0 149 1 0 1 1 0 8 0 syncache 336 4 0 4 1 0 1 1 0 8 1 tcpcb 736 31 0 27 1 0 1 1 0 8 0 arp 96 80 0 72 1 0 1 1 0 8 0 ipq 40 1 0 1 1 0 1 1 0 8 1 ipqe 40 2 0 2 1 0 1 1 0 8 1 inpcb 328 599 0 589 7 0 7 7 0 8 6 ip6q 80 1 0 0 1 0 1 1 0 8 0 nd6 112 118 0 109 1 0 1 1 0 8 0 kcovpl 48 43 0 37 1 0 1 1 0 8 0 ppxss 1072 8 0 8 1 0 1 1 0 8 1 pfstscr 40 5 0 5 1 0 1 1 0 8 1 pftag 88 1 0 0 1 0 1 1 0 8 0 pfstkey 128 6 0 6 1 0 1 1 0 8 1 pfstate 384 3 0 3 1 0 1 1 0 8 1 pfrule 1360 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 1842 0 1560 29 0 29 29 0 8 6 art_table 40 1843 0 1560 5 0 5 5 0 8 0 art_node 32 453 0 392 1 0 1 1 0 8 0 sysvmsgpl 40 1 0 1 1 0 1 1 0 8 1 semapl 72 12 0 4 1 0 1 1 0 8 0 shmpl 120 2 0 0 1 0 1 1 0 8 0 dirhash 1024 21 0 4 3 0 3 3 0 8 0 dino2pl 256 1891 0 368 96 0 96 96 0 8 0 ffsino 256 1891 0 368 96 0 96 96 0 8 0 nchpl 144 2257 0 434 68 0 68 68 0 8 0 rtmask 32 2 0 2 1 0 1 1 0 8 1 vnodes 216 2371 0 0 132 0 132 132 0 8 0 namei 1024 11579 0 11579 3 0 3 3 0 8 3 kstatmem 264 103 0 88 2 0 2 2 0 8 0 scsiplug 72 6 0 6 1 0 1 1 0 8 1 scxspl 216 8558 0 8558 8 0 8 8 1 8 8 plimitpl 152 84 0 69 1 0 1 1 0 8 0 sigapl 424 1006 0 945 8 0 8 8 0 8 0 knotepl 120 8934 0 8891 16 5 11 16 0 8 8 kqueuepl 184 93 0 84 1 0 1 1 0 8 0 pipepl 304 233 0 203 3 0 3 3 0 8 0 fdescpl 448 973 0 946 4 0 4 4 0 8 0 filepl 120 3788 0 3605 11 0 11 11 0 8 3 lockfpl 104 78 0 76 1 0 1 1 0 8 0 lockfspl 48 36 0 34 1 0 1 1 0 8 0 sessionpl 144 63 0 55 1 0 1 1 0 8 0 pgrppl 48 108 0 93 1 0 1 1 0 8 0 ucredpl 104 213 0 202 1 0 1 1 0 8 0 zombiepl 144 946 0 945 1 0 1 1 0 8 0 processpl 1160 1006 0 945 5 0 5 5 0 8 0 procpl 664 1284 0 1223 7 0 7 7 0 8 1 sockpl 552 1133 0 1105 13 3 10 12 0 8 7 mcl64k 65536 4 0 4 1 0 1 1 0 8 1 mcl8k 8192 5 0 5 1 0 1 1 0 8 1 mcl4k 4096 2639 0 2584 15 0 15 15 0 8 7 mcl2k 2048 777 0 775 1 0 1 1 0 8 0 mextrefs 64 147 0 145 1 0 1 1 0 8 0 mtagpl 96 4 0 4 1 0 1 1 0 8 1 mbufpl 256 7999 0 7893 11 0 11 11 0 8 1 bufpl 272 3597 0 103 233 0 233 233 0 8 0 anonpl 24 111199 0 108413 46 0 46 46 0 187 24 amapchunkpl 152 17690 0 17407 22 0 22 22 0 158 9 amappl16 200 1007 0 995 14 4 10 14 0 8 8 amappl15 192 42 0 42 1 0 1 1 0 8 1 amappl14 184 795 0 791 1 0 1 1 0 8 0 amappl13 176 214 0 204 1 0 1 1 0 8 0 amappl12 168 1338 0 1314 2 0 2 2 0 8 0 amappl11 160 2 0 2 1 0 1 1 0 8 1 amappl10 152 59 0 49 1 0 1 1 0 8 0 amappl9 144 271 0 271 1 0 1 1 0 8 1 amappl8 136 226 0 222 1 0 1 1 0 8 0 amappl7 128 203 0 191 1 0 1 1 0 8 0 amappl6 120 466 0 458 1 0 1 1 0 8 0 amappl5 112 134 0 125 1 0 1 1 0 8 0 amappl4 104 353 0 337 1 0 1 1 0 8 0 amappl3 96 3449 0 3390 3 0 3 3 0 8 0 amappl2 88 959 0 897 2 0 2 2 0 8 0 amappl1 80 14937 0 14393 14 0 14 14 0 8 2 amappl 88 5505 0 5406 5 0 5 5 0 92 1 uvmvnodes 80 97 0 0 2 0 2 2 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 4 0 0 1 0 1 1 0 8 0 uaddrrnd 24 973 0 946 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 973 0 946 1 0 1 1 0 8 0 vmmpekpl 168 9328 0 9284 3 0 3 3 0 8 0 vmmpepl 168 70364 0 68884 85 0 85 85 0 357 15 vmsppl 368 972 0 946 4 0 4 4 0 8 1 rwobjpl 40 21732 0 20845 13 0 13 13 0 8 1 pdppl 4096 1952 0 1892 114 48 66 74 0 8 6 pvpl 32 353731 0 346717 120 0 120 120 0 265 46 pmappl 216 972 0 946 2 0 2 2 0 8 0 extentpl 40 45 0 27 1 0 1 1 0 8 0 phpool 112 618 0 48 17 0 17 17 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(ffffffff83497e2e) at panic+0x1cf sys/kern/subr_prf.c:198 __assert(ffffffff834d27d8,ffffffff8340f574,13f,ffffffff8341912e) at __assert+0x29 sys/kern/subr_prf.c:-1 tun_clone_destroy(ffff800001601000) at tun_clone_destroy+0x32d if_clone_destroy(ffff80002a854ff0) at if_clone_destroy+0x1d5 sys/net/if.c:1479 sys_ioctl(ffff8000380d22b8,ffff80002a8551c0,ffff80002a855110) at sys_ioctl+0x660 sys/kern/sys_generic.c:-1 syscall(ffff80002a8551c0) at syscall+0x962 mi_syscall sys/sys/syscall_mi.h:-1 [inline] syscall(ffff80002a8551c0) at syscall+0x962 sys/arch/amd64/amd64/trap.c:791 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x7cb218a35460, 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(ffffffff83497e2e) at panic+0x1cf sys/kern/subr_prf.c:198 __assert(ffffffff834d27d8,ffffffff8340f574,13f,ffffffff8341912e) at __assert+0x29 sys/kern/subr_prf.c:-1 tun_clone_destroy(ffff800001601000) at tun_clone_destroy+0x32d if_clone_destroy(ffff80002a854ff0) at if_clone_destroy+0x1d5 sys/net/if.c:1479 sys_ioctl(ffff8000380d22b8,ffff80002a8551c0,ffff80002a855110) at sys_ioctl+0x660 sys/kern/sys_generic.c:-1 syscall(ffff80002a8551c0) at syscall+0x962 mi_syscall sys/sys/syscall_mi.h:-1 [inline] syscall(ffff80002a8551c0) at syscall+0x962 sys/arch/amd64/amd64/trap.c:791 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x7cb218a35460, count: -8