witness: acquiring duplicate lock of same type: "&sc->sc_lock" 1st wsmuxlk @ /syzkaller/managers/multicore/kernel/sys/dev/wscons/wsmux.c:245 2nd wsmuxlk @ /syzkaller/managers/multicore/kernel/sys/dev/wscons/wsmux.c:245 Starting stack trace... witness_checkorder(ffff8000019abed0,1,ffffffff81f36129,f5,0) at witness_checkorder+0xe14 witness_debugger sys/kern/subr_witness.c:2650 [inline] witness_checkorder(ffff8000019abed0,1,ffffffff81f36129,f5,0) at witness_checkorder+0xe14 sys/kern/subr_witness.c:926 _rw_enter_read(ffff8000019abec0,ffffffff81f36129,f5) at _rw_enter_read+0x80 sys/kern/kern_rwlock.c:102 wsmux_mux_open(ffff8000019abe00,ffff800000026d50) at wsmux_mux_open+0x82 wsmux_do_open sys/dev/wscons/wsmux.c:246 [inline] wsmux_mux_open(ffff8000019abe00,ffff800000026d50) at wsmux_mux_open+0x82 sys/dev/wscons/wsmux.c:228 wsmuxopen(4500,18001,2000,ffff800020b42978) at wsmuxopen+0x179 wsmux_do_open sys/dev/wscons/wsmux.c:258 [inline] wsmuxopen(4500,18001,2000,ffff800020b42978) at wsmuxopen+0x179 sys/dev/wscons/wsmux.c:204 spec_open(ffff800020c57500) at spec_open+0x217 sys/kern/spec_vnops.c:158 VOP_OPEN(fffffd80642510e8,18001,fffffd807f7c7960,ffff800020b42978) at VOP_OPEN+0x76 sys/kern/vfs_vops.c:153 vn_open(ffff800020c576f0,18001,0) at vn_open+0x4c6 sys/kern/vfs_vnops.c:174 doopenat(ffff800020b42978,ffffff9c,200001c0,18000,0,ffff800020c57930) at doopenat+0x2be sys/kern/vfs_syscalls.c:1045 syscall(ffff800020c579e0) at syscall+0x5ac mi_syscall sys/sys/syscall_mi.h:99 [inline] syscall(ffff800020c579e0) at syscall+0x5ac sys/arch/amd64/amd64/trap.c:574 Xsyscall(6,0,ffffffffffffffb1,0,4,669f2fcf0d8) at Xsyscall+0x128 end of kernel end trace frame: 0x66cc4f76820, 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(ffff8000019abed0,1,ffffffff81f36129,f5,0) at witness_checkorder+0xe19 witness_debugger sys/kern/subr_witness.c:2650 [inline] witness_checkorder(ffff8000019abed0,1,ffffffff81f36129,f5,0) at witness_checkorder+0xe19 sys/kern/subr_witness.c:926 _rw_enter_read(ffff8000019abec0,ffffffff81f36129,f5) at _rw_enter_read+0x80 sys/kern/kern_rwlock.c:102 wsmux_mux_open(ffff8000019abe00,ffff800000026d50) at wsmux_mux_open+0x82 wsmux_do_open sys/dev/wscons/wsmux.c:246 [inline] wsmux_mux_open(ffff8000019abe00,ffff800000026d50) at wsmux_mux_open+0x82 sys/dev/wscons/wsmux.c:228 wsmuxopen(4500,18001,2000,ffff800020b42978) at wsmuxopen+0x179 wsmux_do_open sys/dev/wscons/wsmux.c:258 [inline] wsmuxopen(4500,18001,2000,ffff800020b42978) at wsmuxopen+0x179 sys/dev/wscons/wsmux.c:204 spec_open(ffff800020c57500) at spec_open+0x217 sys/kern/spec_vnops.c:158 VOP_OPEN(fffffd80642510e8,18001,fffffd807f7c7960,ffff800020b42978) at VOP_OPEN+0x76 sys/kern/vfs_vops.c:153 vn_open(ffff800020c576f0,18001,0) at vn_open+0x4c6 sys/kern/vfs_vnops.c:174 doopenat(ffff800020b42978,ffffff9c,200001c0,18000,0,ffff800020c57930) at doopenat+0x2be sys/kern/vfs_syscalls.c:1045 syscall(ffff800020c579e0) at syscall+0x5ac mi_syscall sys/sys/syscall_mi.h:99 [inline] syscall(ffff800020c579e0) at syscall+0x5ac sys/arch/amd64/amd64/trap.c:574 Xsyscall(6,0,ffffffffffffffb1,0,4,669f2fcf0d8) at Xsyscall+0x128 end of kernel end trace frame: 0x66cc4f76820, count: -11 ddb{1}> show registers rdi 0 rsi 0x3ffff acpi_pdirpa+0x2be67 rbp 0xffff800020c572a0 rbx 0x3 rdx 0x40000 acpi_pdirpa+0x2be68 rcx 0xffff800002d4a000 rax 0xffff800001747a00 r8 0xffffffff8155ffb3 kprintf+0x183 r9 0x1 r10 0x25 r11 0x7f128b6a385cca9b r12 0xffffffff81f36129 substchar+0xb4b1 r13 0xf5 r14 0xffffffff81f25d3f apollo_udma33_tim+0x233d r15 0xffffffff81f36129 substchar+0xb4b1 rip 0xffffffff812c7448 db_enter+0x18 cs 0x8 rflags 0x246 rsp 0xffff800020c57290 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb{1}> show proc PROC (syz-executor.1) pid=88250 stat=onproc flags process=0 proc=4000000 pri=86, usrpri=86, nice=20 forw=0xffffffffffffffff, list=0xffff800020b42bd0,0xffffffff8233fe30 process=0xffff800020b44358 user=0xffff800020c52000, vmspace=0xfffffd807efff708 estcpu=36, cpticks=0, pctcpu=0.0 user=0, sys=0, intr=0 ddb{1}> ps PID TID PPID UID S FLAGS WAIT COMMAND 83949 368886 28602 0 2 0 syz-executor.1 83949 389451 28602 0 2 0x4000000 syz-executor.1 *83949 88250 28602 0 7 0x4000000 syz-executor.1 88467 480522 1 0 3 0x100083 ttyin getty 32305 255182 50616 0 3 0x82 nanosleep syz-executor.0 26817 500674 0 0 3 0x14200 bored sosplice 28602 354316 50616 0 3 0x82 nanosleep syz-executor.1 50616 438156 12831 0 3 0x82 thrsleep syz-fuzzer 50616 57518 12831 0 3 0x4000082 thrsleep syz-fuzzer 50616 483858 12831 0 3 0x4000082 thrsleep syz-fuzzer 50616 130834 12831 0 3 0x4000082 thrsleep syz-fuzzer 50616 177018 12831 0 3 0x4000082 thrsleep syz-fuzzer 50616 378571 12831 0 3 0x4000082 kqread syz-fuzzer 50616 231296 12831 0 3 0x4000082 thrsleep syz-fuzzer 50616 320500 12831 0 3 0x4000082 thrsleep syz-fuzzer 50616 262637 12831 0 3 0x4000082 thrsleep syz-fuzzer 50616 187137 12831 0 3 0x4000082 thrsleep syz-fuzzer 12831 494358 36596 0 3 0x10008a pause ksh 36596 278216 1281 0 3 0x92 select sshd 1281 5854 1 0 3 0x80 select sshd 60161 201954 36390 73 2 0x100090 syslogd 36390 87291 1 0 3 0x100082 netio syslogd 54393 310698 1 77 3 0x100090 poll dhclient 49568 5849 1 0 3 0x80 poll dhclient 87137 394584 0 0 2 0x14200 zerothread 35056 302914 0 0 3 0x14200 aiodoned aiodoned 50171 139119 0 0 3 0x14200 syncer update 20045 292052 0 0 3 0x14200 cleaner cleaner 67540 386855 0 0 7 0x14200 reaper 3780 454260 0 0 3 0x14200 pgdaemon pagedaemon 25650 87408 0 0 3 0x14200 bored crynlk 28010 348152 0 0 3 0x14200 bored crypto 6785 3011 0 0 3 0x40014200 acpi0 acpi0 71273 3773 0 0 3 0x40014200 idle1 78496 26985 0 0 3 0x14200 bored softnet 93350 97841 0 0 3 0x14200 bored systqmp 25155 30901 0 0 3 0x14200 bored systq 73381 151886 0 0 3 0x40014200 bored softclock 83910 58186 0 0 3 0x40014200 idle0 1 397374 0 0 3 0x82 wait init 0 0 -1 0 3 0x10200 scheduler swapper ddb{1}> show all locks Process 83949 (syz-executor.1) thread 0xffff800020b42978 (88250) shared rwlock wsmuxlk r = 0 (0xffff800000026dd0) locked @ /syzkaller/managers/multicore/kernel/sys/dev/wscons/wsmux.c:245 #0 witness_lock+0x58a sys/kern/subr_witness.c:1205 #1 wsmuxopen+0xf3 wsmux_do_open sys/dev/wscons/wsmux.c:246 [inline] #1 wsmuxopen+0xf3 sys/dev/wscons/wsmux.c:204 #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 (0xffffffff8230eba0) 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 ddb{1}> show malloc Type InUse MemUse HighUse Limit Requests Type Lim Kern Lim devbuf 9514 14549K 14557K 78643K 11261 0 0 pcb 23 9K 11K 78643K 917 0 0 rtable 100 3K 4K 78643K 682 0 0 ifaddr 53 14K 15K 78643K 286 0 0 counters 39 33K 33K 78643K 39 0 0 ioctlops 0 0K 2K 78643K 29 0 0 iov 0 0K 28K 78643K 169 0 0 mount 1 1K 1K 78643K 1 0 0 vnodes 1195 75K 75K 78643K 2351 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 28 0 0 VM map 2 1K 1K 78643K 2 0 0 sem 12 0K 0K 78643K 245 0 0 dirhash 12 2K 2K 78643K 12 0 0 ACPI 1792 194K 288K 78643K 12592 0 0 file desc 5 13K 25K 78643K 1704 0 0 sigio 0 0K 0K 78643K 25 0 0 proc 42 38K 70K 78643K 601 0 0 subproc 64 65538K 67586K 78643K 246 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 222 0 0 in_multi 33 2K 2K 78643K 153 0 0 ether_multi 1 0K 0K 78643K 7 0 0 mrt 0 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 90 397K 397K 78643K 90 0 0 exec 0 0K 1K 78643K 510 0 0 pfkey data 0 0K 0K 78643K 2 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 96 21K 29K 78643K 6418 0 0 UVM aobj 83 3K 3K 78643K 88 0 0 memdesc 1 4K 4K 78643K 1 0 0 crypto data 1 1K 1K 78643K 1 0 0 ip6_options 0 0K 0K 78643K 36 0 0 NDP 10 0K 0K 78643K 85 0 0 temp 156 2367K 2435K 78643K 7647 0 0 kqueue 0 0K 0K 78643K 19 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 9 0 5 1 0 1 1 0 8 0 inpcbpl 280 715 0 708 1 0 1 1 0 8 0 plimitpl 152 43 0 36 1 0 1 1 0 8 0 plcache 128 20 0 0 1 0 1 1 0 8 0 rtentry 112 86 0 46 2 0 2 2 0 8 0 syncache 264 4 0 4 1 1 0 1 0 8 0 tcpqe 32 1 0 1 1 1 0 1 0 8 0 tcpcb 544 246 0 242 1 0 1 1 0 8 0 nd6 48 14 0 10 1 0 1 1 0 8 0 ppxss 1128 40 0 40 14 13 1 1 0 8 1 art_heap8 4096 1 0 0 1 0 1 1 0 8 0 art_heap4 256 405 0 217 12 0 12 12 0 8 0 art_table 32 406 0 217 2 0 2 2 0 8 0 art_node 16 85 0 51 1 0 1 1 0 8 0 sysvmsgpl 40 12 0 6 2 1 1 1 0 8 0 semapl 112 243 0 233 1 0 1 1 0 8 0 shmpl 112 86 0 5 3 0 3 3 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino1pl 128 4834 0 3410 46 0 46 46 0 8 0 ffsino 272 4834 0 3410 95 0 95 95 0 8 0 nchpl 144 7349 0 5745 61 0 61 61 0 8 0 uvmvnodes 72 5099 0 0 93 0 93 93 0 8 0 vnodes 200 5099 0 0 269 0 269 269 0 8 0 namei 1024 21541 0 21541 2 1 1 1 0 8 1 percpumem 16 30 0 0 1 0 1 1 0 8 0 scsiplug 64 2 0 2 2 1 1 1 0 8 1 scxspl 192 51277 0 51277 7 6 1 6 0 8 1 sigapl 432 1858 0 1845 2 0 2 2 0 8 0 futexpl 56 18344 0 18344 1 0 1 1 0 8 1 knotepl 112 515 0 488 5 4 1 2 0 8 0 kqueuepl 104 481 0 479 1 0 1 1 0 8 0 pipepl 112 1240 0 1219 6 5 1 2 0 8 0 fdescpl 488 1859 0 1845 3 1 2 3 0 8 0 filepl 152 10949 0 10852 15 10 5 6 0 8 1 lockfpl 104 602 0 602 8 7 1 1 0 8 1 lockfspl 32 757 0 757 7 6 1 1 0 8 1 sessionpl 112 23 0 13 1 0 1 1 0 8 0 pgrppl 48 50 0 40 1 0 1 1 0 8 0 ucredpl 96 2834 0 2827 1 0 1 1 0 8 0 zombiepl 144 1845 0 1844 2 1 1 1 0 8 0 processpl 840 1874 0 1844 4 0 4 4 0 8 0 procpl 600 5578 0 5537 4 0 4 4 0 8 0 srpgc 64 30 0 30 1 1 0 1 0 8 0 sosppl 128 34 0 34 6 6 0 1 0 8 0 sockpl 384 1550 0 1533 12 9 3 4 0 8 1 mcl64k 65536 238 0 0 30 0 30 30 0 8 0 mcl16k 16384 2 0 0 1 0 1 1 0 8 0 mcl12k 12288 10 0 0 1 0 1 1 0 8 0 mcl9k 9216 13 0 0 1 0 1 1 0 8 0 mcl8k 8192 8 0 0 1 0 1 1 0 8 0 mcl4k 4096 12 0 0 2 0 2 2 0 8 0 mcl2k2 2112 3 0 0 1 0 1 1 0 8 0 mcl2k 2048 118 0 0 13 0 13 13 0 8 0 mtagpl 80 1 0 0 1 0 1 1 0 8 0 mbufpl 256 435 0 0 19 0 19 19 0 8 0 bufpl 256 9020 0 2048 436 0 436 436 0 8 0 anonpl 16 658883 0 649189 141 92 49 65 0 125 10 amapchunkpl 152 12880 0 12752 30 25 5 10 0 158 0 amappl16 192 36501 0 36013 144 115 29 44 0 8 4 amappl15 184 894 0 891 1 0 1 1 0 8 0 amappl14 176 920 0 915 2 1 1 1 0 8 0 amappl13 168 34 0 31 1 0 1 1 0 8 0 amappl12 160 17 0 16 2 1 1 1 0 8 0 amappl11 152 203 0 194 1 0 1 1 0 8 0 amappl10 144 798 0 791 2 1 1 1 0 8 0 amappl9 136 343 0 340 1 0 1 1 0 8 0 amappl8 128 176 0 153 1 0 1 1 0 8 0 amappl7 120 48 0 42 1 0 1 1 0 8 0 amappl6 112 965 0 953 1 0 1 1 0 8 0 amappl5 104 175 0 164 1 0 1 1 0 8 0 amappl4 96 286 0 259 2 1 1 2 0 8 0 amappl3 88 187 0 182 1 0 1 1 0 8 0 amappl2 80 16077 0 16016 3 1 2 2 0 8 0 amappl1 72 51766 0 51305 24 14 10 19 0 8 0 amappl 72 5945 0 5903 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 87 0 5 2 0 2 2 0 8 0 uaddrrnd 24 1859 0 1845 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 1859 0 1845 1 0 1 1 0 8 0 vmmpekpl 168 18724 0 18700 2 0 2 2 0 8 0 vmmpepl 168 294413 0 292846 194 119 75 85 0 357 6 vmsppl 360 1858 0 1844 2 0 2 2 0 8 0 pdppl 4096 3726 0 3688 6 1 5 6 0 8 0 pvpl 32 1531766 0 1519075 284 162 122 160 0 265 14 pmappl 224 1858 0 1844 1 0 1 1 0 8 0 extentpl 40 39 0 25 1 0 1 1 0 8 0 phpool 112 624 0 4 18 0 18 18 0 8 0