witness: acquiring duplicate lock of same type: "&sc->sc_lock" 1st wsmuxlk @ /syzkaller/managers/multicore/kernel/sys/dev/wscons/wsmux.c:519 2nd wsmuxlk @ /syzkaller/managers/multicore/kernel/sys/dev/wscons/wsmux.c:519 Starting stack trace... witness_checkorder(ffff800000943ad0,1,ffffffff81f354ca,207,0) at witness_checkorder+0xe14 witness_debugger sys/kern/subr_witness.c:2650 [inline] witness_checkorder(ffff800000943ad0,1,ffffffff81f354ca,207,0) at witness_checkorder+0xe14 sys/kern/subr_witness.c:926 _rw_enter_read(ffff800000943ac0,ffffffff81f354ca,207) at _rw_enter_read+0x80 sys/kern/kern_rwlock.c:102 wsmux_do_ioctl(ffff800000943a00,40047601,ffff800020c019d0,1,ffff800020b43c38) at wsmux_do_ioctl+0x4ef wsmux_do_ioctl(ffff800000026d00,40047601,ffff800020c019d0,1,ffff800020b43c38) at wsmux_do_ioctl+0x583 sys/dev/wscons/wsmux.c:528 VOP_IOCTL(fffffd807c747758,40047601,ffff800020c019d0,1,fffffd807f7c7a80,ffff800020b43c38) at VOP_IOCTL+0x9a sys/kern/vfs_vops.c:290 vn_ioctl(fffffd8066f6b740,40047601,ffff800020c019d0,ffff800020b43c38) at vn_ioctl+0xc9 sys/kern/vfs_vnops.c:512 sys_ioctl(ffff800020b43c38,ffff800020c01b18,ffff800020c01b00) at sys_ioctl+0x646 syscall(ffff800020c01bb0) at syscall+0x5ac mi_syscall sys/sys/syscall_mi.h:99 [inline] syscall(ffff800020c01bb0) at syscall+0x5ac sys/arch/amd64/amd64/trap.c:574 Xsyscall(6,0,ffffffffffffff6e,0,3,500fd3b7010) at Xsyscall+0x128 end of kernel end trace frame: 0x50385522920, count: 248 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(ffff800000943ad0,1,ffffffff81f354ca,207,0) at witness_checkorder+0xe19 witness_debugger sys/kern/subr_witness.c:2650 [inline] witness_checkorder(ffff800000943ad0,1,ffffffff81f354ca,207,0) at witness_checkorder+0xe19 sys/kern/subr_witness.c:926 _rw_enter_read(ffff800000943ac0,ffffffff81f354ca,207) at _rw_enter_read+0x80 sys/kern/kern_rwlock.c:102 wsmux_do_ioctl(ffff800000943a00,40047601,ffff800020c019d0,1,ffff800020b43c38) at wsmux_do_ioctl+0x4ef wsmux_do_ioctl(ffff800000026d00,40047601,ffff800020c019d0,1,ffff800020b43c38) at wsmux_do_ioctl+0x583 sys/dev/wscons/wsmux.c:528 VOP_IOCTL(fffffd807c747758,40047601,ffff800020c019d0,1,fffffd807f7c7a80,ffff800020b43c38) at VOP_IOCTL+0x9a sys/kern/vfs_vops.c:290 vn_ioctl(fffffd8066f6b740,40047601,ffff800020c019d0,ffff800020b43c38) at vn_ioctl+0xc9 sys/kern/vfs_vnops.c:512 sys_ioctl(ffff800020b43c38,ffff800020c01b18,ffff800020c01b00) at sys_ioctl+0x646 syscall(ffff800020c01bb0) at syscall+0x5ac mi_syscall sys/sys/syscall_mi.h:99 [inline] syscall(ffff800020c01bb0) at syscall+0x5ac sys/arch/amd64/amd64/trap.c:574 Xsyscall(6,0,ffffffffffffff6e,0,3,500fd3b7010) at Xsyscall+0x128 end of kernel end trace frame: 0x50385522920, count: -10 ddb{0}> show registers rdi 0 rsi 0x3ffff acpi_pdirpa+0x2be67 rbp 0xffff800020c01580 rbx 0x3 rdx 0x40000 acpi_pdirpa+0x2be68 rcx 0xffff800001548000 rax 0xffff800001547740 r8 0xffffffff81316553 kprintf+0x183 r9 0x1 r10 0x25 r11 0xcd52707ea0e2c190 r12 0xffffffff81f354ca substchar+0x955e r13 0x207 r14 0xffffffff81f25297 apollo_udma33_tim+0x16e4 r15 0xffffffff81f354ca substchar+0x955e rip 0xffffffff81264218 db_enter+0x18 cs 0x8 rflags 0x246 rsp 0xffff800020c01570 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb{0}> show proc PROC (syz-executor.0) pid=474951 stat=onproc flags process=0 proc=4000000 pri=77, usrpri=77, nice=20 forw=0xffffffffffffffff, list=0xffff800020b424c8,0xffff800020b439f0 process=0xffff800020b45708 user=0xffff800020bfc000, vmspace=0xfffffd807f00d168 estcpu=36, cpticks=0, pctcpu=0.0 user=0, sys=0, intr=0 ddb{0}> ps PID TID PPID UID S FLAGS WAIT COMMAND 17068 96543 96335 0 2 0 syz-executor.0 *17068 474951 96335 0 7 0x4000000 syz-executor.0 43784 248250 43311 0 2 0 syz-executor.1 43784 222111 43311 0 3 0x4000080 bell syz-executor.1 43784 464230 43311 0 2 0x4000000 syz-executor.1 93294 172332 1 0 3 0x100083 ttyin getty 96335 72199 5911 0 3 0x82 nanosleep syz-executor.0 77714 176815 0 0 3 0x14200 bored sosplice 43311 192842 5911 0 3 0x82 nanosleep syz-executor.1 5911 115041 84788 0 3 0x82 thrsleep syz-fuzzer 5911 95614 84788 0 3 0x4000082 thrsleep syz-fuzzer 5911 206156 84788 0 3 0x4000082 thrsleep syz-fuzzer 5911 181341 84788 0 3 0x4000082 thrsleep syz-fuzzer 5911 134502 84788 0 3 0x4000082 kqread syz-fuzzer 5911 417891 84788 0 3 0x4000082 thrsleep syz-fuzzer 5911 424334 84788 0 3 0x4000082 thrsleep syz-fuzzer 5911 242261 84788 0 3 0x4000082 thrsleep syz-fuzzer 5911 114055 84788 0 3 0x4000082 thrsleep syz-fuzzer 5911 371746 84788 0 3 0x4000082 thrsleep syz-fuzzer 5911 135516 84788 0 3 0x4000082 thrsleep syz-fuzzer 84788 276875 26258 0 3 0x10008a pause ksh 26258 63185 67213 0 3 0x92 select sshd 67213 252063 1 0 3 0x80 select sshd 91894 437163 72788 73 7 0x100090 syslogd 72788 274334 1 0 3 0x100082 netio syslogd 11534 260533 1 77 3 0x100090 poll dhclient 70388 12822 1 0 3 0x80 poll dhclient 13606 18955 0 0 2 0x14200 zerothread 82409 95082 0 0 3 0x14200 aiodoned aiodoned 95282 301392 0 0 3 0x14200 syncer update 62985 394036 0 0 3 0x14200 cleaner cleaner 1133 279194 0 0 3 0x14200 reaper reaper 18857 117254 0 0 3 0x14200 pgdaemon pagedaemon 93637 294368 0 0 3 0x14200 bored crynlk 74378 249371 0 0 3 0x14200 bored crypto 98264 21462 0 0 3 0x40014200 acpi0 acpi0 66751 183577 0 0 3 0x40014200 idle1 5822 30907 0 0 3 0x14200 bored softnet 79228 36713 0 0 3 0x14200 bored systqmp 17552 105403 0 0 3 0x14200 bored systq 7590 33318 0 0 3 0x40014200 bored softclock 40677 130256 0 0 3 0x40014200 idle0 1 472869 0 0 3 0x82 wait init 0 0 -1 0 3 0x10200 scheduler swapper ddb{0}> show all locks Process 17068 (syz-executor.0) thread 0xffff800020b43c38 (474951) shared rwlock wsmuxlk r = 0 (0xffff800000026dd0) locked @ /syzkaller/managers/multicore/kernel/sys/dev/wscons/wsmux.c:519 #0 witness_lock+0x58a sys/kern/subr_witness.c:1205 #1 wsmux_do_ioctl+0x4ef #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 (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 ddb{0}> show malloc Type InUse MemUse HighUse Limit Requests Type Lim Kern Lim devbuf 9496 6345K 6350K 78643K 10960 0 0 pcb 23 9K 10K 78643K 547 0 0 rtable 100 3K 4K 78643K 399 0 0 ifaddr 47 12K 13K 78643K 158 0 0 counters 39 33K 33K 78643K 39 0 0 ioctlops 0 0K 2K 78643K 24 0 0 iov 0 0K 16K 78643K 95 0 0 mount 1 1K 1K 78643K 1 0 0 vnodes 1217 76K 77K 78643K 1969 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 20 0 0 VM map 2 1K 1K 78643K 2 0 0 sem 12 1K 1K 78643K 146 0 0 dirhash 12 2K 2K 78643K 12 0 0 ACPI 1792 194K 288K 78643K 12592 0 0 file desc 6 17K 21K 78643K 1116 0 0 sigio 0 0K 0K 78643K 18 0 0 proc 42 38K 58K 78643K 428 0 0 subproc 64 65538K 67586K 78643K 154 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 137 0 0 in_multi 33 2K 2K 78643K 98 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 242 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 92 21K 29K 78643K 4262 0 0 UVM aobj 64 4K 4K 78643K 70 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 48 0 0 NDP 8 0K 0K 78643K 44 0 0 temp 142 2366K 2432K 78643K 5881 0 0 kqueue 0 0K 0K 78643K 9 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 6 0 2 1 0 1 1 0 8 0 inpcbpl 280 580 0 573 1 0 1 1 0 8 0 plimitpl 152 32 0 25 1 0 1 1 0 8 0 plcache 128 20 0 0 1 0 1 1 0 8 0 rtentry 112 59 0 19 2 0 2 2 0 8 0 syncache 264 4 0 4 1 1 0 1 0 8 0 tcpcb 544 213 0 209 1 0 1 1 0 8 0 nd6 48 8 0 4 1 0 1 1 0 8 0 ppxss 1128 22 0 22 9 9 0 1 0 8 0 art_heap8 4096 1 0 0 1 0 1 1 0 8 0 art_heap4 256 267 0 82 12 0 12 12 0 8 0 art_table 32 268 0 82 2 0 2 2 0 8 0 art_node 16 58 0 24 1 0 1 1 0 8 0 sysvmsgpl 40 21 0 10 1 0 1 1 0 8 0 semupl 112 1 0 1 1 1 0 1 0 8 0 semapl 112 142 0 132 1 0 1 1 0 8 0 shmpl 112 68 0 6 2 0 2 2 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino1pl 128 3621 0 2205 46 0 46 46 0 8 0 ffsino 272 3621 0 2205 95 0 95 95 0 8 0 nchpl 144 5393 0 3780 61 0 61 61 0 8 0 uvmvnodes 72 3842 0 0 70 0 70 70 0 8 0 vnodes 200 3842 0 0 203 0 203 203 0 8 0 namei 1024 15385 0 15385 3 2 1 1 0 8 1 percpumem 16 30 0 0 1 0 1 1 0 8 0 scsiplug 64 6 0 6 4 4 0 1 0 8 0 scxspl 192 14411 0 14411 10 9 1 6 0 8 1 sigapl 432 1279 0 1265 2 0 2 2 0 8 0 futexpl 56 13644 0 13644 2 1 1 1 0 8 1 knotepl 112 289 0 262 3 2 1 2 0 8 0 kqueuepl 104 266 0 264 1 0 1 1 0 8 0 pipepl 112 762 0 743 3 2 1 2 0 8 0 fdescpl 488 1280 0 1265 3 1 2 3 0 8 0 filepl 152 7434 0 7336 10 5 5 5 0 8 1 lockfpl 104 527 0 524 5 4 1 1 0 8 0 lockfspl 32 470 0 468 5 4 1 1 0 8 0 sessionpl 112 20 0 10 1 0 1 1 0 8 0 pgrppl 48 25 0 15 1 0 1 1 0 8 0 ucredpl 96 1858 0 1851 1 0 1 1 0 8 0 zombiepl 144 1265 0 1265 2 1 1 1 0 8 1 processpl 840 1295 0 1265 4 0 4 4 0 8 0 procpl 600 3593 0 3550 4 0 4 4 0 8 0 srpgc 64 12 0 12 1 1 0 1 0 8 0 sosppl 128 18 0 18 7 7 0 1 0 8 0 sockpl 384 1067 0 1050 6 3 3 3 0 8 1 mcl64k 65536 229 0 0 29 21 8 29 0 8 1 mcl16k 16384 2 0 0 1 0 1 1 0 8 0 mcl12k 12288 8 0 0 1 0 1 1 0 8 0 mcl9k 9216 10 0 0 1 0 1 1 0 8 0 mcl8k 8192 2 0 0 1 0 1 1 0 8 0 mcl4k 4096 7 0 0 1 0 1 1 0 8 0 mcl2k2 2112 1 0 0 1 0 1 1 0 8 0 mcl2k 2048 116 0 0 14 1 13 14 0 8 0 mtagpl 80 1 0 0 1 0 1 1 0 8 0 mbufpl 256 320 0 0 19 0 19 19 0 8 0 bufpl 256 7076 0 1021 379 0 379 379 0 8 0 anonpl 16 143251 0 135434 112 66 46 48 0 125 13 amapchunkpl 152 6916 0 6826 13 8 5 9 0 158 0 amappl16 192 7307 0 6899 103 76 27 33 0 8 6 amappl15 184 5 0 4 1 0 1 1 0 8 0 amappl14 176 19 0 14 2 1 1 1 0 8 0 amappl13 168 29 0 26 1 0 1 1 0 8 0 amappl12 160 77 0 77 2 2 0 1 0 8 0 amappl11 152 1205 0 1194 1 0 1 1 0 8 0 amappl10 144 60 0 55 2 1 1 1 0 8 0 amappl9 136 1372 0 1365 1 0 1 1 0 8 0 amappl8 128 227 0 205 1 0 1 1 0 8 0 amappl7 120 43 0 36 1 0 1 1 0 8 0 amappl6 112 51 0 46 1 0 1 1 0 8 0 amappl5 104 144 0 132 1 0 1 1 0 8 0 amappl4 96 278 0 256 2 1 1 2 0 8 0 amappl3 88 161 0 154 1 0 1 1 0 8 0 amappl2 80 11469 0 11407 2 0 2 2 0 8 0 amappl1 72 35234 0 34793 24 14 10 19 0 8 0 amappl 72 3829 0 3793 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 69 0 6 2 0 2 2 0 8 0 uaddrrnd 24 1280 0 1265 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 1280 0 1265 1 0 1 1 0 8 0 vmmpekpl 168 13610 0 13588 2 0 2 2 0 8 0 vmmpepl 168 141716 0 140258 128 55 73 75 0 357 7 vmsppl 360 1279 0 1265 2 0 2 2 0 8 0 pdppl 4096 2567 0 2530 5 0 5 5 0 8 0 pvpl 32 389544 0 378636 222 99 123 126 0 265 31 pmappl 224 1279 0 1265 1 0 1 1 0 8 0 extentpl 40 39 0 25 1 0 1 1 0 8 0 phpool 112 566 0 26 16 0 16 16 0 8 0