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(ffff80000198f5d0,1,ffffffff81f36129,f5,0) at witness_checkorder+0xe14 witness_debugger sys/kern/subr_witness.c:2650 [inline] witness_checkorder(ffff80000198f5d0,1,ffffffff81f36129,f5,0) at witness_checkorder+0xe14 sys/kern/subr_witness.c:926 _rw_enter_read(ffff80000198f5c0,ffffffff81f36129,f5) at _rw_enter_read+0x80 sys/kern/kern_rwlock.c:102 wsmux_mux_open(ffff80000198f500,ffff800000026d50) at wsmux_mux_open+0x82 wsmux_do_open sys/dev/wscons/wsmux.c:246 [inline] wsmux_mux_open(ffff80000198f500,ffff800000026d50) at wsmux_mux_open+0x82 sys/dev/wscons/wsmux.c:228 wsmux_attach_sc(ffff800000026d00,ffff80000198f500) at wsmux_attach_sc+0x180 sys/dev/wscons/wsmux.c:670 VOP_IOCTL(fffffd8070a23218,80085761,ffff800020c11180,82,fffffd807f7c7c60,ffff800020b43c38) at VOP_IOCTL+0x9a sys/kern/vfs_vops.c:290 vn_ioctl(fffffd8007a36278,80085761,ffff800020c11180,ffff800020b43c38) at vn_ioctl+0xc9 sys/kern/vfs_vnops.c:512 sys_ioctl(ffff800020b43c38,ffff800020c112c8,ffff800020c112b0) at sys_ioctl+0x646 syscall(ffff800020c11360) at syscall+0x5ac mi_syscall sys/sys/syscall_mi.h:99 [inline] syscall(ffff800020c11360) at syscall+0x5ac sys/arch/amd64/amd64/trap.c:574 Xsyscall(6,0,ffffffffffffff86,0,3,5128c595010) at Xsyscall+0x128 end of kernel end trace frame: 0x5153b867d00, 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(ffff80000198f5d0,1,ffffffff81f36129,f5,0) at witness_checkorder+0xe19 witness_debugger sys/kern/subr_witness.c:2650 [inline] witness_checkorder(ffff80000198f5d0,1,ffffffff81f36129,f5,0) at witness_checkorder+0xe19 sys/kern/subr_witness.c:926 _rw_enter_read(ffff80000198f5c0,ffffffff81f36129,f5) at _rw_enter_read+0x80 sys/kern/kern_rwlock.c:102 wsmux_mux_open(ffff80000198f500,ffff800000026d50) at wsmux_mux_open+0x82 wsmux_do_open sys/dev/wscons/wsmux.c:246 [inline] wsmux_mux_open(ffff80000198f500,ffff800000026d50) at wsmux_mux_open+0x82 sys/dev/wscons/wsmux.c:228 wsmux_attach_sc(ffff800000026d00,ffff80000198f500) at wsmux_attach_sc+0x180 sys/dev/wscons/wsmux.c:670 VOP_IOCTL(fffffd8070a23218,80085761,ffff800020c11180,82,fffffd807f7c7c60,ffff800020b43c38) at VOP_IOCTL+0x9a sys/kern/vfs_vops.c:290 vn_ioctl(fffffd8007a36278,80085761,ffff800020c11180,ffff800020b43c38) at vn_ioctl+0xc9 sys/kern/vfs_vnops.c:512 sys_ioctl(ffff800020b43c38,ffff800020c112c8,ffff800020c112b0) at sys_ioctl+0x646 syscall(ffff800020c11360) at syscall+0x5ac mi_syscall sys/sys/syscall_mi.h:99 [inline] syscall(ffff800020c11360) at syscall+0x5ac sys/arch/amd64/amd64/trap.c:574 Xsyscall(6,0,ffffffffffffff86,0,3,5128c595010) at Xsyscall+0x128 end of kernel end trace frame: 0x5153b867d00, count: -10 ddb{1}> show registers rdi 0 rsi 0x3ffff acpi_pdirpa+0x2be67 rbp 0xffff800020c10db0 rbx 0x3 rdx 0x40000 acpi_pdirpa+0x2be68 rcx 0xffff800002b49000 rax 0xffff8000017477c0 r8 0xffffffff8155ffb3 kprintf+0x183 r9 0x1 r10 0x25 r11 0x1e960357e2fadf8a 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 0xffff800020c10da0 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb{1}> show proc PROC (syz-executor.1) pid=492621 stat=onproc flags process=0 proc=4000000 pri=76, usrpri=76, nice=20 forw=0xffffffffffffffff, list=0xffff800020b42978,0xffffffff8233fe30 process=0xffff800020b45708 user=0xffff800020c0c000, vmspace=0xfffffd807efff000 estcpu=36, cpticks=0, pctcpu=0.0 user=0, sys=0, intr=0 ddb{1}> ps PID TID PPID UID S FLAGS WAIT COMMAND 77746 182999 99721 0 7 0 syz-executor.1 *77746 492621 99721 0 7 0x4000000 syz-executor.1 99721 464485 63907 0 3 0x82 nanosleep syz-executor.1 30435 415890 1 0 3 0x100083 ttyin getty 46759 435619 0 0 3 0x14200 bored sosplice 23168 301736 63907 0 3 0x2 biowait syz-executor.0 63907 158574 21416 0 3 0x82 thrsleep syz-fuzzer 63907 64574 21416 0 3 0x4000082 nanosleep syz-fuzzer 63907 284012 21416 0 3 0x4000082 thrsleep syz-fuzzer 63907 61903 21416 0 3 0x4000082 thrsleep syz-fuzzer 63907 165915 21416 0 3 0x4000082 kqread syz-fuzzer 63907 483886 21416 0 3 0x4000082 thrsleep syz-fuzzer 63907 109165 21416 0 3 0x4000082 thrsleep syz-fuzzer 63907 232706 21416 0 3 0x4000082 thrsleep syz-fuzzer 63907 397145 21416 0 3 0x4000082 thrsleep syz-fuzzer 63907 45835 21416 0 3 0x4000082 thrsleep syz-fuzzer 21416 498432 91326 0 3 0x10008a pause ksh 91326 52443 33872 0 3 0x92 select sshd 33872 67345 1 0 3 0x80 select sshd 32897 46922 81047 73 2 0x100090 syslogd 81047 301172 1 0 3 0x100082 netio syslogd 76553 320551 1 77 3 0x100090 poll dhclient 265 361255 1 0 3 0x80 poll dhclient 761 241880 0 0 3 0x14200 pgzero zerothread 47001 249069 0 0 3 0x14200 aiodoned aiodoned 72259 83308 0 0 3 0x14200 syncer update 88563 154527 0 0 3 0x14200 cleaner cleaner 50245 29928 0 0 3 0x14200 reaper reaper 1381 101205 0 0 3 0x14200 pgdaemon pagedaemon 41895 486101 0 0 3 0x14200 bored crynlk 62124 519088 0 0 3 0x14200 bored crypto 69113 511151 0 0 3 0x40014200 acpi0 acpi0 87893 434402 0 0 3 0x40014200 idle1 99683 294843 0 0 3 0x14200 bored softnet 71241 423975 0 0 3 0x14200 bored systqmp 18849 240657 0 0 3 0x14200 bored systq 73907 52737 0 0 3 0x40014200 bored softclock 22437 103911 0 0 3 0x40014200 idle0 1 51703 0 0 3 0x82 wait init 0 0 -1 0 3 0x10200 scheduler swapper ddb{1}> show all locks Process 77746 (syz-executor.1) thread 0xffff800020b43c38 (492621) 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 Process 23168 (syz-executor.0) thread 0xffff800020b24260 (301736) exclusive rrwlock inode r = 0 (0xfffffd806a1e4918) locked @ /syzkaller/managers/multicore/kernel/sys/ufs/ufs/ufs_vnops.c:1547 #0 witness_lock+0x58a sys/kern/subr_witness.c:1205 #1 _rw_enter+0x44d sys/kern/kern_rwlock.c:280 #2 _rrw_enter+0x60 sys/kern/kern_rwlock.c:410 #3 VOP_LOCK+0x57 sys/kern/vfs_vops.c:602 #4 vn_lock+0x6e sys/kern/vfs_vnops.c:549 #5 vget+0x1b8 sys/kern/vfs_subr.c:672 #6 ufs_ihashget+0x151 sys/ufs/ufs/ufs_ihash.c:119 #7 ffs_vget+0x84 sys/ufs/ffs/ffs_vfsops.c:1323 #8 ufs_lookup+0x159c sys/ufs/ufs/ufs_lookup.c:487 #9 VOP_LOOKUP+0x67 sys/kern/vfs_vops.c:90 #10 vfs_lookup+0x556 sys/kern/vfs_lookup.c:523 #11 namei+0x4b2 sys/kern/vfs_lookup.c:224 #12 dounlinkat+0xa5 sys/kern/vfs_syscalls.c:1673 #13 syscall+0x5ac mi_syscall sys/sys/syscall_mi.h:99 [inline] #13 syscall+0x5ac sys/arch/amd64/amd64/trap.c:574 #14 Xsyscall+0x128 exclusive rrwlock inode r = 0 (0xfffffd806a1e44d8) locked @ /syzkaller/managers/multicore/kernel/sys/ufs/ufs/ufs_vnops.c:1547 #0 witness_lock+0x58a sys/kern/subr_witness.c:1205 #1 _rw_enter+0x44d sys/kern/kern_rwlock.c:280 #2 _rrw_enter+0x60 sys/kern/kern_rwlock.c:410 #3 VOP_LOCK+0x57 sys/kern/vfs_vops.c:602 #4 vn_lock+0x6e sys/kern/vfs_vnops.c:549 #5 vfs_lookup+0xf5 sys/kern/vfs_lookup.c:387 #6 namei+0x4b2 sys/kern/vfs_lookup.c:224 #7 dounlinkat+0xa5 sys/kern/vfs_syscalls.c:1673 #8 syscall+0x5ac mi_syscall sys/sys/syscall_mi.h:99 [inline] #8 syscall+0x5ac sys/arch/amd64/amd64/trap.c:574 #9 Xsyscall+0x128 ddb{1}> show malloc Type InUse MemUse HighUse Limit Requests Type Lim Kern Lim devbuf 9497 6357K 6364K 78643K 10857 0 0 pcb 23 9K 11K 78643K 460 0 0 rtable 100 3K 4K 78643K 480 0 0 ifaddr 49 12K 13K 78643K 153 0 0 counters 39 33K 33K 78643K 39 0 0 ioctlops 0 0K 2K 78643K 29 0 0 iov 0 0K 32K 78643K 89 0 0 mount 1 1K 1K 78643K 1 0 0 vnodes 1208 76K 76K 78643K 1763 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 16 0 0 VM map 2 1K 1K 78643K 2 0 0 sem 12 0K 0K 78643K 129 0 0 dirhash 12 2K 2K 78643K 12 0 0 ACPI 1792 194K 288K 78643K 12592 0 0 file desc 5 13K 25K 78643K 791 0 0 sigio 0 0K 0K 78643K 6 0 0 proc 41 38K 58K 78643K 478 0 0 subproc 64 65538K 67586K 78643K 272 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 75 0 0 in_multi 33 2K 2K 78643K 126 0 0 ether_multi 1 0K 0K 78643K 5 0 0 mrt 0 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 66 291K 291K 78643K 66 0 0 exec 0 0K 1K 78643K 255 0 0 pfkey data 0 0K 4K 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 95 21K 22K 78643K 3352 0 0 UVM aobj 58 4K 4K 78643K 64 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 19 0 0 NDP 9 0K 0K 78643K 49 0 0 temp 149 2366K 2432K 78643K 5234 0 0 kqueue 0 0K 0K 78643K 13 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 10 0 6 1 0 1 1 0 8 0 inpcbpl 280 375 0 368 1 0 1 1 0 8 0 plimitpl 152 41 0 34 1 0 1 1 0 8 0 plcache 128 20 0 0 1 0 1 1 0 8 0 rtentry 112 95 0 55 2 0 2 2 0 8 0 syncache 264 4 0 4 1 1 0 1 0 8 0 tcpcb 544 144 0 140 1 0 1 1 0 8 0 nd6 48 16 0 12 1 0 1 1 0 8 0 swfcl 56 2 0 0 1 0 1 1 0 8 0 ppxss 1128 12 0 12 3 2 1 1 0 8 1 art_heap8 4096 1 0 0 1 0 1 1 0 8 0 art_heap4 256 448 0 260 12 0 12 12 0 8 0 art_table 32 449 0 260 2 0 2 2 0 8 0 art_node 16 94 0 60 1 0 1 1 0 8 0 sysvmsgpl 40 16 0 12 1 0 1 1 0 8 0 semapl 112 127 0 117 1 0 1 1 0 8 0 shmpl 112 62 0 6 2 0 2 2 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino1pl 128 2838 0 1425 46 0 46 46 0 8 0 ffsino 272 2838 0 1425 95 0 95 95 0 8 0 nchpl 144 4149 0 2554 61 0 61 61 0 8 0 uvmvnodes 72 3069 0 0 56 0 56 56 0 8 0 vnodes 200 3069 0 0 162 0 162 162 0 8 0 namei 1024 12048 0 12048 2 1 1 1 0 8 1 percpumem 16 30 0 0 1 0 1 1 0 8 0 scxspl 192 11230 0 11229 10 9 1 6 0 8 0 sigapl 432 943 0 930 2 0 2 2 0 8 0 futexpl 56 8492 0 8492 1 0 1 1 0 8 1 knotepl 112 323 0 296 4 3 1 2 0 8 0 kqueuepl 104 217 0 215 1 0 1 1 0 8 0 pipepl 112 608 0 589 3 2 1 2 0 8 0 fdescpl 488 944 0 930 3 1 2 3 0 8 0 filepl 152 5622 0 5526 8 3 5 5 0 8 1 lockfpl 104 256 0 255 2 1 1 1 0 8 0 lockfspl 32 438 0 437 2 1 1 1 0 8 0 sessionpl 112 25 0 15 1 0 1 1 0 8 0 pgrppl 48 37 0 27 1 0 1 1 0 8 0 ucredpl 96 1413 0 1406 1 0 1 1 0 8 0 zombiepl 144 930 0 930 2 1 1 1 0 8 1 processpl 840 959 0 930 4 0 4 4 0 8 0 procpl 600 2625 0 2586 4 0 4 4 0 8 0 srpgc 64 36 0 36 1 1 0 1 0 8 0 sosppl 128 1 0 1 1 1 0 1 0 8 0 sockpl 384 774 0 757 6 3 3 4 0 8 1 mcl64k 65536 559 0 0 68 4 64 65 0 8 1 mcl16k 16384 1 0 0 1 0 1 1 0 8 0 mcl12k 12288 8 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 11 0 0 2 0 2 2 0 8 0 mcl2k2 2112 3 0 0 1 0 1 1 0 8 0 mcl2k 2048 110 0 0 13 0 13 13 0 8 0 mtagpl 80 1 0 0 1 0 1 1 0 8 0 mbufpl 256 645 0 0 37 0 37 37 0 8 0 bufpl 256 6713 0 1022 356 0 356 356 0 8 0 anonpl 16 118175 0 110470 78 30 48 48 0 125 16 amapchunkpl 152 5631 0 5536 10 4 6 9 0 158 1 amappl16 192 5471 0 5070 76 47 29 32 0 8 8 amappl15 184 5 0 4 1 0 1 1 0 8 0 amappl14 176 365 0 363 2 1 1 1 0 8 0 amappl13 168 41 0 36 1 0 1 1 0 8 0 amappl12 160 188 0 184 1 0 1 1 0 8 0 amappl11 152 407 0 396 1 0 1 1 0 8 0 amappl10 144 56 0 55 2 1 1 1 0 8 0 amappl9 136 568 0 562 1 0 1 1 0 8 0 amappl8 128 348 0 324 1 0 1 1 0 8 0 amappl7 120 51 0 45 1 0 1 1 0 8 0 amappl6 112 414 0 406 1 0 1 1 0 8 0 amappl5 104 138 0 126 1 0 1 1 0 8 0 amappl4 96 291 0 267 2 1 1 2 0 8 0 amappl3 88 167 0 161 1 0 1 1 0 8 0 amappl2 80 7948 0 7898 2 0 2 2 0 8 0 amappl1 72 29036 0 28619 24 14 10 19 0 8 0 amappl 72 2887 0 2852 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 63 0 6 1 0 1 1 0 8 0 uaddrrnd 24 944 0 930 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 944 0 930 1 0 1 1 0 8 0 vmmpekpl 168 11458 0 11435 2 0 2 2 0 8 0 vmmpepl 168 109987 0 108637 105 35 70 74 0 357 6 vmsppl 360 943 0 930 2 0 2 2 0 8 0 pdppl 4096 1896 0 1860 6 1 5 6 0 8 0 pvpl 32 319970 0 309280 159 35 124 125 0 265 35 pmappl 224 943 0 930 1 0 1 1 0 8 0 extentpl 40 39 0 25 1 0 1 1 0 8 0 phpool 112 600 0 8 17 0 17 17 0 8 0