login: witness: acquiring duplicate lock of same type: "&sc->sc_lock" 1st wsmuxlk @ /syzkaller/managers/multicore/kernel/sys/dev/wscons/wsmux.c:242 2nd wsmuxlk @ /syzkaller/managers/multicore/kernel/sys/dev/wscons/wsmux.c:242 Starting stack trace... witness_checkorder(ffff800002b48bd0,1,ffffffff81f354ca,f2,0) at witness_checkorder+0xe14 witness_debugger sys/kern/subr_witness.c:2650 [inline] witness_checkorder(ffff800002b48bd0,1,ffffffff81f354ca,f2,0) at witness_checkorder+0xe14 sys/kern/subr_witness.c:926 _rw_enter_read(ffff800002b48bc0,ffffffff81f354ca,f2) at _rw_enter_read+0x80 sys/kern/kern_rwlock.c:102 wsmux_mux_open(ffff800002b48b00,ffff800000026d50) at wsmux_mux_open+0x82 wsmux_do_open sys/dev/wscons/wsmux.c:243 [inline] wsmux_mux_open(ffff800002b48b00,ffff800000026d50) at wsmux_mux_open+0x82 sys/dev/wscons/wsmux.c:225 wsmuxopen(4500,101,2000,ffff800020b43530) at wsmuxopen+0x179 wsmux_do_open sys/dev/wscons/wsmux.c:255 [inline] wsmuxopen(4500,101,2000,ffff800020b43530) at wsmuxopen+0x179 sys/dev/wscons/wsmux.c:201 spec_open(ffff800020c4f100) at spec_open+0x217 sys/kern/spec_vnops.c:158 VOP_OPEN(fffffd806a0740d8,101,fffffd807f7c79c0,ffff800020b43530) at VOP_OPEN+0x76 sys/kern/vfs_vops.c:153 vn_open(ffff800020c4f2f0,101,0) at vn_open+0x4c6 sys/kern/vfs_vnops.c:174 doopenat(ffff800020b43530,ffffff9c,20000000,100,0,ffff800020c4f530) at doopenat+0x2be sys/kern/vfs_syscalls.c:1045 syscall(ffff800020c4f5e0) at syscall+0x5ac mi_syscall sys/sys/syscall_mi.h:99 [inline] syscall(ffff800020c4f5e0) at syscall+0x5ac sys/arch/amd64/amd64/trap.c:574 Xsyscall(6,0,ffffffffffffffb1,0,4,a7aa0901010) at Xsyscall+0x128 end of kernel end trace frame: 0xa7d08b6c600, count: 247 End of stack trace. Stopped at db_enter+0x18: addq $0x8,%rsp ddb{1}> ddb{1}> set $lines = 0 ddb{1}> set $maxwidth = 0 ddb{1}> show panic the kernel did not panic ddb{1}> trace db_enter() at db_enter+0x18 sys/arch/amd64/amd64/db_interface.c:399 witness_checkorder(ffff800002b48bd0,1,ffffffff81f354ca,f2,0) at witness_checkorder+0xe19 witness_debugger sys/kern/subr_witness.c:2650 [inline] witness_checkorder(ffff800002b48bd0,1,ffffffff81f354ca,f2,0) at witness_checkorder+0xe19 sys/kern/subr_witness.c:926 _rw_enter_read(ffff800002b48bc0,ffffffff81f354ca,f2) at _rw_enter_read+0x80 sys/kern/kern_rwlock.c:102 wsmux_mux_open(ffff800002b48b00,ffff800000026d50) at wsmux_mux_open+0x82 wsmux_do_open sys/dev/wscons/wsmux.c:243 [inline] wsmux_mux_open(ffff800002b48b00,ffff800000026d50) at wsmux_mux_open+0x82 sys/dev/wscons/wsmux.c:225 wsmuxopen(4500,101,2000,ffff800020b43530) at wsmuxopen+0x179 wsmux_do_open sys/dev/wscons/wsmux.c:255 [inline] wsmuxopen(4500,101,2000,ffff800020b43530) at wsmuxopen+0x179 sys/dev/wscons/wsmux.c:201 spec_open(ffff800020c4f100) at spec_open+0x217 sys/kern/spec_vnops.c:158 VOP_OPEN(fffffd806a0740d8,101,fffffd807f7c79c0,ffff800020b43530) at VOP_OPEN+0x76 sys/kern/vfs_vops.c:153 vn_open(ffff800020c4f2f0,101,0) at vn_open+0x4c6 sys/kern/vfs_vnops.c:174 doopenat(ffff800020b43530,ffffff9c,20000000,100,0,ffff800020c4f530) at doopenat+0x2be sys/kern/vfs_syscalls.c:1045 syscall(ffff800020c4f5e0) at syscall+0x5ac mi_syscall sys/sys/syscall_mi.h:99 [inline] syscall(ffff800020c4f5e0) at syscall+0x5ac sys/arch/amd64/amd64/trap.c:574 Xsyscall(6,0,ffffffffffffffb1,0,4,a7aa0901010) at Xsyscall+0x128 end of kernel end trace frame: 0xa7d08b6c600, count: -11 ddb{1}> show registers rdi 0 rsi 0x3ffff acpi_pdirpa+0x2be67 rbp 0xffff800020c4eea0 rbx 0x3 rdx 0x40000 acpi_pdirpa+0x2be68 rcx 0xffff800003b49000 rax 0xffff800001b47180 r8 0xffffffff81316553 kprintf+0x183 r9 0x1 r10 0x25 r11 0xd64d91a79783969a r12 0xffffffff81f354ca substchar+0x955e r13 0xf2 r14 0xffffffff81f25297 apollo_udma33_tim+0x16e4 r15 0xffffffff81f354ca substchar+0x955e rip 0xffffffff81264218 db_enter+0x18 cs 0x8 rflags 0x246 rsp 0xffff800020c4ee90 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb{1}> show proc PROC (syz-executor.0) pid=188731 stat=onproc flags process=0 proc=4000000 pri=68, usrpri=68, nice=20 forw=0xffffffffffffffff, list=0xffff800020b42bd0,0xffffffff82334d38 process=0xffff800020b45a50 user=0xffff800020c4a000, vmspace=0xfffffd807f00d9d8 estcpu=36, cpticks=0, pctcpu=0.0 user=0, sys=0, intr=0 ddb{1}> ps PID TID PPID UID S FLAGS WAIT COMMAND 36553 327589 47497 0 3 0x80 fsleep syz-executor.0 *36553 188731 47497 0 7 0x4000000 syz-executor.0 52406 137435 48338 60929 3 0x90 fsleep syz-executor.1 52406 47440 48338 60929 3 0x4000010 biowait syz-executor.1 13234 507167 1 0 3 0x100083 ttyin getty 47497 307233 96055 0 3 0x82 nanosleep syz-executor.0 38139 495706 0 0 3 0x14200 bored sosplice 48338 395572 96055 0 3 0x82 nanosleep syz-executor.1 96055 212640 64858 0 3 0x82 thrsleep syz-fuzzer 96055 328244 64858 0 3 0x4000082 thrsleep syz-fuzzer 96055 52622 64858 0 3 0x4000082 thrsleep syz-fuzzer 96055 152008 64858 0 3 0x4000082 thrsleep syz-fuzzer 96055 289926 64858 0 3 0x4000082 thrsleep syz-fuzzer 96055 341406 64858 0 3 0x4000082 thrsleep syz-fuzzer 96055 100199 64858 0 3 0x4000082 thrsleep syz-fuzzer 96055 466389 64858 0 3 0x4000082 thrsleep syz-fuzzer 96055 61778 64858 0 3 0x4000082 kqread syz-fuzzer 96055 91143 64858 0 3 0x4000082 thrsleep syz-fuzzer 64858 32702 84877 0 3 0x10008a pause ksh 84877 463273 77337 0 3 0x92 select sshd 77337 465398 1 0 3 0x80 select sshd 64329 413067 6322 73 2 0x100090 syslogd 6322 477967 1 0 3 0x100082 netio syslogd 67953 253136 1 77 3 0x100090 poll dhclient 53505 57686 1 0 3 0x80 poll dhclient 46135 300110 0 0 3 0x14200 pgzero zerothread 22112 312356 0 0 3 0x14200 aiodoned aiodoned 46695 126803 0 0 3 0x14200 syncer update 51606 300861 0 0 3 0x14200 cleaner cleaner 93376 215463 0 0 3 0x14200 reaper reaper 90711 164563 0 0 3 0x14200 pgdaemon pagedaemon 47265 78380 0 0 3 0x14200 bored crynlk 18866 176109 0 0 3 0x14200 bored crypto 14289 193125 0 0 3 0x40014200 acpi0 acpi0 57657 486625 0 0 3 0x40014200 idle1 56991 451637 0 0 3 0x14200 bored softnet 81575 262383 0 0 3 0x14200 bored systqmp 65977 16614 0 0 3 0x14200 bored systq 50295 363073 0 0 3 0x40014200 bored softclock 2759 121180 0 0 7 0x40014200 idle0 1 427048 0 0 3 0x82 wait init 0 0 -1 0 3 0x10200 scheduler swapper ddb{1}> show all locks Process 36553 (syz-executor.0) thread 0xffff800020b43530 (188731) shared rwlock wsmuxlk r = 0 (0xffff800000026dd0) locked @ /syzkaller/managers/multicore/kernel/sys/dev/wscons/wsmux.c:242 #0 witness_lock+0x58a sys/kern/subr_witness.c:1205 #1 wsmuxopen+0xf3 wsmux_do_open sys/dev/wscons/wsmux.c:243 [inline] #1 wsmuxopen+0xf3 sys/dev/wscons/wsmux.c:201 #2 spec_open+0x217 sys/kern/spec_vnops.c:158 #3 VOP_OPEN+0x76 sys/kern/vfs_vops.c:153 #4 vn_open+0x4c6 sys/kern/vfs_vnops.c:174 #5 doopenat+0x2be sys/kern/vfs_syscalls.c:1045 #6 syscall+0x5ac mi_syscall sys/sys/syscall_mi.h:99 [inline] #6 syscall+0x5ac sys/arch/amd64/amd64/trap.c:574 #7 Xsyscall+0x128 exclusive kernel_lock &kernel_lock r = 0 (0xffffffff8235c720) locked @ /syzkaller/managers/multicore/kernel/sys/sys/syscall_mi.h:90 #0 witness_lock+0x58a sys/kern/subr_witness.c:1205 #1 syscall+0x47f mi_syscall sys/sys/syscall_mi.h:91 [inline] #1 syscall+0x47f sys/arch/amd64/amd64/trap.c:574 #2 Xsyscall+0x128 Process 52406 (syz-executor.1) thread 0xffff800020b42270 (47440) exclusive rrwlock inode r = 0 (0xfffffd806e598e68) locked @ /syzkaller/managers/multicore/kernel/sys/ufs/ufs/ufs_ihash.c:140 #0 witness_lock+0x58a sys/kern/subr_witness.c:1205 #1 _rw_enter+0x44d sys/kern/kern_rwlock.c:280 #2 _rrw_enter+0x60 sys/kern/kern_rwlock.c:410 #3 ufs_ihashins+0x67 sys/ufs/ufs/ufs_ihash.c:140 #4 ffs_vget+0x13d sys/ufs/ffs/ffs_vfsops.c:1352 #5 ffs_inode_alloc+0x1c3 sys/ufs/ffs/ffs_alloc.c:392 #6 ufs_mkdir+0x10f sys/ufs/ufs/ufs_vnops.c:1164 #7 VOP_MKDIR+0x76 sys/kern/vfs_vops.c:449 #8 domkdirat+0x12d sys/kern/vfs_syscalls.c:2881 #9 syscall+0x5ac mi_syscall sys/sys/syscall_mi.h:99 [inline] #9 syscall+0x5ac sys/arch/amd64/amd64/trap.c:574 #10 Xsyscall+0x128 exclusive rrwlock inode r = 0 (0xfffffd806e7f44d8) locked @ /syzkaller/managers/multicore/kernel/sys/ufs/ufs/ufs_vnops.c:1547 #0 witness_lock+0x58a sys/kern/subr_witness.c:1205 #1 _rw_enter+0x44d sys/kern/kern_rwlock.c:280 #2 _rrw_enter+0x60 sys/kern/kern_rwlock.c:410 #3 VOP_LOCK+0x57 sys/kern/vfs_vops.c:602 #4 vn_lock+0x6e sys/kern/vfs_vnops.c:549 #5 vfs_lookup+0xf5 sys/kern/vfs_lookup.c:387 #6 namei+0x4b2 sys/kern/vfs_lookup.c:224 #7 domkdirat+0x81 sys/kern/vfs_syscalls.c:2866 #8 syscall+0x5ac mi_syscall sys/sys/syscall_mi.h:99 [inline] #8 syscall+0x5ac sys/arch/amd64/amd64/trap.c:574 #9 Xsyscall+0x128 ddb{1}> show malloc Type InUse MemUse HighUse Limit Requests Type Lim Kern Lim devbuf 9532 6367K 6375K 78643K 11231 0 0 pcb 25 9K 11K 78643K 1053 0 0 rtable 100 3K 4K 78643K 584 0 0 ifaddr 58 13K 14K 78643K 213 0 0 counters 39 33K 33K 78643K 39 0 0 ioctlops 0 0K 2K 78643K 33 0 0 iov 0 0K 32K 78643K 227 0 0 mount 1 1K 1K 78643K 1 0 0 vnodes 1196 75K 76K 78643K 2392 0 0 UFS quota 1 32K 32K 78643K 1 0 0 UFS mount 5 36K 36K 78643K 5 0 0 shm 2 1K 5K 78643K 32 0 0 VM map 2 1K 1K 78643K 2 0 0 sem 12 0K 1K 78643K 248 0 0 dirhash 12 2K 2K 78643K 12 0 0 ACPI 1792 194K 288K 78643K 12592 0 0 file desc 6 17K 21K 78643K 1829 0 0 sigio 0 0K 0K 78643K 46 0 0 proc 43 38K 58K 78643K 646 0 0 subproc 64 65538K 67586K 78643K 278 0 0 NFS srvsock 1 0K 0K 78643K 1 0 0 NFS daemon 1 16K 16K 78643K 1 0 0 ip_moptions 0 0K 0K 78643K 219 0 0 in_multi 33 2K 2K 78643K 162 0 0 ether_multi 1 0K 0K 78643K 11 0 0 mrt 1 0K 0K 78643K 4 0 0 ISOFS mount 1 32K 32K 78643K 1 0 0 MSDOSFS mount 1 16K 16K 78643K 1 0 0 ttys 96 424K 424K 78643K 96 0 0 exec 0 0K 1K 78643K 387 0 0 pagedep 1 8K 8K 78643K 1 0 0 inodedep 1 32K 32K 78643K 1 0 0 newblk 1 0K 0K 78643K 1 0 0 VM swap 7 26K 26K 78643K 7 0 0 UVM amap 97 21K 31K 78643K 6975 0 0 UVM aobj 89 3K 3K 78643K 101 0 0 memdesc 1 4K 4K 78643K 1 0 0 crypto data 1 1K 1K 78643K 1 0 0 ip6_options 0 0K 1K 78643K 81 0 0 NDP 12 0K 0K 78643K 67 0 0 temp 170 2367K 2431K 78643K 7966 0 0 kqueue 0 0K 0K 78643K 12 0 0 SYN cache 2 16K 16K 78643K 2 0 0 ddb{1}> show all pools Name Size Requests Fail Releases Pgreq Pgrel Npage Hiwat Minpg Maxpg Idle arp 64 10 0 6 1 0 1 1 0 8 0 inpcbpl 280 956 0 949 1 0 1 1 0 8 0 plimitpl 152 46 0 39 1 0 1 1 0 8 0 plcache 128 20 0 0 1 0 1 1 0 8 0 rtentry 112 95 0 55 2 0 2 2 0 8 0 syncache 264 4 0 4 1 1 0 1 0 8 0 tcpqe 32 35 0 35 2 2 0 1 0 8 0 tcpcb 544 315 0 311 1 0 1 1 0 8 0 nd6 48 16 0 12 1 0 1 1 0 8 0 ppxss 1128 17 0 17 8 8 0 1 0 8 0 art_heap8 4096 1 0 0 1 0 1 1 0 8 0 art_heap4 256 448 0 261 12 0 12 12 0 8 0 art_table 32 449 0 261 2 0 2 2 0 8 0 art_node 16 94 0 60 1 0 1 1 0 8 0 sysvmsgpl 40 19 0 6 1 0 1 1 0 8 0 semupl 112 2 0 2 1 1 0 1 0 8 0 semapl 112 246 0 236 1 0 1 1 0 8 0 shmpl 112 99 0 12 3 0 3 3 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino1pl 128 4897 0 3459 47 0 47 47 0 8 0 ffsino 272 4897 0 3459 97 1 96 96 0 8 0 nchpl 144 7754 0 6148 61 0 61 61 0 8 0 uvmvnodes 72 5205 0 0 95 0 95 95 0 8 0 vnodes 200 5205 0 0 274 0 274 274 0 8 0 namei 1024 23447 0 23446 2 1 1 1 0 8 0 percpumem 16 30 0 0 1 0 1 1 0 8 0 scsiplug 64 6 0 6 5 5 0 1 0 8 0 scxspl 192 22873 0 22872 12 11 1 6 0 8 0 sigapl 432 1982 0 1968 2 0 2 2 0 8 0 futexpl 56 20391 0 20389 1 0 1 1 0 8 0 knotepl 112 557 0 530 4 3 1 2 0 8 0 kqueuepl 104 528 0 526 1 0 1 1 0 8 0 pipepl 112 1486 0 1467 6 5 1 2 0 8 0 fdescpl 488 1983 0 1968 3 1 2 3 0 8 0 filepl 152 12687 0 12588 10 6 4 6 0 8 0 lockfpl 104 744 0 743 5 4 1 1 0 8 0 lockfspl 32 1051 0 1050 5 4 1 1 0 8 0 sessionpl 112 26 0 16 1 0 1 1 0 8 0 pgrppl 48 51 0 41 1 0 1 1 0 8 0 ucredpl 96 3377 0 3369 1 0 1 1 0 8 0 zombiepl 144 1968 0 1968 2 1 1 1 0 8 1 processpl 840 1998 0 1968 4 0 4 4 0 8 0 procpl 600 6149 0 6108 4 0 4 4 0 8 0 srpgc 64 36 0 36 1 1 0 1 0 8 0 sosppl 128 41 0 41 13 12 1 1 0 8 1 sockpl 384 1868 0 1849 10 7 3 4 0 8 0 mcl64k 65536 372 0 0 47 11 36 47 0 8 1 mcl16k 16384 1 0 0 1 0 1 1 0 8 0 mcl12k 12288 11 0 0 2 0 2 2 0 8 0 mcl9k 9216 11 0 0 1 0 1 1 0 8 0 mcl8k 8192 12 0 0 2 0 2 2 0 8 0 mcl4k 4096 17 0 0 3 0 3 3 0 8 0 mcl2k2 2112 6 0 0 1 0 1 1 0 8 0 mcl2k 2048 123 0 0 15 0 15 15 0 8 0 mtagpl 80 4 0 0 1 0 1 1 0 8 0 mbufpl 256 518 0 0 29 1 28 29 0 8 0 bufpl 256 9369 0 2397 436 0 436 436 0 8 0 anonpl 16 207835 0 199985 121 87 34 49 0 125 0 amapchunkpl 152 13172 0 13081 39 34 5 11 0 158 0 amappl16 192 11583 0 11163 104 82 22 34 0 8 0 amappl15 184 100 0 99 2 1 1 1 0 8 0 amappl14 176 9 0 8 2 1 1 1 0 8 0 amappl13 168 38 0 35 1 0 1 1 0 8 0 amappl12 160 785 0 784 2 1 1 1 0 8 0 amappl11 152 210 0 201 1 0 1 1 0 8 0 amappl10 144 70 0 66 2 1 1 1 0 8 0 amappl9 136 357 0 353 1 0 1 1 0 8 0 amappl8 128 217 0 181 2 0 2 2 0 8 0 amappl7 120 52 0 45 1 0 1 1 0 8 0 amappl6 112 53 0 47 1 0 1 1 0 8 0 amappl5 104 258 0 246 1 0 1 1 0 8 0 amappl4 96 1192 0 1165 2 1 1 2 0 8 0 amappl3 88 969 0 964 1 0 1 1 0 8 0 amappl2 80 18412 0 18351 2 0 2 2 0 8 0 amappl1 72 51926 0 51488 24 14 10 19 0 8 0 amappl 72 6450 0 6414 1 0 1 1 0 75 0 dma4096 4096 1 0 1 1 1 0 1 0 8 0 dma256 256 6 0 6 1 1 0 1 0 8 0 dma64 64 259 0 259 1 1 0 1 0 8 0 dma32 32 7 0 7 1 1 0 1 0 8 0 dma16 16 17 0 17 1 1 0 1 0 8 0 aobjpl 64 100 0 12 2 0 2 2 0 8 0 uaddrrnd 24 1983 0 1968 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 1983 0 1968 1 0 1 1 0 8 0 vmmpekpl 168 21283 0 21261 2 0 2 2 0 8 0 vmmpepl 168 217663 0 216197 131 65 66 75 0 357 0 vmsppl 360 1982 0 1968 2 0 2 2 0 8 0 pdppl 4096 3973 0 3936 5 0 5 5 0 8 0 pvpl 32 582025 0 571088 212 109 103 130 0 265 11 pmappl 224 1982 0 1968 1 0 1 1 0 8 0 extentpl 40 39 0 25 1 0 1 1 0 8 0 phpool 112 656 0 16 19 0 19 19 0 8 0