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(ffff8000019685d0,1,ffffffff81f36129,f5,0) at witness_checkorder+0xe14 witness_debugger sys/kern/subr_witness.c:2650 [inline] witness_checkorder(ffff8000019685d0,1,ffffffff81f36129,f5,0) at witness_checkorder+0xe14 sys/kern/subr_witness.c:926 _rw_enter_read(ffff8000019685c0,ffffffff81f36129,f5) at _rw_enter_read+0x80 sys/kern/kern_rwlock.c:102 wsmux_mux_open(ffff800001968500,ffff800000026d50) at wsmux_mux_open+0x82 wsmux_do_open sys/dev/wscons/wsmux.c:246 [inline] wsmux_mux_open(ffff800001968500,ffff800000026d50) at wsmux_mux_open+0x82 sys/dev/wscons/wsmux.c:228 wsmuxopen(4500,8001,2000,ffff800020b42270) at wsmuxopen+0x179 wsmux_do_open sys/dev/wscons/wsmux.c:258 [inline] wsmuxopen(4500,8001,2000,ffff800020b42270) at wsmuxopen+0x179 sys/dev/wscons/wsmux.c:204 spec_open(ffff800020c5cdc0) at spec_open+0x217 sys/kern/spec_vnops.c:158 VOP_OPEN(fffffd807b153ec8,8001,fffffd807f7c7a20,ffff800020b42270) at VOP_OPEN+0x76 sys/kern/vfs_vops.c:153 vn_open(ffff800020c5cfb0,8001,0) at vn_open+0x4c6 sys/kern/vfs_vnops.c:174 doopenat(ffff800020b42270,ffffff9c,20000800,8000,0,ffff800020c5d1f0) at doopenat+0x2be sys/kern/vfs_syscalls.c:1045 syscall(ffff800020c5d2a0) at syscall+0x5ac mi_syscall sys/sys/syscall_mi.h:99 [inline] syscall(ffff800020c5d2a0) at syscall+0x5ac sys/arch/amd64/amd64/trap.c:574 Xsyscall(6,0,ffffffffffffffb1,0,4,86e315520d8) at Xsyscall+0x128 end of kernel end trace frame: 0x870fe0fa090, count: 247 End of stack trace. Stopped at db_enter+0x18: addq $0x8,%rsp ddb{0}> ddb{0}> set $lines = 0 ddb{0}> set $maxwidth = 0 ddb{0}> show panic the kernel did not panic ddb{0}> trace db_enter() at db_enter+0x18 sys/arch/amd64/amd64/db_interface.c:399 witness_checkorder(ffff8000019685d0,1,ffffffff81f36129,f5,0) at witness_checkorder+0xe19 witness_debugger sys/kern/subr_witness.c:2650 [inline] witness_checkorder(ffff8000019685d0,1,ffffffff81f36129,f5,0) at witness_checkorder+0xe19 sys/kern/subr_witness.c:926 _rw_enter_read(ffff8000019685c0,ffffffff81f36129,f5) at _rw_enter_read+0x80 sys/kern/kern_rwlock.c:102 wsmux_mux_open(ffff800001968500,ffff800000026d50) at wsmux_mux_open+0x82 wsmux_do_open sys/dev/wscons/wsmux.c:246 [inline] wsmux_mux_open(ffff800001968500,ffff800000026d50) at wsmux_mux_open+0x82 sys/dev/wscons/wsmux.c:228 wsmuxopen(4500,8001,2000,ffff800020b42270) at wsmuxopen+0x179 wsmux_do_open sys/dev/wscons/wsmux.c:258 [inline] wsmuxopen(4500,8001,2000,ffff800020b42270) at wsmuxopen+0x179 sys/dev/wscons/wsmux.c:204 spec_open(ffff800020c5cdc0) at spec_open+0x217 sys/kern/spec_vnops.c:158 VOP_OPEN(fffffd807b153ec8,8001,fffffd807f7c7a20,ffff800020b42270) at VOP_OPEN+0x76 sys/kern/vfs_vops.c:153 vn_open(ffff800020c5cfb0,8001,0) at vn_open+0x4c6 sys/kern/vfs_vnops.c:174 doopenat(ffff800020b42270,ffffff9c,20000800,8000,0,ffff800020c5d1f0) at doopenat+0x2be sys/kern/vfs_syscalls.c:1045 syscall(ffff800020c5d2a0) at syscall+0x5ac mi_syscall sys/sys/syscall_mi.h:99 [inline] syscall(ffff800020c5d2a0) at syscall+0x5ac sys/arch/amd64/amd64/trap.c:574 Xsyscall(6,0,ffffffffffffffb1,0,4,86e315520d8) at Xsyscall+0x128 end of kernel end trace frame: 0x870fe0fa090, count: -11 ddb{0}> show registers rdi 0 rsi 0x3ffff acpi_pdirpa+0x2be67 rbp 0xffff800020c5cb60 rbx 0x3 rdx 0x40000 acpi_pdirpa+0x2be68 rcx 0xffff800000b47000 rax 0xffff800000941ac0 r8 0xffffffff8155ffb3 kprintf+0x183 r9 0x1 r10 0x25 r11 0x25b48b754cf22fcf 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 0xffff800020c5cb50 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb{0}> show proc PROC (syz-executor.0) pid=475378 stat=onproc flags process=0 proc=4000000 pri=70, usrpri=70, nice=20 forw=0xffffffffffffffff, list=0xffff800020b42720,0xffff800020b42e38 process=0xffff800020b453c0 user=0xffff800020c58000, vmspace=0xfffffd807efff9d8 estcpu=20, cpticks=0, pctcpu=0.0 user=0, sys=0, intr=0 ddb{0}> ps PID TID PPID UID S FLAGS WAIT COMMAND 41422 300196 63580 0 2 0 syz-executor.1 41422 173519 63580 0 2 0x4000000 syz-executor.1 80596 264660 64701 0 2 0 syz-executor.0 80596 347189 64701 0 3 0x4000080 fsleep syz-executor.0 *80596 475378 64701 0 7 0x4000000 syz-executor.0 50988 508940 0 0 3 0x14200 bored sosplice 63580 162687 92496 0 3 0x82 nanosleep syz-executor.1 64701 388581 92496 0 3 0x82 nanosleep syz-executor.0 92496 404500 73362 0 3 0x82 thrsleep syz-fuzzer 92496 332190 73362 0 3 0x4000082 thrsleep syz-fuzzer 92496 357533 73362 0 3 0x4000082 thrsleep syz-fuzzer 92496 207927 73362 0 3 0x4000082 thrsleep syz-fuzzer 92496 28777 73362 0 3 0x4000082 thrsleep syz-fuzzer 92496 496431 73362 0 3 0x4000082 thrsleep syz-fuzzer 92496 147566 73362 0 3 0x4000082 thrsleep syz-fuzzer 92496 221064 73362 0 3 0x4000082 thrsleep syz-fuzzer 92496 405273 73362 0 3 0x4000082 kqread syz-fuzzer 92496 50507 73362 0 3 0x4000082 thrsleep syz-fuzzer 73362 100507 37661 0 3 0x10008a pause ksh 37661 350838 95412 0 3 0x92 select sshd 97320 110036 1 0 3 0x100083 ttyin getty 95412 315236 1 0 3 0x80 select sshd 89489 85346 96129 73 7 0x100090 syslogd 96129 231873 1 0 3 0x100082 netio syslogd 98247 351772 1 77 3 0x100090 poll dhclient 95372 264083 1 0 3 0x80 poll dhclient 32507 97062 0 0 2 0x14200 zerothread 17727 392275 0 0 3 0x14200 aiodoned aiodoned 80749 361663 0 0 3 0x14200 syncer update 38616 451895 0 0 3 0x14200 cleaner cleaner 56033 64566 0 0 3 0x14200 reaper reaper 62084 284750 0 0 3 0x14200 pgdaemon pagedaemon 75057 425109 0 0 3 0x14200 bored crynlk 59859 183473 0 0 3 0x14200 bored crypto 89977 176930 0 0 3 0x40014200 acpi0 acpi0 49913 136941 0 0 3 0x40014200 idle1 9297 469152 0 0 3 0x14200 bored softnet 75681 76545 0 0 3 0x14200 bored systqmp 17739 188650 0 0 3 0x14200 bored systq 8895 79419 0 0 3 0x40014200 bored softclock 7369 222092 0 0 3 0x40014200 idle0 1 471128 0 0 3 0x82 wait init 0 0 -1 0 3 0x10200 scheduler swapper ddb{0}> show all locks Process 80596 (syz-executor.0) thread 0xffff800020b42270 (475378) 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{0}> show malloc Type InUse MemUse HighUse Limit Requests Type Lim Kern Lim devbuf 9497 6357K 6357K 78643K 10661 0 0 pcb 24 9K 9K 78643K 128 0 0 rtable 100 3K 4K 78643K 232 0 0 ifaddr 50 12K 12K 78643K 85 0 0 counters 39 33K 33K 78643K 39 0 0 ioctlops 0 0K 2K 78643K 15 0 0 iov 0 0K 20K 78643K 19 0 0 mount 1 1K 1K 78643K 1 0 0 vnodes 1201 75K 75K 78643K 1313 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 6 0 0 VM map 2 1K 1K 78643K 2 0 0 sem 12 0K 0K 78643K 30 0 0 dirhash 12 2K 2K 78643K 12 0 0 ACPI 1792 194K 288K 78643K 12592 0 0 file desc 6 17K 21K 78643K 182 0 0 sigio 0 0K 0K 78643K 10 0 0 proc 41 38K 58K 78643K 265 0 0 subproc 64 65538K 67586K 78643K 72 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 27 0 0 in_multi 33 2K 2K 78643K 38 0 0 ether_multi 1 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 66 291K 291K 78643K 66 0 0 exec 0 0K 1K 78643K 175 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 81 20K 20K 78643K 1317 0 0 UVM aobj 11 2K 3K 78643K 13 0 0 memdesc 1 4K 4K 78643K 1 0 0 crypto data 1 1K 1K 78643K 1 0 0 NDP 9 0K 0K 78643K 22 0 0 temp 126 2357K 2421K 78643K 3314 0 0 SYN cache 2 16K 16K 78643K 2 0 0 ddb{0}> show all pools Name Size Requests Fail Releases Pgreq Pgrel Npage Hiwat Minpg Maxpg Idle arp 64 4 0 0 1 0 1 1 0 8 0 inpcbpl 280 88 0 81 1 0 1 1 0 8 0 plimitpl 152 16 0 9 1 0 1 1 0 8 0 plcache 128 20 0 0 1 0 1 1 0 8 0 rtentry 112 41 0 1 2 0 2 2 0 8 0 syncache 264 4 0 4 1 1 0 1 0 8 0 tcpcb 544 28 0 24 1 0 1 1 0 8 0 nd6 48 4 0 0 1 0 1 1 0 8 0 ppxss 1128 8 0 8 1 0 1 1 0 8 1 art_heap8 4096 1 0 0 1 0 1 1 0 8 0 art_heap4 256 185 0 0 12 0 12 12 0 8 0 art_table 32 186 0 0 2 0 2 2 0 8 0 art_node 16 40 0 6 1 0 1 1 0 8 0 sysvmsgpl 40 8 0 4 1 0 1 1 0 8 0 semapl 112 28 0 18 1 0 1 1 0 8 0 shmpl 112 11 0 2 1 0 1 1 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino1pl 128 1766 0 359 46 0 46 46 0 8 0 ffsino 272 1766 0 359 95 0 95 95 0 8 0 nchpl 144 2241 0 619 61 0 61 61 0 8 0 uvmvnodes 72 1824 0 0 34 0 34 34 0 8 0 vnodes 200 1824 0 0 96 0 96 96 0 8 0 namei 1024 5712 0 5712 2 1 1 1 0 8 1 percpumem 16 30 0 0 1 0 1 1 0 8 0 scsiplug 64 1 0 1 1 1 0 1 0 8 0 scxspl 192 5480 0 5480 7 6 1 6 0 8 1 sigapl 432 350 0 336 2 0 2 2 0 8 0 futexpl 56 1958 0 1957 1 0 1 1 0 8 0 knotepl 112 100 0 73 3 2 1 2 0 8 0 kqueuepl 104 52 0 50 1 0 1 1 0 8 0 pipepl 112 212 0 191 2 1 1 1 0 8 0 fdescpl 488 351 0 336 3 1 2 3 0 8 0 filepl 152 1915 0 1816 6 1 5 5 0 8 1 lockfpl 104 44 0 44 2 1 1 1 0 8 1 lockfspl 32 42 0 42 2 1 1 1 0 8 1 sessionpl 112 17 0 7 1 0 1 1 0 8 0 pgrppl 48 19 0 9 1 0 1 1 0 8 0 ucredpl 96 360 0 353 1 0 1 1 0 8 0 zombiepl 144 336 0 336 2 1 1 1 0 8 1 processpl 840 366 0 336 4 0 4 4 0 8 0 procpl 600 754 0 712 4 0 4 4 0 8 0 sosppl 128 3 0 3 1 0 1 1 0 8 1 sockpl 384 191 0 173 3 0 3 3 0 8 1 mcl64k 65536 9 0 0 2 0 2 2 0 8 0 mcl12k 12288 1 0 0 1 0 1 1 0 8 0 mcl8k 8192 1 0 0 1 0 1 1 0 8 0 mcl4k 4096 4 0 0 1 0 1 1 0 8 0 mcl2k 2048 105 0 0 13 0 13 13 0 8 0 mtagpl 80 1 0 0 1 0 1 1 0 8 0 mbufpl 256 140 0 0 8 0 8 8 0 8 0 bufpl 256 5543 0 1014 284 0 284 284 0 8 0 anonpl 16 37041 0 29456 32 1 31 31 0 125 0 amapchunkpl 152 1592 0 1503 5 0 5 5 0 158 0 amappl16 192 1179 0 781 21 0 21 21 0 8 0 amappl15 184 1 0 0 1 0 1 1 0 8 0 amappl14 176 91 0 87 2 1 1 1 0 8 0 amappl13 168 24 0 21 1 0 1 1 0 8 0 amappl12 160 9 0 9 2 2 0 1 0 8 0 amappl11 152 262 0 251 1 0 1 1 0 8 0 amappl10 144 58 0 55 2 1 1 1 0 8 0 amappl9 136 440 0 433 1 0 1 1 0 8 0 amappl8 128 132 0 115 1 0 1 1 0 8 0 amappl7 120 39 0 33 1 0 1 1 0 8 0 amappl6 112 132 0 124 1 0 1 1 0 8 0 amappl5 104 126 0 114 1 0 1 1 0 8 0 amappl4 96 264 0 242 1 0 1 1 0 8 0 amappl3 88 128 0 123 1 0 1 1 0 8 0 amappl2 80 2263 0 2201 2 0 2 2 0 8 0 amappl1 72 15650 0 15207 24 14 10 19 0 8 0 amappl 72 957 0 922 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 12 0 2 1 0 1 1 0 8 0 uaddrrnd 24 351 0 336 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 351 0 336 1 0 1 1 0 8 0 vmmpekpl 168 6644 0 6622 2 0 2 2 0 8 0 vmmpepl 168 43394 0 41960 82 19 63 71 0 357 0 vmsppl 360 350 0 336 2 0 2 2 0 8 0 pdppl 4096 710 0 672 6 1 5 6 0 8 0 pvpl 32 138306 0 127699 106 13 93 96 0 265 6 pmappl 224 350 0 336 1 0 1 1 0 8 0 extentpl 40 39 0 25 1 0 1 1 0 8 0 phpool 112 431 0 4 13 0 13 13 0 8 0