login: 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(ffff8000019734d0,1,ffffffff81f36129,f5,0) at witness_checkorder+0xe14 witness_debugger sys/kern/subr_witness.c:2650 [inline] witness_checkorder(ffff8000019734d0,1,ffffffff81f36129,f5,0) at witness_checkorder+0xe14 sys/kern/subr_witness.c:926 _rw_enter_read(ffff8000019734c0,ffffffff81f36129,f5) at _rw_enter_read+0x80 sys/kern/kern_rwlock.c:102 wsmux_mux_open(ffff800001973400,ffff800001973350) at wsmux_mux_open+0x82 wsmux_do_open sys/dev/wscons/wsmux.c:246 [inline] wsmux_mux_open(ffff800001973400,ffff800001973350) at wsmux_mux_open+0x82 sys/dev/wscons/wsmux.c:228 wsmux_attach_sc(ffff800001973300,ffff800001973400) at wsmux_attach_sc+0x180 sys/dev/wscons/wsmux.c:670 VOP_IOCTL(fffffd8074dfd8d0,80085761,ffff800020c3b7f0,f,fffffd807f7c7a20,ffff800020b42bd0) at VOP_IOCTL+0x9a sys/kern/vfs_vops.c:290 vn_ioctl(fffffd8069198868,80085761,ffff800020c3b7f0,ffff800020b42bd0) at vn_ioctl+0xc9 sys/kern/vfs_vnops.c:512 sys_ioctl(ffff800020b42bd0,ffff800020c3b938,ffff800020c3b920) at sys_ioctl+0x646 syscall(ffff800020c3b9d0) at syscall+0x5ac mi_syscall sys/sys/syscall_mi.h:99 [inline] syscall(ffff800020c3b9d0) at syscall+0x5ac sys/arch/amd64/amd64/trap.c:574 Xsyscall(6,0,ffffffffffffff86,0,3,fdc8772f010) at Xsyscall+0x128 end of kernel end trace frame: 0xfdec105d5c0, 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(ffff8000019734d0,1,ffffffff81f36129,f5,0) at witness_checkorder+0xe19 witness_debugger sys/kern/subr_witness.c:2650 [inline] witness_checkorder(ffff8000019734d0,1,ffffffff81f36129,f5,0) at witness_checkorder+0xe19 sys/kern/subr_witness.c:926 _rw_enter_read(ffff8000019734c0,ffffffff81f36129,f5) at _rw_enter_read+0x80 sys/kern/kern_rwlock.c:102 wsmux_mux_open(ffff800001973400,ffff800001973350) at wsmux_mux_open+0x82 wsmux_do_open sys/dev/wscons/wsmux.c:246 [inline] wsmux_mux_open(ffff800001973400,ffff800001973350) at wsmux_mux_open+0x82 sys/dev/wscons/wsmux.c:228 wsmux_attach_sc(ffff800001973300,ffff800001973400) at wsmux_attach_sc+0x180 sys/dev/wscons/wsmux.c:670 VOP_IOCTL(fffffd8074dfd8d0,80085761,ffff800020c3b7f0,f,fffffd807f7c7a20,ffff800020b42bd0) at VOP_IOCTL+0x9a sys/kern/vfs_vops.c:290 vn_ioctl(fffffd8069198868,80085761,ffff800020c3b7f0,ffff800020b42bd0) at vn_ioctl+0xc9 sys/kern/vfs_vnops.c:512 sys_ioctl(ffff800020b42bd0,ffff800020c3b938,ffff800020c3b920) at sys_ioctl+0x646 syscall(ffff800020c3b9d0) at syscall+0x5ac mi_syscall sys/sys/syscall_mi.h:99 [inline] syscall(ffff800020c3b9d0) at syscall+0x5ac sys/arch/amd64/amd64/trap.c:574 Xsyscall(6,0,ffffffffffffff86,0,3,fdc8772f010) at Xsyscall+0x128 end of kernel end trace frame: 0xfdec105d5c0, count: -10 ddb{1}> show registers rdi 0 rsi 0x3ffff acpi_pdirpa+0x2be67 rbp 0xffff800020c3b420 rbx 0x3 rdx 0x40000 acpi_pdirpa+0x2be68 rcx 0xffff800002b49000 rax 0xffff800001947a00 r8 0xffffffff8155ffb3 kprintf+0x183 r9 0x1 r10 0x25 r11 0x4f02f99de60b4f3e 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 0xffff800020c3b410 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb{1}> show proc PROC (syz-executor.1) pid=459705 stat=onproc flags process=0 proc=4000000 pri=59, usrpri=59, nice=20 forw=0xffffffffffffffff, list=0xffff800020b42978,0xffffffff8233fe30 process=0xffff800020b44d30 user=0xffff800020c36000, vmspace=0xfffffd807efff708 estcpu=36, cpticks=0, pctcpu=0.0 user=0, sys=0, intr=0 ddb{1}> ps PID TID PPID UID S FLAGS WAIT COMMAND 45314 59745 27338 0 7 0 syz-executor.1 *45314 459705 27338 0 7 0x4000000 syz-executor.1 53234 264205 88560 0 3 0x80 nanosleep syz-executor.0 53234 159188 88560 0 3 0x4000080 semwait syz-executor.0 53234 343526 88560 0 3 0x4000080 semwait syz-executor.0 53234 129077 88560 0 3 0x4000080 fsleep syz-executor.0 27338 315024 18277 0 3 0x82 nanosleep syz-executor.1 88560 463198 18277 0 3 0x82 nanosleep syz-executor.0 18277 485996 81460 0 3 0x82 thrsleep syz-fuzzer 18277 7436 81460 0 3 0x4000082 nanosleep syz-fuzzer 18277 301997 81460 0 3 0x4000082 thrsleep syz-fuzzer 18277 203552 81460 0 3 0x4000082 thrsleep syz-fuzzer 18277 101781 81460 0 3 0x4000082 thrsleep syz-fuzzer 18277 313468 81460 0 3 0x4000082 thrsleep syz-fuzzer 18277 496015 81460 0 3 0x4000082 thrsleep syz-fuzzer 18277 89336 81460 0 3 0x4000082 kqread syz-fuzzer 18277 100141 81460 0 3 0x4000082 thrsleep syz-fuzzer 18277 351765 81460 0 3 0x4000082 thrsleep syz-fuzzer 81460 163911 3492 0 3 0x10008a pause ksh 3492 163843 13231 0 3 0x92 select sshd 28594 18292 1 0 3 0x100083 ttyin getty 13231 185527 1 0 3 0x80 select sshd 71885 264077 56916 73 2 0x100090 syslogd 56916 469940 1 0 3 0x100082 netio syslogd 67620 309881 1 77 3 0x100090 poll dhclient 64387 68071 1 0 3 0x80 poll dhclient 48851 202748 0 0 3 0x14200 pgzero zerothread 28389 187896 0 0 3 0x14200 aiodoned aiodoned 58119 294006 0 0 3 0x14200 syncer update 93263 161281 0 0 3 0x14200 cleaner cleaner 21108 246685 0 0 3 0x14200 reaper reaper 83417 307211 0 0 3 0x14200 pgdaemon pagedaemon 10715 232246 0 0 3 0x14200 bored crynlk 1862 221260 0 0 3 0x14200 bored crypto 97363 349317 0 0 3 0x40014200 acpi0 acpi0 17119 191321 0 0 3 0x40014200 idle1 4317 184826 0 0 3 0x14200 bored softnet 42629 383014 0 0 3 0x14200 bored systqmp 43942 483418 0 0 3 0x14200 bored systq 80683 91205 0 0 3 0x40014200 bored softclock 90447 199797 0 0 3 0x40014200 idle0 1 251254 0 0 3 0x82 wait init 0 0 -1 0 3 0x10200 scheduler swapper ddb{1}> show all locks Process 45314 (syz-executor.1) thread 0xffff800020b42bd0 (459705) exclusive rwlock wsmuxlk r = 0 (0xffff8000019733d0) 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{1}> show malloc Type InUse MemUse HighUse Limit Requests Type Lim Kern Lim devbuf 9461 6329K 6329K 78643K 10552 0 0 pcb 23 9K 9K 78643K 57 0 0 rtable 97 3K 3K 78643K 167 0 0 ifaddr 34 9K 9K 78643K 34 0 0 counters 39 33K 33K 78643K 39 0 0 ioctlops 0 0K 2K 78643K 17 0 0 mount 1 1K 1K 78643K 1 0 0 vnodes 1198 75K 75K 78643K 1220 0 0 UFS quota 1 32K 32K 78643K 1 0 0 UFS mount 5 36K 36K 78643K 5 0 0 shm 2 1K 1K 78643K 2 0 0 VM map 2 1K 1K 78643K 2 0 0 sem 7 0K 0K 78643K 8 0 0 dirhash 12 2K 2K 78643K 12 0 0 ACPI 1792 194K 288K 78643K 12592 0 0 file desc 6 17K 25K 78643K 33 0 0 proc 40 38K 70K 78643K 252 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 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 163 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 80 20K 20K 78643K 825 0 0 UVM aobj 5 2K 2K 78643K 5 0 0 memdesc 1 4K 4K 78643K 1 0 0 crypto data 1 1K 1K 78643K 1 0 0 NDP 5 0K 0K 78643K 9 0 0 temp 87 2354K 2418K 78643K 2816 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 34 0 27 1 0 1 1 0 8 0 plimitpl 152 14 0 7 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 tcpqe 32 12 0 12 1 0 1 1 0 8 1 tcpcb 544 10 0 6 1 0 1 1 0 8 0 nd6 48 4 0 0 1 0 1 1 0 8 0 art_heap8 4096 1 0 0 1 0 1 1 0 8 0 art_heap4 256 186 0 0 12 0 12 12 0 8 0 art_table 32 187 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 0 1 0 1 1 0 8 0 semapl 112 5 0 0 1 0 1 1 0 8 0 shmpl 112 3 0 0 1 0 1 1 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino1pl 128 1463 0 56 46 0 46 46 0 8 0 ffsino 272 1463 0 56 95 0 95 95 0 8 0 nchpl 144 1713 0 89 61 0 61 61 0 8 0 uvmvnodes 72 1506 0 0 28 0 28 28 0 8 0 vnodes 200 1506 0 0 80 0 80 80 0 8 0 namei 1024 4089 0 4089 2 1 1 1 0 8 1 percpumem 16 30 0 0 1 0 1 1 0 8 0 scxspl 192 4006 0 4006 8 6 2 7 0 8 2 sigapl 432 201 0 187 2 0 2 2 0 8 0 futexpl 56 269 0 268 1 0 1 1 0 8 0 knotepl 112 68 0 41 2 0 2 2 0 8 1 kqueuepl 104 10 0 8 1 0 1 1 0 8 0 pipepl 112 142 0 123 2 1 1 1 0 8 0 fdescpl 488 202 0 187 3 0 3 3 0 8 1 filepl 152 1061 0 966 6 1 5 5 0 8 1 lockfpl 104 9 0 9 2 1 1 1 0 8 1 lockfspl 32 4 0 4 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 112 0 105 1 0 1 1 0 8 0 zombiepl 144 187 0 187 2 1 1 1 0 8 1 processpl 840 216 0 187 4 0 4 4 0 8 0 procpl 600 260 0 218 4 0 4 4 0 8 0 sockpl 384 78 0 61 3 0 3 3 0 8 1 mcl64k 65536 1 0 0 1 0 1 1 0 8 0 mcl4k 4096 2 0 0 1 0 1 1 0 8 0 mcl2k 2048 112 0 0 13 0 13 13 0 8 0 mtagpl 80 1 0 0 1 0 1 1 0 8 0 mbufpl 256 129 0 0 8 0 8 8 0 8 0 bufpl 256 5219 0 1013 263 0 263 263 0 8 0 anonpl 16 26842 0 19446 31 1 30 30 0 125 0 amapchunkpl 152 809 0 707 5 0 5 5 0 158 0 amappl16 192 520 0 147 19 0 19 19 0 8 0 amappl15 184 1 0 0 1 0 1 1 0 8 0 amappl14 176 15 0 11 2 1 1 1 0 8 0 amappl13 168 26 0 22 1 0 1 1 0 8 0 amappl12 160 12 0 11 2 1 1 1 0 8 0 amappl11 152 183 0 174 1 0 1 1 0 8 0 amappl10 144 64 0 61 2 1 1 1 0 8 0 amappl9 136 357 0 353 1 0 1 1 0 8 0 amappl8 128 133 0 115 1 0 1 1 0 8 0 amappl7 120 38 0 33 1 0 1 1 0 8 0 amappl6 112 61 0 52 1 0 1 1 0 8 0 amappl5 104 118 0 107 1 0 1 1 0 8 0 amappl4 96 265 0 241 2 1 1 2 0 8 0 amappl3 88 130 0 122 1 0 1 1 0 8 0 amappl2 80 765 0 704 2 0 2 2 0 8 0 amappl1 72 12661 0 12226 24 9 15 19 0 8 6 amappl 72 468 0 429 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 4 0 0 1 0 1 1 0 8 0 uaddrrnd 24 202 0 187 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 202 0 187 1 0 1 1 0 8 0 vmmpekpl 168 5445 0 5424 2 0 2 2 0 8 0 vmmpepl 168 28214 0 26809 81 11 70 70 0 357 8 vmsppl 360 201 0 187 2 0 2 2 0 8 0 pdppl 4096 412 0 374 6 0 6 6 0 8 1 pvpl 32 105057 0 94644 101 7 94 96 0 265 9 pmappl 224 201 0 187 1 0 1 1 0 8 0 extentpl 40 39 0 25 1 0 1 1 0 8 0 phpool 112 408 0 3 12 0 12 12 0 8 0