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(ffff80000196a0d0,1,ffffffff81f36129,f5,0) at witness_checkorder+0xe14 witness_debugger sys/kern/subr_witness.c:2650 [inline] witness_checkorder(ffff80000196a0d0,1,ffffffff81f36129,f5,0) at witness_checkorder+0xe14 sys/kern/subr_witness.c:926 _rw_enter_read(ffff80000196a0c0,ffffffff81f36129,f5) at _rw_enter_read+0x80 sys/kern/kern_rwlock.c:102 wsmux_mux_open(ffff80000196a000,ffff800000026d50) at wsmux_mux_open+0x82 wsmux_do_open sys/dev/wscons/wsmux.c:246 [inline] wsmux_mux_open(ffff80000196a000,ffff800000026d50) at wsmux_mux_open+0x82 sys/dev/wscons/wsmux.c:228 wsmux_attach_sc(ffff800000026d00,ffff80000196a000) at wsmux_attach_sc+0x180 sys/dev/wscons/wsmux.c:670 VOP_IOCTL(fffffd806e705300,80085761,ffff800020c5efc0,3,fffffd807f7c7c00,ffff800020b42978) at VOP_IOCTL+0x9a sys/kern/vfs_vops.c:290 vn_ioctl(fffffd806973abf8,80085761,ffff800020c5efc0,ffff800020b42978) at vn_ioctl+0xc9 sys/kern/vfs_vnops.c:512 sys_ioctl(ffff800020b42978,ffff800020c5f108,ffff800020c5f0f0) at sys_ioctl+0x646 syscall(ffff800020c5f1a0) at syscall+0x5ac mi_syscall sys/sys/syscall_mi.h:99 [inline] syscall(ffff800020c5f1a0) at syscall+0x5ac sys/arch/amd64/amd64/trap.c:574 Xsyscall(6,0,ffffffffffffff86,0,3,ad11e91b0d8) at Xsyscall+0x128 end of kernel end trace frame: 0xad321c89090, 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(ffff80000196a0d0,1,ffffffff81f36129,f5,0) at witness_checkorder+0xe19 witness_debugger sys/kern/subr_witness.c:2650 [inline] witness_checkorder(ffff80000196a0d0,1,ffffffff81f36129,f5,0) at witness_checkorder+0xe19 sys/kern/subr_witness.c:926 _rw_enter_read(ffff80000196a0c0,ffffffff81f36129,f5) at _rw_enter_read+0x80 sys/kern/kern_rwlock.c:102 wsmux_mux_open(ffff80000196a000,ffff800000026d50) at wsmux_mux_open+0x82 wsmux_do_open sys/dev/wscons/wsmux.c:246 [inline] wsmux_mux_open(ffff80000196a000,ffff800000026d50) at wsmux_mux_open+0x82 sys/dev/wscons/wsmux.c:228 wsmux_attach_sc(ffff800000026d00,ffff80000196a000) at wsmux_attach_sc+0x180 sys/dev/wscons/wsmux.c:670 VOP_IOCTL(fffffd806e705300,80085761,ffff800020c5efc0,3,fffffd807f7c7c00,ffff800020b42978) at VOP_IOCTL+0x9a sys/kern/vfs_vops.c:290 vn_ioctl(fffffd806973abf8,80085761,ffff800020c5efc0,ffff800020b42978) at vn_ioctl+0xc9 sys/kern/vfs_vnops.c:512 sys_ioctl(ffff800020b42978,ffff800020c5f108,ffff800020c5f0f0) at sys_ioctl+0x646 syscall(ffff800020c5f1a0) at syscall+0x5ac mi_syscall sys/sys/syscall_mi.h:99 [inline] syscall(ffff800020c5f1a0) at syscall+0x5ac sys/arch/amd64/amd64/trap.c:574 Xsyscall(6,0,ffffffffffffff86,0,3,ad11e91b0d8) at Xsyscall+0x128 end of kernel end trace frame: 0xad321c89090, count: -10 ddb{0}> show registers rdi 0 rsi 0x3ffff acpi_pdirpa+0x2be67 rbp 0xffff800020c5ebf0 rbx 0x3 rdx 0x40000 acpi_pdirpa+0x2be68 rcx 0xffff800002d49000 rax 0xffff800001947b40 r8 0xffffffff8155ffb3 kprintf+0x183 r9 0x1 r10 0x25 r11 0x34991acacd6705bb 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 0xffff800020c5ebe0 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb{0}> show proc PROC (syz-executor.1) pid=419706 stat=onproc flags process=0 proc=4000000 pri=64, usrpri=64, nice=20 forw=0xffffffffffffffff, list=0xffff800020b42e28,0xffffffff8233fe30 process=0xffff800020b45078 user=0xffff800020c5a000, vmspace=0xfffffd807efff9d8 estcpu=14, cpticks=0, pctcpu=0.0 user=0, sys=0, intr=0 ddb{0}> ps PID TID PPID UID S FLAGS WAIT COMMAND 85804 481729 50935 0 2 0 syz-executor.0 85804 14601 50935 0 3 0x4000080 fsleep syz-executor.0 85804 487189 50935 0 2 0x4000000 syz-executor.0 1714 161271 38387 0 2 0 syz-executor.1 1714 244818 38387 0 3 0x4000080 wsevent_read syz-executor.1 * 1714 419706 38387 0 7 0x4000000 syz-executor.1 40944 231868 0 0 3 0x14200 bored sosplice 47461 189722 1 0 3 0x100083 ttyin getty 38387 34091 84429 0 3 0x82 nanosleep syz-executor.1 50935 456165 84429 0 3 0x82 nanosleep syz-executor.0 84429 284896 64684 0 3 0x82 thrsleep syz-fuzzer 84429 159556 64684 0 3 0x4000082 thrsleep syz-fuzzer 84429 81983 64684 0 3 0x4000082 thrsleep syz-fuzzer 84429 310115 64684 0 3 0x4000082 thrsleep syz-fuzzer 84429 130258 64684 0 3 0x4000082 thrsleep syz-fuzzer 84429 134621 64684 0 3 0x4000082 thrsleep syz-fuzzer 84429 95232 64684 0 3 0x4000082 thrsleep syz-fuzzer 84429 369492 64684 0 3 0x4000082 thrsleep syz-fuzzer 84429 375259 64684 0 3 0x4000082 thrsleep syz-fuzzer 84429 52039 64684 0 3 0x4000082 kqread syz-fuzzer 64684 267747 49275 0 3 0x10008a pause ksh 49275 391856 78831 0 3 0x92 select sshd 78831 449964 1 0 3 0x80 select sshd 27776 12366 77964 73 7 0x100090 syslogd 77964 74314 1 0 3 0x100082 netio syslogd 33128 48261 1 77 3 0x100090 poll dhclient 98420 279964 1 0 3 0x80 poll dhclient 41365 100973 0 0 2 0x14200 zerothread 79131 471351 0 0 3 0x14200 aiodoned aiodoned 6922 194484 0 0 3 0x14200 syncer update 45675 37563 0 0 3 0x14200 cleaner cleaner 49105 252285 0 0 3 0x14200 reaper reaper 19722 415845 0 0 3 0x14200 pgdaemon pagedaemon 65064 372553 0 0 3 0x14200 bored crynlk 84094 484812 0 0 3 0x14200 bored crypto 46606 6617 0 0 3 0x40014200 acpi0 acpi0 31497 45011 0 0 3 0x40014200 idle1 27348 115634 0 0 3 0x14200 bored softnet 78952 191370 0 0 3 0x14200 bored systqmp 18138 126056 0 0 3 0x14200 bored systq 46820 60281 0 0 3 0x40014200 bored softclock 43971 401156 0 0 3 0x40014200 idle0 1 492374 0 0 3 0x82 wait init 0 0 -1 0 3 0x10200 scheduler swapper ddb{0}> show all locks Process 1714 (syz-executor.1) thread 0xffff800020b42978 (419706) 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 (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 9485 6605K 6605K 78643K 10714 0 0 pcb 23 9K 10K 78643K 202 0 0 rtable 100 3K 4K 78643K 246 0 0 ifaddr 47 12K 12K 78643K 91 0 0 counters 39 33K 33K 78643K 39 0 0 ioctlops 0 0K 2K 78643K 19 0 0 iov 0 0K 24K 78643K 38 0 0 mount 1 1K 1K 78643K 1 0 0 vnodes 1194 75K 75K 78643K 1404 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 8 0 0 VM map 2 1K 1K 78643K 2 0 0 sem 12 0K 0K 78643K 72 0 0 dirhash 12 2K 2K 78643K 12 0 0 ACPI 1792 194K 288K 78643K 12592 0 0 file desc 6 17K 25K 78643K 399 0 0 sigio 0 0K 0K 78643K 7 0 0 proc 42 38K 58K 78643K 318 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 49 0 0 in_multi 33 2K 2K 78643K 58 0 0 ether_multi 1 0K 0K 78643K 3 0 0 ISOFS mount 1 32K 32K 78643K 1 0 0 MSDOSFS mount 1 16K 16K 78643K 1 0 0 ttys 54 238K 238K 78643K 54 0 0 exec 0 0K 1K 78643K 187 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 86 20K 21K 78643K 2008 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 10 0 0 NDP 8 0K 0K 78643K 23 0 0 temp 132 2364K 2430K 78643K 3863 0 0 kqueue 0 0K 0K 78643K 8 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 218 0 211 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 86 0 82 1 0 1 1 0 8 0 nd6 48 4 0 0 1 0 1 1 0 8 0 ppxss 1128 10 0 10 2 2 0 1 0 8 0 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 13 0 7 1 0 1 1 0 8 0 semapl 112 70 0 60 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 2164 0 758 46 0 46 46 0 8 0 ffsino 272 2164 0 758 95 0 95 95 0 8 0 nchpl 144 2953 0 1331 61 0 61 61 0 8 0 uvmvnodes 72 2237 0 0 41 0 41 41 0 8 0 vnodes 200 2237 0 0 118 0 118 118 0 8 0 namei 1024 7745 0 7745 2 1 1 1 0 8 1 percpumem 16 30 0 0 1 0 1 1 0 8 0 scxspl 192 8003 0 8003 8 7 1 6 0 8 1 sigapl 432 568 0 554 2 0 2 2 0 8 0 futexpl 56 4310 0 4309 1 0 1 1 0 8 0 knotepl 112 151 0 124 3 2 1 2 0 8 0 kqueuepl 104 111 0 109 1 0 1 1 0 8 0 pipepl 112 392 0 373 2 1 1 1 0 8 0 fdescpl 488 569 0 554 3 1 2 3 0 8 0 filepl 152 3136 0 3041 6 1 5 5 0 8 1 lockfpl 104 166 0 166 2 1 1 1 0 8 1 lockfspl 32 298 0 298 2 1 1 1 0 8 1 sessionpl 112 18 0 8 1 0 1 1 0 8 0 pgrppl 48 24 0 14 1 0 1 1 0 8 0 ucredpl 96 585 0 578 1 0 1 1 0 8 0 zombiepl 144 554 0 554 2 1 1 1 0 8 1 processpl 840 584 0 554 4 0 4 4 0 8 0 procpl 600 1415 0 1372 4 0 4 4 0 8 0 sosppl 128 2 0 2 1 1 0 1 0 8 0 sockpl 384 381 0 364 3 0 3 3 0 8 1 mcl64k 65536 256 0 0 32 2 30 32 0 8 1 mcl12k 12288 6 0 0 1 0 1 1 0 8 0 mcl9k 9216 5 0 0 1 0 1 1 0 8 0 mcl8k 8192 2 0 0 1 0 1 1 0 8 0 mcl4k 4096 3 0 0 1 0 1 1 0 8 0 mcl2k2 2112 1 0 0 1 0 1 1 0 8 0 mcl2k 2048 104 0 0 12 0 12 12 0 8 0 mtagpl 80 1 0 0 1 0 1 1 0 8 0 mbufpl 256 354 0 0 21 0 21 21 0 8 0 bufpl 256 6166 0 1013 323 0 323 323 0 8 0 anonpl 16 59726 0 51802 59 17 42 48 0 125 9 amapchunkpl 152 2909 0 2818 9 0 9 9 0 158 4 amappl16 192 2271 0 1856 34 12 22 33 0 8 0 amappl15 184 190 0 187 1 0 1 1 0 8 0 amappl14 176 197 0 193 2 1 1 1 0 8 0 amappl13 168 25 0 22 1 0 1 1 0 8 0 amappl12 160 10 0 9 2 1 1 1 0 8 0 amappl11 152 371 0 360 1 0 1 1 0 8 0 amappl10 144 58 0 55 2 1 1 1 0 8 0 amappl9 136 343 0 339 1 0 1 1 0 8 0 amappl8 128 140 0 120 1 0 1 1 0 8 0 amappl7 120 37 0 32 1 0 1 1 0 8 0 amappl6 112 54 0 47 1 0 1 1 0 8 0 amappl5 104 337 0 323 1 0 1 1 0 8 0 amappl4 96 271 0 246 2 1 1 2 0 8 0 amappl3 88 150 0 144 1 0 1 1 0 8 0 amappl2 80 4624 0 4556 2 0 2 2 0 8 0 amappl1 72 20205 0 19770 24 15 9 19 0 8 0 amappl 72 1633 0 1597 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 569 0 554 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 569 0 554 1 0 1 1 0 8 0 vmmpekpl 168 8356 0 8335 2 0 2 2 0 8 0 vmmpepl 168 65641 0 64188 85 20 65 73 0 357 1 vmsppl 360 568 0 554 2 0 2 2 0 8 0 pdppl 4096 1146 0 1108 6 1 5 6 0 8 0 pvpl 32 197049 0 186064 143 25 118 125 0 265 26 pmappl 224 568 0 554 1 0 1 1 0 8 0 extentpl 40 39 0 25 1 0 1 1 0 8 0 phpool 112 512 0 6 15 0 15 15 0 8 0