login: panic: kernel diagnostic assertion "sc->sc_dev == 0" failed: file "/syzkaller/managers/multicore/kernel/sys/net/if_tun.c", line 305 Stopped at db_enter+0x18: addq $0x8,%rsp TID PID UID PRFLAGS PFLAGS CPU COMMAND *413332 99444 0 0 0x4000000 0K syz-executor.1 db_enter() at db_enter+0x18 sys/arch/amd64/amd64/db_interface.c:440 panic(ffffffff825739a5) at panic+0x177 sys/kern/subr_prf.c:202 __assert(ffffffff825e91ae,ffffffff82632dac,131,ffffffff825fdeb9) at __assert+0x25 sys/kern/subr_prf.c:161 tun_clone_destroy(ffff800000d83800) at tun_clone_destroy+0x278 sys/net/if_tun.c:305 if_clone_destroy(ffff80002e3d6f10) at if_clone_destroy+0x132 sys/net/if.c:1218 soo_ioctl(fffffd806f2a56a0,80206979,ffff80002e3d6f10,ffff8000262ae2a8) at soo_ioctl+0x26c sys_ioctl(ffff8000262ae2a8,ffff80002e3d7028,ffff80002e3d7080) at sys_ioctl+0x4a2 syscall(ffff80002e3d70f0) at syscall+0x489 mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff80002e3d70f0) at syscall+0x489 sys/arch/amd64/amd64/trap.c:585 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x35f3df0e410, 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{0}> ddb{0}> set $lines = 0 ddb{0}> set $maxwidth = 0 ddb{0}> show panic *cpu0: kernel diagnostic assertion "sc->sc_dev == 0" failed: file "/syzkaller/managers/multicore/kernel/sys/net/if_tun.c", line 305 ddb{0}> trace db_enter() at db_enter+0x18 sys/arch/amd64/amd64/db_interface.c:440 panic(ffffffff825739a5) at panic+0x177 sys/kern/subr_prf.c:202 __assert(ffffffff825e91ae,ffffffff82632dac,131,ffffffff825fdeb9) at __assert+0x25 sys/kern/subr_prf.c:161 tun_clone_destroy(ffff800000d83800) at tun_clone_destroy+0x278 sys/net/if_tun.c:305 if_clone_destroy(ffff80002e3d6f10) at if_clone_destroy+0x132 sys/net/if.c:1218 soo_ioctl(fffffd806f2a56a0,80206979,ffff80002e3d6f10,ffff8000262ae2a8) at soo_ioctl+0x26c sys_ioctl(ffff8000262ae2a8,ffff80002e3d7028,ffff80002e3d7080) at sys_ioctl+0x4a2 syscall(ffff80002e3d70f0) at syscall+0x489 mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff80002e3d70f0) at syscall+0x489 sys/arch/amd64/amd64/trap.c:585 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x35f3df0e410, count: -9 ddb{0}> show registers rdi 0 rsi 0x1 rbp 0xffff80002e3d6d20 rbx 0xffffffff82920bff cpu_info_full_primary+0x2bff rdx 0 rcx 0 rax 0xffff8000262ae2a8 r8 0 r9 0x8080808080808080 r10 0x1da266e8da8d3557 r11 0xc0132302060c9889 r12 0xffffffff82920a00 cpu_info_full_primary+0x2a00 r13 0 r14 0 r15 0x1 rip 0xffffffff8147cfe8 db_enter+0x18 cs 0x8 rflags 0x246 rsp 0xffff80002e3d6d10 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb{0}> show proc PROC (syz-executor.1) pid=413332 stat=onproc flags process=0 proc=4000000 pri=32, usrpri=84, nice=20 forw=0xffffffffffffffff, list=0xffff8000262ae548,0xffff8000262afcf8 process=0xffff8000fffefa50 user=0xffff80002e3d2000, vmspace=0xfffffd8066067750 estcpu=36, cpticks=1, pctcpu=0.0 user=0, sys=1, intr=0 ddb{0}> ps PID TID PPID UID S FLAGS WAIT COMMAND 77552 94668 26257 0 2 0 syz-executor.0 77552 494476 26257 0 3 0x4000080 fsleep syz-executor.0 35892 507293 69526 0 2 0x10 syz-executor.2 35892 407890 69526 0 3 0x4000090 fsleep syz-executor.2 92556 396862 80891 0 3 0x80 nanoslp syz-executor.5 92556 283414 80891 0 3 0x4000080 fsleep syz-executor.5 92556 213641 80891 0 3 0x4000080 netio syz-executor.5 99444 276961 44986 0 2 0 syz-executor.1 *99444 413332 44986 0 7 0x4000000 syz-executor.1 99444 87371 44986 0 3 0x4000080 fsleep syz-executor.1 21726 32277 86405 0 2 0 syz-executor.7 21726 18073 86405 0 3 0x4000080 fsleep syz-executor.7 46742 25272 37677 0 2 0 syz-executor.6 46742 324246 37677 0 3 0x4000080 netcon2 syz-executor.6 46742 271776 37677 0 3 0x4000080 netcon syz-executor.6 46742 96270 37677 0 3 0x4000080 fsleep syz-executor.6 60292 349043 92761 0 3 0x80 nanoslp syz-executor.3 60292 420432 92761 0 3 0x4000080 kqread syz-executor.3 60292 264294 92761 0 3 0x4000080 fsleep syz-executor.3 42114 247780 1 0 3 0x100083 ttyin getty 69526 158428 52684 0 2 0x482 syz-executor.2 26257 178457 52684 0 3 0x82 nanoslp syz-executor.0 44986 303042 52684 0 2 0x482 syz-executor.1 86405 120101 52684 0 2 0x482 syz-executor.7 37677 272383 52684 0 2 0x482 syz-executor.6 69546 406156 52684 0 3 0x82 piperd syz-executor.4 80891 141920 52684 0 2 0x482 syz-executor.5 92761 287234 52684 0 3 0x82 nanoslp syz-executor.3 58414 420532 0 0 3 0x14200 bored sosplice 52684 34147 33320 0 3 0x82 thrsleep syz-fuzzer 52684 354304 33320 0 3 0x4000082 thrsleep syz-fuzzer 52684 91064 33320 0 3 0x4000082 kqread syz-fuzzer 52684 315849 33320 0 3 0x4000082 thrsleep syz-fuzzer 52684 330297 33320 0 3 0x4000082 thrsleep syz-fuzzer 52684 100794 33320 0 3 0x4000082 thrsleep syz-fuzzer 52684 478059 33320 0 3 0x4000082 thrsleep syz-fuzzer 52684 135905 33320 0 3 0x4000082 thrsleep syz-fuzzer 52684 4950 33320 0 3 0x4000082 thrsleep syz-fuzzer 33320 301042 88553 0 3 0x10008a sigsusp ksh 88553 115116 76634 0 3 0x9a kqread sshd 76634 347139 1 0 3 0x88 kqread sshd 12818 103537 65898 74 3 0x100092 bpf pflogd 65898 473066 1 0 3 0x80 netio pflogd 82607 329253 83608 73 3 0x100090 kqread syslogd 83608 318661 1 0 3 0x100082 netio syslogd 5223 331444 1 0 3 0x100080 kqread resolvd 69532 125263 20466 77 2 0x100092 dhcpleased 41494 28457 20466 77 3 0x100092 kqread dhcpleased 20466 215848 1 0 3 0x80 kqread dhcpleased 29410 126936 0 0 3 0x14200 bored smr 21794 306270 0 0 2 0x14200 zerothread 26505 2252 0 0 3 0x14200 aiodoned aiodoned 29676 217836 0 0 3 0x14200 syncer update 39910 481641 0 0 3 0x14200 cleaner cleaner 62842 145473 0 0 3 0x14200 reaper reaper 349 323610 0 0 3 0x14200 pgdaemon pagedaemon 93301 14826 0 0 3 0x14200 bored viomb 86606 45545 0 0 3 0x40014200 acpi0 acpi0 8345 456943 0 0 7 0x40014200 idle1 8127 465519 0 0 3 0x14200 bored softnet 41235 206467 0 0 3 0x14200 bored systqmp 46173 8707 0 0 3 0x14200 bored systq 88720 505405 0 0 2 0x40014200 softclock 71563 426805 0 0 3 0x40014200 idle0 1 258188 0 0 3 0x82 wait init 0 0 -1 0 3 0x10200 scheduler swapper ddb{0}> show all locks Process 99444 (syz-executor.1) thread 0xffff8000262ae2a8 (413332) exclusive rwlock clonelk r = 0 (0xffffffff828e4a20) #0 witness_lock+0x44d #1 if_clone_destroy+0x49 #2 soo_ioctl+0x26c #3 sys_ioctl+0x4a2 #4 syscall+0x489 mi_syscall sys/sys/syscall_mi.h:102 [inline] #4 syscall+0x489 sys/arch/amd64/amd64/trap.c:585 #5 Xsyscall+0x128 exclusive kernel_lock &kernel_lock r = 0 (0xffffffff82a3d4a8) #0 witness_lock+0x44d #1 soo_ioctl+0x25a sys/kern/sys_socket.c:136 #2 sys_ioctl+0x4a2 #3 syscall+0x489 mi_syscall sys/sys/syscall_mi.h:102 [inline] #3 syscall+0x489 sys/arch/amd64/amd64/trap.c:585 #4 Xsyscall+0x128 ddb{0}> show malloc Type InUse MemUse HighUse Limit Requests Type Lim devbuf 10232 6697K 7547K 78643K 50363 0 pcb 17 20K 23K 78643K 1433 0 rtable 204 21K 24K 78643K 2585 0 ifaddr 86 19K 23K 78643K 1124 0 sysctl 2 0K 0K 78643K 2 0 counters 54 35K 36K 78643K 254 0 ioctlops 0 0K 4K 78643K 3516 0 iov 0 0K 28K 78643K 3816 0 mount 1 1K 1K 78643K 1 0 log 0 0K 0K 78643K 5 0 vnodes 1588 99K 100K 78643K 11275 0 UFS quota 1 32K 32K 78643K 1 0 UFS mount 5 36K 36K 78643K 5 0 shm 2 1K 9K 78643K 116 0 VM map 2 1K 1K 78643K 2 0 sem 12 0K 0K 78643K 932 0 dirhash 12 2K 2K 78643K 12 0 ACPI 1697 195K 286K 78643K 12548 0 file desc 17 61K 89K 78643K 10499 0 sigio 0 0K 0K 78643K 244 0 proc 70 87K 124K 78643K 1472 0 subproc 104 6K 6K 78643K 364 0 NFS srvsock 1 0K 0K 78643K 1 0 NFS daemon 1 16K 16K 78643K 1 0 ip_moptions 2 0K 0K 78643K 789 0 in_multi 55 3K 6K 78643K 922 0 ether_multi 2 0K 0K 78643K 109 0 mrt 2 0K 0K 78643K 80 0 ISOFS mount 1 32K 32K 78643K 1 0 MSDOSFS mount 1 16K 16K 78643K 1 0 ttys 247 1102K 1102K 78643K 247 0 exec 0 0K 2K 78643K 2373 0 tdb 3 0K 0K 78643K 3 0 pagedep 1 8K 8K 78643K 1 0 inodedep 1 32K 32K 78643K 1 0 newblk 1 0K 0K 78643K 1 0 VM swap 7 26K 26K 78643K 7 0 UVM amap 575 795K 799K 78643K 134809 0 UVM aobj 131 4K 4K 78643K 136 0 memdesc 1 4K 4K 78643K 1 0 crypto data 1 1K 1K 78643K 1 0 ip6_options 2 0K 0K 78643K 747 0 NDP 12 0K 2K 78643K 236 0 temp 154 4731K 8829K 78643K 128548 0 kqueue 13 20K 24K 78643K 631 0 SYN cache 2 16K 16K 78643K 2 0 ddb{0}> show all pools Name Size Requests Fail Releases Pgreq Pgrel Npage Hiwat Minpg Maxpg Idle plcache 128 22 0 0 1 0 1 1 0 8 0 rtpcb 120 756 0 753 11 8 3 3 0 8 2 rtentry 112 679 0 606 4 0 4 4 0 8 0 unpcb 136 7403 0 7384 64 63 1 9 0 8 0 syncache 296 30 0 30 9 9 0 1 0 8 0 sackhl 24 1 0 1 1 1 0 1 0 8 0 tcpqe 32 156 0 156 5 5 0 1 0 8 0 tcpcb 736 3536 0 3523 119 117 2 16 0 8 0 arp 120 70 0 57 1 0 1 1 0 8 0 inpcb 304 9117 0 9100 124 122 2 12 0 8 0 rttmr 72 30 0 30 6 6 0 1 0 8 0 nd6 48 168 0 151 1 0 1 1 0 8 0 pkpcb 40 87 0 87 4 4 0 1 0 8 0 kcovpl 48 28 0 20 1 0 1 1 0 8 0 ppxss 1248 44 0 44 12 12 0 1 0 8 0 pfstscr 40 11 0 11 3 3 0 1 0 8 0 pffrag 232 116 0 115 4 3 1 1 0 482 0 pffrnode 88 116 0 115 4 3 1 1 0 8 0 pffrent 40 474 0 473 5 4 1 1 0 8 0 pfosfp 40 1442 0 1015 5 0 5 5 0 8 0 pfosfpen 112 1442 0 717 21 0 21 21 0 8 0 pfrke_plain 168 9 0 3 2 1 1 1 0 8 0 pfrktable 1344 189 0 176 7 5 2 2 0 8 0 pftag 88 11 0 5 1 0 1 1 0 8 0 pfqueue 264 2 0 2 1 1 0 1 0 8 0 pfstitem 24 58 0 56 1 0 1 1 0 8 0 pfstkey 112 72 0 70 1 0 1 1 0 8 0 pfstate 320 61 0 59 3 2 1 3 0 8 0 pfrule 1360 264 0 182 8 1 7 7 0 8 0 art_heap8 4096 2 0 1 2 1 1 2 0 8 0 art_heap4 256 3304 0 2982 42 14 28 32 0 8 2 art_table 32 3306 0 2983 5 1 4 5 0 8 0 art_node 16 674 0 609 1 0 1 1 0 8 0 sysvmsgpl 40 1 0 1 1 1 0 1 0 8 0 semapl 112 930 0 920 1 0 1 1 0 8 0 shmpl 112 133 0 5 4 0 4 4 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino2pl 256 16016 0 14534 94 0 94 94 0 8 0 ffsino 272 16016 0 14534 100 0 100 100 0 8 0 nchpl 144 30697 0 29063 63 0 63 63 0 8 0 rtmask 32 8 0 5 2 1 1 1 0 8 0 uvmvnodes 80 6177 0 0 127 0 127 127 0 8 0 vnodes 224 6177 0 0 364 0 364 364 0 8 0 namei 1024 112091 0 112091 4 3 1 2 0 8 1 percpumem 16 139 0 100 1 0 1 1 0 8 0 vcpupl 2048 117 0 0 15 0 15 15 0 8 0 vmpool 560 139 0 22 10 1 9 9 0 8 0 pfiaddrpl 120 120 0 73 4 2 2 2 0 8 0 scsiplug 72 4 0 4 2 2 0 1 0 8 0 scxspl 216 94539 0 94539 23 22 1 8 0 8 1 plimitpl 152 1000 0 985 1 0 1 1 0 8 0 sigapl 424 10788 0 10743 8 2 6 8 0 8 0 futexpl 64 102980 0 102973 2 1 1 1 0 8 0 knotepl 120 559 0 0 12 3 9 10 0 8 0 kqueuepl 216 2605 0 2595 66 65 1 5 0 8 0 pipepl 336 2256 0 2228 66 63 3 11 0 8 0 fdescpl 496 10749 0 10719 5 1 4 5 0 8 0 filepl 152 76420 0 76163 139 126 13 22 0 8 2 lockfpl 104 6834 0 6832 20 19 1 4 0 8 0 lockfspl 48 1777 0 1775 2 1 1 2 0 8 0 sessionpl 144 45 0 28 1 0 1 1 0 8 0 pgrppl 48 105 0 88 1 0 1 1 0 8 0 ucredpl 96 9659 0 9644 1 0 1 1 0 8 0 zombiepl 144 10743 0 10743 2 1 1 1 0 8 1 processpl 1064 10788 0 10743 5 1 4 5 0 8 0 procpl 672 29685 0 29620 28 22 6 9 0 8 0 srpgc 96 23 0 23 7 6 1 1 0 8 1 sosppl 168 85 0 85 14 13 1 1 0 8 1 sockpl 480 17367 0 17328 316 304 12 34 0 8 7 mcl64k 65536 20 0 0 3 0 3 3 0 8 0 mcl16k 16384 17 0 0 3 0 3 3 0 8 0 mcl12k 12288 19 0 0 2 0 2 2 0 8 0 mcl9k 9216 17 0 0 2 0 2 2 0 8 0 mcl8k 8192 25 0 0 3 0 3 3 0 8 0 mcl4k 4096 25 0 0 4 1 3 3 0 8 0 mcl2k2 2112 6 0 0 1 0 1 1 0 8 0 mcl2k 2048 406 0 0 27 4 23 27 0 8 0 mtagpl 96 1668 0 0 40 0 40 40 0 8 0 mbufpl 256 2224 0 0 135 1 134 134 0 8 0 bufpl 288 21620 0 15314 453 0 453 453 0 8 0 anonpl 24 3077613 0 3055128 352 195 157 162 0 186 8 amapchunkpl 152 326125 0 325126 108 63 45 52 0 158 3 amappl16 200 32060 0 31339 164 122 42 53 0 8 0 amappl15 192 1378 0 1369 1 0 1 1 0 8 0 amappl14 184 1397 0 1390 1 0 1 1 0 8 0 amappl13 176 2410 0 2407 1 0 1 1 0 8 0 amappl12 168 559 0 555 1 0 1 1 0 8 0 amappl11 160 1324 0 1305 1 0 1 1 0 8 0 amappl10 152 2581 0 2577 1 0 1 1 0 8 0 amappl9 144 1233 0 1230 1 0 1 1 0 8 0 amappl8 136 1865 0 1731 5 0 5 5 0 8 0 amappl7 128 811 0 799 1 0 1 1 0 8 0 amappl6 120 1029 0 1005 2 1 1 2 0 8 0 amappl5 112 10696 0 10677 1 0 1 1 0 8 0 amappl4 104 3594 0 3556 2 0 2 2 0 8 0 amappl3 96 3072 0 3057 1 0 1 1 0 8 0 amappl2 88 3673 0 3600 3 1 2 3 0 8 0 amappl1 80 194776 0 194161 19 5 14 19 0 8 0 amappl 88 132892 0 132533 10 1 9 9 0 92 0 dma4096 4096 1 0 1 1 1 0 1 0 8 0 dma1024 1024 1 0 0 1 0 1 1 0 8 0 dma256 256 6 0 6 1 1 0 1 0 8 0 dma128 128 253 0 253 1 1 0 1 0 8 0 dma64 64 6 0 6 1 1 0 1 0 8 0 dma32 32 7 0 7 1 1 0 1 0 8 0 dma16 16 18 0 17 1 0 1 1 0 8 0 aobjpl 72 135 0 5 3 0 3 3 0 8 0 uaddrrnd 24 10888 0 10741 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 10888 0 10741 1 0 1 1 0 8 0 vmmpekpl 168 78102 0 78029 4 0 4 4 0 8 0 vmmpepl 168 981195 0 978035 338 196 142 164 0 357 1 vmsppl 368 10887 0 10741 15 1 14 14 0 8 0 rwobjpl 56 242332 0 234123 136 19 117 120 0 8 0 pdppl 4096 21783 0 21599 617 431 186 187 0 8 2 pvpl 32 5268565 0 5242828 610 354 256 272 0 265 37 pmappl 248 10887 0 10741 11 1 10 10 0 8 0 extentpl 40 58 0 38 1 0 1 1 0 8 0 phpool 112 1716 0 639 32 0 32 32 0 8 0 ddb{0}> machine ddbcpu 0 Invalid cpu 0 ddb{0}> trace db_enter() at db_enter+0x18 sys/arch/amd64/amd64/db_interface.c:440 panic(ffffffff825739a5) at panic+0x177 sys/kern/subr_prf.c:202 __assert(ffffffff825e91ae,ffffffff82632dac,131,ffffffff825fdeb9) at __assert+0x25 sys/kern/subr_prf.c:161 tun_clone_destroy(ffff800000d83800) at tun_clone_destroy+0x278 sys/net/if_tun.c:305 if_clone_destroy(ffff80002e3d6f10) at if_clone_destroy+0x132 sys/net/if.c:1218 soo_ioctl(fffffd806f2a56a0,80206979,ffff80002e3d6f10,ffff8000262ae2a8) at soo_ioctl+0x26c sys_ioctl(ffff8000262ae2a8,ffff80002e3d7028,ffff80002e3d7080) at sys_ioctl+0x4a2 syscall(ffff80002e3d70f0) at syscall+0x489 mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff80002e3d70f0) at syscall+0x489 sys/arch/amd64/amd64/trap.c:585 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x35f3df0e410, count: -9 ddb{0}> machine ddbcpu 1 Stopped at x86_ipi_db+0x1a: addq $0x8,%rsp x86_ipi_db(ffff800020ce8ff0) at x86_ipi_db+0x1a sys/arch/amd64/amd64/db_interface.c:393 x86_ipi_handler() at x86_ipi_handler+0xb7 sys/arch/amd64/amd64/ipi.c:106 Xresume_lapic_ipi() at Xresume_lapic_ipi+0x23 acpicpu_idle() at acpicpu_idle+0x312 sys/dev/acpi/acpicpu.c:1206 sched_idle(ffff800020ce8ff0) at sched_idle+0x417 sys/kern/kern_sched.c:178 end trace frame: 0x0, count: 10 ddb{1}> trace x86_ipi_db(ffff800020ce8ff0) at x86_ipi_db+0x1a sys/arch/amd64/amd64/db_interface.c:393 x86_ipi_handler() at x86_ipi_handler+0xb7 sys/arch/amd64/amd64/ipi.c:106 Xresume_lapic_ipi() at Xresume_lapic_ipi+0x23 acpicpu_idle() at acpicpu_idle+0x312 sys/dev/acpi/acpicpu.c:1206 sched_idle(ffff800020ce8ff0) at sched_idle+0x417 sys/kern/kern_sched.c:178 end trace frame: 0x0, count: -5