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(ffff800002b48ad0,1,ffffffff81f36129,f5,0) at witness_checkorder+0xe14 witness_debugger sys/kern/subr_witness.c:2650 [inline] witness_checkorder(ffff800002b48ad0,1,ffffffff81f36129,f5,0) at witness_checkorder+0xe14 sys/kern/subr_witness.c:926 _rw_enter_read(ffff800002b48ac0,ffffffff81f36129,f5) at _rw_enter_read+0x80 sys/kern/kern_rwlock.c:102 wsmux_mux_open(ffff800002b48a00,ffff800000026d50) at wsmux_mux_open+0x82 wsmux_do_open sys/dev/wscons/wsmux.c:246 [inline] wsmux_mux_open(ffff800002b48a00,ffff800000026d50) at wsmux_mux_open+0x82 sys/dev/wscons/wsmux.c:228 wsmuxopen(4500,801,2000,ffff800020b43c38) at wsmuxopen+0x179 wsmux_do_open sys/dev/wscons/wsmux.c:258 [inline] wsmuxopen(4500,801,2000,ffff800020b43c38) at wsmuxopen+0x179 sys/dev/wscons/wsmux.c:204 spec_open(ffff800020c3f380) at spec_open+0x217 sys/kern/spec_vnops.c:158 VOP_OPEN(fffffd8064c49948,801,fffffd807f7c7960,ffff800020b43c38) at VOP_OPEN+0x76 sys/kern/vfs_vops.c:153 vn_open(ffff800020c3f570,801,0) at vn_open+0x4c6 sys/kern/vfs_vnops.c:174 doopenat(ffff800020b43c38,ffffff9c,20000080,800,0,ffff800020c3f7b0) at doopenat+0x2be sys/kern/vfs_syscalls.c:1045 syscall(ffff800020c3f860) at syscall+0x5ac mi_syscall sys/sys/syscall_mi.h:99 [inline] syscall(ffff800020c3f860) at syscall+0x5ac sys/arch/amd64/amd64/trap.c:574 Xsyscall(6,0,ffffffffffffffb1,0,4,9ba9ee29010) at Xsyscall+0x128 end of kernel end trace frame: 0x9bd2bd67970, 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(ffff800002b48ad0,1,ffffffff81f36129,f5,0) at witness_checkorder+0xe19 witness_debugger sys/kern/subr_witness.c:2650 [inline] witness_checkorder(ffff800002b48ad0,1,ffffffff81f36129,f5,0) at witness_checkorder+0xe19 sys/kern/subr_witness.c:926 _rw_enter_read(ffff800002b48ac0,ffffffff81f36129,f5) at _rw_enter_read+0x80 sys/kern/kern_rwlock.c:102 wsmux_mux_open(ffff800002b48a00,ffff800000026d50) at wsmux_mux_open+0x82 wsmux_do_open sys/dev/wscons/wsmux.c:246 [inline] wsmux_mux_open(ffff800002b48a00,ffff800000026d50) at wsmux_mux_open+0x82 sys/dev/wscons/wsmux.c:228 wsmuxopen(4500,801,2000,ffff800020b43c38) at wsmuxopen+0x179 wsmux_do_open sys/dev/wscons/wsmux.c:258 [inline] wsmuxopen(4500,801,2000,ffff800020b43c38) at wsmuxopen+0x179 sys/dev/wscons/wsmux.c:204 spec_open(ffff800020c3f380) at spec_open+0x217 sys/kern/spec_vnops.c:158 VOP_OPEN(fffffd8064c49948,801,fffffd807f7c7960,ffff800020b43c38) at VOP_OPEN+0x76 sys/kern/vfs_vops.c:153 vn_open(ffff800020c3f570,801,0) at vn_open+0x4c6 sys/kern/vfs_vnops.c:174 doopenat(ffff800020b43c38,ffffff9c,20000080,800,0,ffff800020c3f7b0) at doopenat+0x2be sys/kern/vfs_syscalls.c:1045 syscall(ffff800020c3f860) at syscall+0x5ac mi_syscall sys/sys/syscall_mi.h:99 [inline] syscall(ffff800020c3f860) at syscall+0x5ac sys/arch/amd64/amd64/trap.c:574 Xsyscall(6,0,ffffffffffffffb1,0,4,9ba9ee29010) at Xsyscall+0x128 end of kernel end trace frame: 0x9bd2bd67970, count: -11 ddb{1}> show registers rdi 0 rsi 0x3ffff acpi_pdirpa+0x2be67 rbp 0xffff800020c3f120 rbx 0x3 rdx 0x40000 acpi_pdirpa+0x2be68 rcx 0xffff800000947000 rax 0xffff8000009419c0 r8 0xffffffff8155ffb3 kprintf+0x183 r9 0x1 r10 0x25 r11 0xce45db1ec2d5fd75 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 0xffff800020c3f110 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb{1}> show proc PROC (syz-executor.0) pid=279820 stat=onproc flags process=0 proc=4000000 pri=70, usrpri=70, nice=20 forw=0xffffffffffffffff, list=0xffff800020b43788,0xffffffff8233fe30 process=0xffff800020b45708 user=0xffff800020c3a000, vmspace=0xfffffd807efff2d0 estcpu=36, cpticks=0, pctcpu=0.0 user=0, sys=0, intr=0 ddb{1}> ps PID TID PPID UID S FLAGS WAIT COMMAND 76922 520774 83989 0 7 0 syz-executor.0 *76922 279820 83989 0 7 0x4000000 syz-executor.0 98281 387151 75420 0 3 0x80 nanosleep syz-executor.1 98281 21040 75420 0 3 0x4000080 switchread syz-executor.1 98281 253905 75420 0 3 0x4000080 fsleep syz-executor.1 75420 477529 78193 0 3 0x82 nanosleep syz-executor.1 31556 379178 1 0 3 0x100083 ttyin getty 31282 425151 0 0 3 0x14200 bored sosplice 83989 464130 78193 0 3 0x82 nanosleep syz-executor.0 78193 436313 60410 0 3 0x82 thrsleep syz-fuzzer 78193 130811 60410 0 3 0x4000082 nanosleep syz-fuzzer 78193 123400 60410 0 3 0x4000082 thrsleep syz-fuzzer 78193 242460 60410 0 3 0x4000082 thrsleep syz-fuzzer 78193 138847 60410 0 3 0x4000082 thrsleep syz-fuzzer 78193 272534 60410 0 3 0x4000082 thrsleep syz-fuzzer 78193 503778 60410 0 3 0x4000082 kqread syz-fuzzer 78193 420510 60410 0 3 0x4000082 thrsleep syz-fuzzer 78193 170507 60410 0 3 0x4000082 thrsleep syz-fuzzer 78193 26537 60410 0 3 0x4000082 thrsleep syz-fuzzer 60410 66087 86283 0 3 0x10008a pause ksh 86283 85986 24583 0 3 0x92 select sshd 24583 436076 1 0 3 0x80 select sshd 86801 174585 16310 73 2 0x100090 syslogd 16310 35964 1 0 3 0x100082 netio syslogd 37579 273752 1 77 3 0x100090 poll dhclient 62093 430866 1 0 3 0x80 poll dhclient 8927 209891 0 0 3 0x14200 pgzero zerothread 17171 466319 0 0 3 0x14200 aiodoned aiodoned 19746 92875 0 0 3 0x14200 syncer update 51792 474490 0 0 3 0x14200 cleaner cleaner 38405 129400 0 0 3 0x14200 reaper reaper 21506 362508 0 0 3 0x14200 pgdaemon pagedaemon 1460 51986 0 0 3 0x14200 bored crynlk 77837 385777 0 0 3 0x14200 bored crypto 27534 91561 0 0 3 0x40014200 acpi0 acpi0 21161 232571 0 0 3 0x40014200 idle1 26435 181442 0 0 3 0x14200 bored softnet 90957 231935 0 0 3 0x14200 bored systqmp 4020 367900 0 0 3 0x14200 bored systq 67116 150211 0 0 3 0x40014200 bored softclock 62298 19040 0 0 3 0x40014200 idle0 1 12569 0 0 3 0x82 wait init 0 0 -1 0 3 0x10200 scheduler swapper ddb{1}> show all locks Process 76922 (syz-executor.0) thread 0xffff800020b43c38 (279820) 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 9555 14570K 14577K 78643K 11684 0 0 pcb 23 9K 12K 78643K 1561 0 0 rtable 100 3K 4K 78643K 682 0 0 ifaddr 66 15K 16K 78643K 347 0 0 counters 39 33K 33K 78643K 39 0 0 ioctlops 0 0K 2K 78643K 42 0 0 iov 0 0K 24K 78643K 440 0 0 mount 1 1K 1K 78643K 1 0 0 vnodes 1208 76K 77K 78643K 4967 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 35 0 0 VM map 2 1K 1K 78643K 2 0 0 sem 12 0K 1K 78643K 943 0 0 dirhash 12 2K 2K 78643K 12 0 0 ACPI 1792 194K 288K 78643K 12592 0 0 file desc 6 17K 25K 78643K 5248 0 0 sigio 0 0K 0K 78643K 63 0 0 proc 43 38K 70K 78643K 900 0 0 subproc 64 65538K 67586K 78643K 121 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 393 0 0 in_multi 33 2K 2K 78643K 152 0 0 ether_multi 1 0K 0K 78643K 13 0 0 mrt 0 0K 0K 78643K 2 0 0 ISOFS mount 1 32K 32K 78643K 1 0 0 MSDOSFS mount 1 16K 16K 78643K 1 0 0 ttys 114 503K 503K 78643K 114 0 0 exec 0 0K 1K 78643K 445 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 114 22K 31K 78643K 16811 0 0 UVM aobj 130 5K 5K 78643K 142 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 106 0 0 NDP 14 0K 0K 78643K 96 0 0 temp 184 2367K 2437K 78643K 15703 0 0 kqueue 0 0K 0K 78643K 28 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 5 0 1 1 0 1 1 0 8 0 inpcbpl 280 1489 0 1482 1 0 1 1 0 8 0 plimitpl 152 49 0 42 1 0 1 1 0 8 0 plcache 128 20 0 0 1 0 1 1 0 8 0 rtentry 112 50 0 10 2 0 2 2 0 8 0 syncache 264 4 0 4 1 1 0 1 0 8 0 tcpcb 544 488 0 484 1 0 1 1 0 8 0 nd6 48 6 0 2 1 0 1 1 0 8 0 swfcl 56 2 0 0 1 0 1 1 0 8 0 ppxss 1128 50 0 50 17 16 1 1 0 8 1 art_heap8 4096 1 0 0 1 0 1 1 0 8 0 art_heap4 256 227 0 41 12 0 12 12 0 8 0 art_table 32 228 0 41 2 0 2 2 0 8 0 art_node 16 49 0 15 1 0 1 1 0 8 0 sysvmsgpl 40 12 0 6 1 0 1 1 0 8 0 semapl 112 939 0 929 1 0 1 1 0 8 0 shmpl 112 140 0 12 4 0 4 4 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino1pl 128 12395 0 10913 48 0 48 48 0 8 0 ffsino 272 12395 0 10913 99 0 99 99 0 8 0 nchpl 144 19574 0 17967 61 0 61 61 0 8 0 uvmvnodes 72 5926 0 0 108 0 108 108 0 8 0 vnodes 200 5926 0 0 312 0 312 312 0 8 0 namei 1024 59306 0 59306 3 2 1 1 0 8 1 percpumem 16 30 0 0 1 0 1 1 0 8 0 scsiplug 64 10 0 10 8 8 0 1 0 8 0 scxspl 192 50233 0 50233 22 21 1 6 0 8 1 sigapl 432 5418 0 5404 2 0 2 2 0 8 0 futexpl 56 52966 0 52965 2 1 1 1 0 8 0 knotepl 112 677 0 650 4 2 2 2 0 8 1 kqueuepl 104 909 0 907 1 0 1 1 0 8 0 pipepl 112 2368 0 2349 8 7 1 2 0 8 0 fdescpl 488 5419 0 5404 3 1 2 3 0 8 0 filepl 152 30539 0 30442 19 14 5 7 0 8 1 lockfpl 104 1176 0 1175 11 10 1 1 0 8 0 lockfspl 32 1661 0 1660 11 10 1 1 0 8 0 sessionpl 112 23 0 13 1 0 1 1 0 8 0 pgrppl 48 71 0 61 1 0 1 1 0 8 0 ucredpl 96 12497 0 12490 1 0 1 1 0 8 0 zombiepl 144 5404 0 5404 2 1 1 1 0 8 1 processpl 840 5434 0 5404 4 0 4 4 0 8 0 procpl 600 16039 0 15997 4 0 4 4 0 8 0 srpgc 64 6 0 6 1 1 0 1 0 8 0 sosppl 128 42 0 42 8 8 0 1 0 8 0 sockpl 384 2826 0 2809 18 15 3 4 0 8 1 mcl64k 65536 778 0 0 90 40 50 66 0 8 0 mcl16k 16384 4 0 0 1 0 1 1 0 8 0 mcl12k 12288 25 0 0 2 0 2 2 0 8 0 mcl9k 9216 12 0 0 1 0 1 1 0 8 0 mcl8k 8192 11 0 0 2 0 2 2 0 8 0 mcl4k 4096 33 0 0 4 1 3 3 0 8 0 mcl2k2 2112 9 0 0 1 0 1 1 0 8 0 mcl2k 2048 112 0 0 12 0 12 12 0 8 0 mtagpl 80 1 0 0 1 0 1 1 0 8 0 mbufpl 256 849 0 0 36 0 36 36 0 8 0 bufpl 256 13432 0 6460 437 0 437 437 0 8 0 anonpl 16 466529 0 458555 154 114 40 50 0 125 4 amapchunkpl 152 29782 0 29682 52 43 9 9 0 158 4 amappl16 192 26058 0 25634 130 104 26 34 0 8 4 amappl15 184 1 0 0 1 0 1 1 0 8 0 amappl14 176 13 0 11 2 1 1 1 0 8 0 amappl13 168 2385 0 2380 1 0 1 1 0 8 0 amappl12 160 2662 0 2660 2 1 1 1 0 8 0 amappl11 152 393 0 382 1 0 1 1 0 8 0 amappl10 144 65 0 62 2 1 1 1 0 8 0 amappl9 136 545 0 541 1 0 1 1 0 8 0 amappl8 128 206 0 164 2 0 2 2 0 8 0 amappl7 120 2398 0 2390 1 0 1 1 0 8 0 amappl6 112 58 0 49 1 0 1 1 0 8 0 amappl5 104 192 0 181 1 0 1 1 0 8 0 amappl4 96 318 0 293 2 1 1 2 0 8 0 amappl3 88 2922 0 2917 1 0 1 1 0 8 0 amappl2 80 53181 0 53115 2 0 2 2 0 8 0 amappl1 72 118076 0 117625 24 14 10 19 0 8 0 amappl 72 16279 0 16241 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 141 0 12 3 0 3 3 0 8 0 uaddrrnd 24 5419 0 5404 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 5419 0 5404 1 0 1 1 0 8 0 vmmpekpl 168 45167 0 45145 2 0 2 2 0 8 0 vmmpepl 168 559984 0 558479 167 98 69 77 0 357 3 vmsppl 360 5418 0 5404 2 0 2 2 0 8 0 pdppl 4096 10846 0 10808 6 1 5 6 0 8 0 pvpl 32 1366741 0 1355551 326 212 114 131 0 265 19 pmappl 224 5418 0 5404 1 0 1 1 0 8 0 extentpl 40 39 0 25 1 0 1 1 0 8 0 phpool 112 709 0 46 20 0 20 20 0 8 0