witness: acquiring duplicate lock of same type: "&sc->sc_lock" 1st wsmuxlk @ /syzkaller/managers/multicore/kernel/sys/dev/wscons/wsmux.c:629 2nd wsmuxlk @ /syzkaller/managers/multicore/kernel/sys/dev/wscons/wsmux.c:245 Starting stack trace... witness_checkorder(ffff800001966bd0,1,ffffffff81f33463,f5,0) at witness_checkorder+0xe14 witness_debugger sys/kern/subr_witness.c:2650 [inline] witness_checkorder(ffff800001966bd0,1,ffffffff81f33463,f5,0) at witness_checkorder+0xe14 sys/kern/subr_witness.c:926 _rw_enter_read(ffff800001966bc0,ffffffff81f33463,f5) at _rw_enter_read+0x80 sys/kern/kern_rwlock.c:102 wsmux_mux_open(ffff800001966b00,ffff800000026d50) at wsmux_mux_open+0x82 wsmux_do_open sys/dev/wscons/wsmux.c:246 [inline] wsmux_mux_open(ffff800001966b00,ffff800000026d50) at wsmux_mux_open+0x82 sys/dev/wscons/wsmux.c:228 wsmux_attach_sc(ffff800000026d00,ffff800001966b00) at wsmux_attach_sc+0x180 sys/dev/wscons/wsmux.c:670 VOP_IOCTL(fffffd807b22d868,80085761,ffff800020c55ab0,2,fffffd807f7c79c0,ffff800020b42e28) at VOP_IOCTL+0x9a sys/kern/vfs_vops.c:290 vn_ioctl(fffffd8066f53868,80085761,ffff800020c55ab0,ffff800020b42e28) at vn_ioctl+0xc9 sys/kern/vfs_vnops.c:512 sys_ioctl(ffff800020b42e28,ffff800020c55bf8,ffff800020c55be0) at sys_ioctl+0x646 syscall(ffff800020c55c90) at syscall+0x5ac mi_syscall sys/sys/syscall_mi.h:99 [inline] syscall(ffff800020c55c90) at syscall+0x5ac sys/arch/amd64/amd64/trap.c:574 Xsyscall(6,0,ffffffffffffff86,0,3,234febf4010) at Xsyscall+0x128 end of kernel end trace frame: 0x23767b3dd50, count: 248 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(ffff800001966bd0,1,ffffffff81f33463,f5,0) at witness_checkorder+0xe19 witness_debugger sys/kern/subr_witness.c:2650 [inline] witness_checkorder(ffff800001966bd0,1,ffffffff81f33463,f5,0) at witness_checkorder+0xe19 sys/kern/subr_witness.c:926 _rw_enter_read(ffff800001966bc0,ffffffff81f33463,f5) at _rw_enter_read+0x80 sys/kern/kern_rwlock.c:102 wsmux_mux_open(ffff800001966b00,ffff800000026d50) at wsmux_mux_open+0x82 wsmux_do_open sys/dev/wscons/wsmux.c:246 [inline] wsmux_mux_open(ffff800001966b00,ffff800000026d50) at wsmux_mux_open+0x82 sys/dev/wscons/wsmux.c:228 wsmux_attach_sc(ffff800000026d00,ffff800001966b00) at wsmux_attach_sc+0x180 sys/dev/wscons/wsmux.c:670 VOP_IOCTL(fffffd807b22d868,80085761,ffff800020c55ab0,2,fffffd807f7c79c0,ffff800020b42e28) at VOP_IOCTL+0x9a sys/kern/vfs_vops.c:290 vn_ioctl(fffffd8066f53868,80085761,ffff800020c55ab0,ffff800020b42e28) at vn_ioctl+0xc9 sys/kern/vfs_vnops.c:512 sys_ioctl(ffff800020b42e28,ffff800020c55bf8,ffff800020c55be0) at sys_ioctl+0x646 syscall(ffff800020c55c90) at syscall+0x5ac mi_syscall sys/sys/syscall_mi.h:99 [inline] syscall(ffff800020c55c90) at syscall+0x5ac sys/arch/amd64/amd64/trap.c:574 Xsyscall(6,0,ffffffffffffff86,0,3,234febf4010) at Xsyscall+0x128 end of kernel end trace frame: 0x23767b3dd50, count: -10 ddb{1}> show registers rdi 0 rsi 0x3ffff acpi_pdirpa+0x2be67 rbp 0xffff800020c556e0 rbx 0x3 rdx 0x40000 acpi_pdirpa+0x2be68 rcx 0xffff800000947000 rax 0xffff800000941740 r8 0xffffffff818cb2f3 kprintf+0x183 r9 0x1 r10 0x25 r11 0xf0d73937ff31bca7 r12 0xffffffff81f33463 substchar+0x92c4 r13 0xf5 r14 0xffffffff81f22d40 cmd680_setup_channel.udma_tbl+0x3c0b r15 0xffffffff81f33463 substchar+0x92c4 rip 0xffffffff811a46a8 db_enter+0x18 cs 0x8 rflags 0x246 rsp 0xffff800020c556d0 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb{1}> show proc PROC (syz-executor.0) pid=131243 stat=onproc flags process=0 proc=4000000 pri=74, usrpri=74, nice=20 forw=0xffffffffffffffff, list=0xffff800020b43080,0xffff800020b432e8 process=0xffff800020b44d30 user=0xffff800020c50000, vmspace=0xfffffd807effe870 estcpu=36, cpticks=0, pctcpu=0.0 user=0, sys=0, intr=0 ddb{1}> ps PID TID PPID UID S FLAGS WAIT COMMAND 12072 408562 33016 0 2 0 syz-executor.0 *12072 131243 33016 0 7 0x4000000 syz-executor.0 6167 76328 88836 0 2 0 syz-executor.1 6167 332943 88836 0 3 0x4000080 fsleep syz-executor.1 6167 86973 88836 0 3 0x4000080 fsleep syz-executor.1 6167 358008 88836 0 2 0x4000000 syz-executor.1 85535 45275 0 0 3 0x14200 bored sosplice 88836 507222 89954 0 3 0x82 nanosleep syz-executor.1 33016 364428 89954 0 3 0x82 nanosleep syz-executor.0 89954 450683 92256 0 3 0x82 thrsleep syz-fuzzer 89954 187792 92256 0 3 0x4000082 thrsleep syz-fuzzer 89954 16691 92256 0 3 0x4000082 thrsleep syz-fuzzer 89954 123983 92256 0 3 0x4000082 thrsleep syz-fuzzer 89954 456039 92256 0 3 0x4000082 thrsleep syz-fuzzer 89954 9587 92256 0 3 0x4000082 kqread syz-fuzzer 89954 293787 92256 0 3 0x4000082 thrsleep syz-fuzzer 89954 520775 92256 0 3 0x4000082 thrsleep syz-fuzzer 89954 1312 92256 0 3 0x4000082 thrsleep syz-fuzzer 89954 73213 92256 0 3 0x4000082 thrsleep syz-fuzzer 89954 47489 92256 0 3 0x4000082 thrsleep syz-fuzzer 89954 345140 92256 0 3 0x4000082 thrsleep syz-fuzzer 92256 486746 46780 0 3 0x10008a pause ksh 46780 112959 42494 0 3 0x92 select sshd 5507 211788 1 0 3 0x100083 ttyin getty 42494 193699 1 0 3 0x80 select sshd 65881 441064 17909 73 7 0x100090 syslogd 17909 313079 1 0 3 0x100082 netio syslogd 33154 331191 1 77 3 0x100090 poll dhclient 69242 480550 1 0 3 0x80 poll dhclient 39865 235067 0 0 2 0x14200 zerothread 90287 428908 0 0 3 0x14200 aiodoned aiodoned 7673 202569 0 0 3 0x14200 syncer update 250 333560 0 0 3 0x14200 cleaner cleaner 47916 57561 0 0 3 0x14200 reaper reaper 36094 21928 0 0 3 0x14200 pgdaemon pagedaemon 47959 104265 0 0 3 0x14200 bored crynlk 82203 49337 0 0 3 0x14200 bored crypto 13037 156957 0 0 3 0x40014200 acpi0 acpi0 11701 485693 0 0 3 0x40014200 idle1 3989 270292 0 0 3 0x14200 bored softnet 68547 312535 0 0 3 0x14200 bored systqmp 60132 479339 0 0 3 0x14200 bored systq 39818 506025 0 0 3 0x40014200 bored softclock 78534 95926 0 0 3 0x40014200 idle0 1 110069 0 0 3 0x82 wait init 0 0 -1 0 3 0x10200 scheduler swapper ddb{1}> show all locks Process 12072 (syz-executor.0) thread 0xffff800020b42e28 (131243) exclusive rwlock wsmuxlk r = 0 (0xffff800000026dd0) locked @ /syzkaller/managers/multicore/kernel/sys/dev/wscons/wsmux.c:629 #0 witness_lock+0x58a sys/kern/subr_witness.c:1205 #1 wsmux_attach_sc+0x48 sys/dev/wscons/wsmux.c:635 #2 VOP_IOCTL+0x9a sys/kern/vfs_vops.c:290 #3 vn_ioctl+0xc9 sys/kern/vfs_vnops.c:512 #4 sys_ioctl+0x646 #5 syscall+0x5ac mi_syscall sys/sys/syscall_mi.h:99 [inline] #5 syscall+0x5ac sys/arch/amd64/amd64/trap.c:574 #6 Xsyscall+0x128 exclusive kernel_lock &kernel_lock r = 0 (0xffffffff82360c40) 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 9484 6347K 6350K 78643K 10613 0 0 pcb 23 9K 10K 78643K 115 0 0 rtable 100 3K 4K 78643K 189 0 0 ifaddr 45 11K 11K 78643K 53 0 0 counters 39 33K 33K 78643K 39 0 0 ioctlops 0 0K 2K 78643K 15 0 0 iov 0 0K 12K 78643K 14 0 0 mount 1 1K 1K 78643K 1 0 0 vnodes 1202 75K 76K 78643K 1281 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 1K 1K 78643K 28 0 0 dirhash 12 2K 2K 78643K 12 0 0 ACPI 1792 194K 288K 78643K 12592 0 0 file desc 6 17K 25K 78643K 166 0 0 sigio 2 0K 0K 78643K 4 0 0 proc 41 38K 58K 78643K 258 0 0 subproc 64 65538K 67586K 78643K 68 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 22 0 0 in_multi 33 2K 2K 78643K 33 0 0 ether_multi 1 0K 0K 78643K 1 0 0 ISOFS mount 1 32K 32K 78643K 1 0 0 MSDOSFS mount 1 16K 16K 78643K 1 0 0 ttys 48 212K 212K 78643K 48 0 0 exec 0 0K 1K 78643K 168 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 79 20K 20K 78643K 1242 0 0 UVM aobj 9 2K 2K 78643K 9 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 7 0 0 NDP 8 0K 0K 78643K 14 0 0 temp 105 2353K 2417K 78643K 3163 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 4 0 0 1 0 1 1 0 8 0 inpcbpl 280 98 0 89 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 30 0 26 1 0 1 1 0 8 0 nd6 48 4 0 0 1 0 1 1 0 8 0 ppxss 1128 1 0 1 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 semupl 112 1 0 1 1 1 0 1 0 8 0 semapl 112 24 0 14 1 0 1 1 0 8 0 shmpl 112 7 0 0 1 0 1 1 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino1pl 128 1681 0 279 46 0 46 46 0 8 0 ffsino 272 1681 0 279 95 0 95 95 0 8 0 nchpl 144 2110 0 488 61 0 61 61 0 8 0 uvmvnodes 72 1743 0 0 32 0 32 32 0 8 0 vnodes 200 1743 0 0 92 0 92 92 0 8 0 namei 1024 5220 0 5220 2 1 1 1 0 8 1 percpumem 16 30 0 0 1 0 1 1 0 8 0 scxspl 192 5276 0 5276 10 8 2 6 0 8 2 sigapl 432 334 0 320 2 0 2 2 0 8 0 futexpl 56 1645 0 1643 1 0 1 1 0 8 0 knotepl 112 97 0 70 2 1 1 2 0 8 0 kqueuepl 104 40 0 38 1 0 1 1 0 8 0 pipepl 112 228 0 207 2 1 1 1 0 8 0 fdescpl 488 335 0 320 3 1 2 3 0 8 0 filepl 152 1733 0 1633 5 0 5 5 0 8 1 lockfpl 104 66 0 66 2 1 1 1 0 8 1 lockfspl 32 146 0 146 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 251 0 244 1 0 1 1 0 8 0 zombiepl 144 320 0 320 2 1 1 1 0 8 1 processpl 840 350 0 320 4 0 4 4 0 8 0 procpl 600 681 0 636 4 0 4 4 0 8 0 sockpl 384 194 0 175 3 0 3 3 0 8 1 mcl12k 12288 1 0 0 1 0 1 1 0 8 0 mcl9k 9216 1 0 0 1 0 1 1 0 8 0 mcl4k 4096 4 0 0 1 0 1 1 0 8 0 mcl2k2 2112 1 0 0 1 0 1 1 0 8 0 mcl2k 2048 118 0 0 14 0 14 14 0 8 0 mtagpl 80 1 0 0 1 0 1 1 0 8 0 mbufpl 256 135 0 0 8 0 8 8 0 8 0 bufpl 256 5550 0 1014 284 0 284 284 0 8 0 anonpl 16 36353 0 28411 34 1 33 33 0 125 0 amapchunkpl 152 1507 0 1416 5 0 5 5 0 158 0 amappl16 192 1180 0 759 22 0 22 22 0 8 0 amappl15 184 4 0 2 1 0 1 1 0 8 0 amappl14 176 6 0 5 2 1 1 1 0 8 0 amappl13 168 108 0 103 1 0 1 1 0 8 0 amappl12 160 76 0 73 2 1 1 1 0 8 0 amappl11 152 182 0 172 1 0 1 1 0 8 0 amappl10 144 55 0 55 2 2 0 1 0 8 0 amappl9 136 359 0 356 1 0 1 1 0 8 0 amappl8 128 198 0 180 1 0 1 1 0 8 0 amappl7 120 121 0 114 1 0 1 1 0 8 0 amappl6 112 53 0 45 1 0 1 1 0 8 0 amappl5 104 108 0 98 1 0 1 1 0 8 0 amappl4 96 265 0 242 2 1 1 2 0 8 0 amappl3 88 133 0 125 1 0 1 1 0 8 0 amappl2 80 2102 0 2040 2 0 2 2 0 8 0 amappl1 72 15566 0 15142 24 14 10 19 0 8 0 amappl 72 884 0 848 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 8 0 0 1 0 1 1 0 8 0 uaddrrnd 24 335 0 320 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 335 0 320 1 0 1 1 0 8 0 vmmpekpl 168 6494 0 6473 2 0 2 2 0 8 0 vmmpepl 168 41786 0 40345 86 21 65 71 0 357 2 vmsppl 360 334 0 320 2 0 2 2 0 8 0 pdppl 4096 678 0 640 6 1 5 6 0 8 0 pvpl 32 135818 0 124841 105 10 95 96 0 265 6 pmappl 224 334 0 320 1 0 1 1 0 8 0 extentpl 40 39 0 25 1 0 1 1 0 8 0 phpool 112 429 0 4 13 0 13 13 0 8 0