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(ffff8000019795d0,1,ffffffff81f33463,f5,0) at witness_checkorder+0xe14 witness_debugger sys/kern/subr_witness.c:2650 [inline] witness_checkorder(ffff8000019795d0,1,ffffffff81f33463,f5,0) at witness_checkorder+0xe14 sys/kern/subr_witness.c:926 _rw_enter_read(ffff8000019795c0,ffffffff81f33463,f5) at _rw_enter_read+0x80 sys/kern/kern_rwlock.c:102 wsmux_mux_open(ffff800001979500,ffff800000026d50) at wsmux_mux_open+0x82 wsmux_do_open sys/dev/wscons/wsmux.c:246 [inline] wsmux_mux_open(ffff800001979500,ffff800000026d50) at wsmux_mux_open+0x82 sys/dev/wscons/wsmux.c:228 wsmux_attach_sc(ffff800000026d00,ffff800001979500) at wsmux_attach_sc+0x180 sys/dev/wscons/wsmux.c:670 VOP_IOCTL(fffffd807382ca68,80085761,ffff800020c513b0,3,fffffd807f7c7900,ffff800020b439e0) at VOP_IOCTL+0x9a sys/kern/vfs_vops.c:290 vn_ioctl(fffffd8067170b68,80085761,ffff800020c513b0,ffff800020b439e0) at vn_ioctl+0xc9 sys/kern/vfs_vnops.c:512 sys_ioctl(ffff800020b439e0,ffff800020c514f8,ffff800020c514e0) at sys_ioctl+0x646 syscall(ffff800020c51590) at syscall+0x5ac mi_syscall sys/sys/syscall_mi.h:99 [inline] syscall(ffff800020c51590) at syscall+0x5ac sys/arch/amd64/amd64/trap.c:574 Xsyscall(6,0,ffffffffffffff86,0,3,6f642c46010) at Xsyscall+0x128 end of kernel end trace frame: 0x6f90064fad0, 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(ffff8000019795d0,1,ffffffff81f33463,f5,0) at witness_checkorder+0xe19 witness_debugger sys/kern/subr_witness.c:2650 [inline] witness_checkorder(ffff8000019795d0,1,ffffffff81f33463,f5,0) at witness_checkorder+0xe19 sys/kern/subr_witness.c:926 _rw_enter_read(ffff8000019795c0,ffffffff81f33463,f5) at _rw_enter_read+0x80 sys/kern/kern_rwlock.c:102 wsmux_mux_open(ffff800001979500,ffff800000026d50) at wsmux_mux_open+0x82 wsmux_do_open sys/dev/wscons/wsmux.c:246 [inline] wsmux_mux_open(ffff800001979500,ffff800000026d50) at wsmux_mux_open+0x82 sys/dev/wscons/wsmux.c:228 wsmux_attach_sc(ffff800000026d00,ffff800001979500) at wsmux_attach_sc+0x180 sys/dev/wscons/wsmux.c:670 VOP_IOCTL(fffffd807382ca68,80085761,ffff800020c513b0,3,fffffd807f7c7900,ffff800020b439e0) at VOP_IOCTL+0x9a sys/kern/vfs_vops.c:290 vn_ioctl(fffffd8067170b68,80085761,ffff800020c513b0,ffff800020b439e0) at vn_ioctl+0xc9 sys/kern/vfs_vnops.c:512 sys_ioctl(ffff800020b439e0,ffff800020c514f8,ffff800020c514e0) at sys_ioctl+0x646 syscall(ffff800020c51590) at syscall+0x5ac mi_syscall sys/sys/syscall_mi.h:99 [inline] syscall(ffff800020c51590) at syscall+0x5ac sys/arch/amd64/amd64/trap.c:574 Xsyscall(6,0,ffffffffffffff86,0,3,6f642c46010) at Xsyscall+0x128 end of kernel end trace frame: 0x6f90064fad0, count: -10 ddb{0}> show registers rdi 0 rsi 0x3ffff acpi_pdirpa+0x2be67 rbp 0xffff800020c50fe0 rbx 0x3 rdx 0x40000 acpi_pdirpa+0x2be68 rcx 0xffff800000947000 rax 0xffff800000941c40 r8 0xffffffff818cb2f3 kprintf+0x183 r9 0x1 r10 0x25 r11 0x4677b872ad995076 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 0xffff800020c50fd0 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb{0}> show proc PROC (syz-executor.0) pid=287724 stat=onproc flags process=0 proc=4000000 pri=79, usrpri=79, nice=20 forw=0xffffffffffffffff, list=0xffff800020b42270,0xffffffff8234a810 process=0xffff800020b446a0 user=0xffff800020c4c000, vmspace=0xfffffd807effe5a0 estcpu=36, cpticks=0, pctcpu=0.0 user=0, sys=0, intr=0 ddb{0}> ps PID TID PPID UID S FLAGS WAIT COMMAND 71505 168774 96918 0 2 0 syz-executor.0 *71505 287724 96918 0 7 0x4000000 syz-executor.0 7913 409990 19002 0 2 0 syz-executor.1 7913 273490 19002 0 3 0x4000080 rest syz-executor.1 59605 173962 1 0 3 0x100083 ttyin getty 22606 101858 0 0 3 0x14200 bored sosplice 19002 44618 88685 0 3 0x82 nanosleep syz-executor.1 96918 409415 88685 0 3 0x82 nanosleep syz-executor.0 88685 340969 31483 0 3 0x82 thrsleep syz-fuzzer 88685 408047 31483 0 3 0x4000082 nanosleep syz-fuzzer 88685 45669 31483 0 3 0x4000082 thrsleep syz-fuzzer 88685 191550 31483 0 3 0x4000082 thrsleep syz-fuzzer 88685 266233 31483 0 3 0x4000082 thrsleep syz-fuzzer 88685 236961 31483 0 3 0x4000082 thrsleep syz-fuzzer 88685 26468 31483 0 3 0x4000082 thrsleep syz-fuzzer 88685 248871 31483 0 3 0x4000082 kqread syz-fuzzer 88685 295501 31483 0 3 0x4000082 thrsleep syz-fuzzer 88685 75266 31483 0 3 0x4000082 thrsleep syz-fuzzer 31483 509473 7669 0 3 0x10008a pause ksh 7669 155549 23782 0 3 0x92 select sshd 23782 317783 1 0 3 0x80 select sshd 59180 154037 53869 73 7 0x100090 syslogd 53869 463946 1 0 3 0x100082 netio syslogd 29821 464273 1 77 3 0x100090 poll dhclient 828 88277 1 0 3 0x80 poll dhclient 29680 444423 0 0 2 0x14200 zerothread 24062 344052 0 0 3 0x14200 aiodoned aiodoned 54879 495508 0 0 3 0x14200 syncer update 88782 273665 0 0 3 0x14200 cleaner cleaner 39776 348471 0 0 3 0x14200 reaper reaper 83089 440963 0 0 3 0x14200 pgdaemon pagedaemon 88098 238738 0 0 3 0x14200 bored crynlk 94955 306737 0 0 3 0x14200 bored crypto 46079 206332 0 0 3 0x40014200 acpi0 acpi0 91090 144668 0 0 3 0x40014200 idle1 4015 189060 0 0 3 0x14200 bored softnet 3175 90943 0 0 3 0x14200 bored systqmp 78606 67690 0 0 3 0x14200 bored systq 69629 333168 0 0 3 0x40014200 bored softclock 96370 240089 0 0 3 0x40014200 idle0 1 258436 0 0 3 0x82 wait init 0 0 -1 0 3 0x10200 scheduler swapper ddb{0}> show all locks Process 71505 (syz-executor.0) thread 0xffff800020b439e0 (287724) 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{0}> show malloc Type InUse MemUse HighUse Limit Requests Type Lim Kern Lim devbuf 9510 6361K 6368K 78643K 10923 0 0 pcb 23 9K 11K 78643K 512 0 0 rtable 100 3K 4K 78643K 350 0 0 ifaddr 53 13K 14K 78643K 161 0 0 counters 39 33K 33K 78643K 39 0 0 ioctlops 0 0K 2K 78643K 24 0 0 iov 0 0K 16K 78643K 90 0 0 mount 1 1K 1K 78643K 1 0 0 vnodes 1189 74K 75K 78643K 1744 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 15 0 0 VM map 2 1K 1K 78643K 2 0 0 sem 12 1K 1K 78643K 14 0 0 dirhash 12 2K 2K 78643K 12 0 0 ACPI 1792 194K 288K 78643K 12592 0 0 file desc 6 17K 25K 78643K 945 0 0 sigio 0 0K 0K 78643K 18 0 0 proc 42 38K 70K 78643K 353 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 117 0 0 in_multi 33 2K 2K 78643K 78 0 0 ether_multi 1 0K 0K 78643K 10 0 0 ISOFS mount 1 32K 32K 78643K 1 0 0 MSDOSFS mount 1 16K 16K 78643K 1 0 0 ttys 84 371K 371K 78643K 84 0 0 exec 0 0K 1K 78643K 232 0 0 pfkey data 0 0K 0K 78643K 1 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 82 20K 29K 78643K 3809 0 0 UVM aobj 52 4K 4K 78643K 53 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 57 0 0 NDP 10 0K 0K 78643K 42 0 0 temp 155 2366K 2432K 78643K 5349 0 0 kqueue 0 0K 0K 78643K 14 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 461 0 454 1 0 1 1 0 8 0 plimitpl 152 23 0 16 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 173 0 169 1 0 1 1 0 8 0 nd6 48 4 0 0 1 0 1 1 0 8 0 ppxss 1128 25 0 25 6 5 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 sysvmsgpl 40 22 0 5 1 0 1 1 0 8 0 semupl 112 2 0 2 1 1 0 1 0 8 0 semapl 112 10 0 0 1 0 1 1 0 8 0 shmpl 112 51 0 1 2 0 2 2 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino1pl 128 3225 0 1821 46 0 46 46 0 8 0 ffsino 272 3225 0 1821 95 0 95 95 0 8 0 nchpl 144 4760 0 3135 61 0 61 61 0 8 0 uvmvnodes 72 3349 0 0 61 0 61 61 0 8 0 vnodes 200 3349 0 0 177 0 177 177 0 8 0 namei 1024 13988 0 13988 2 1 1 1 0 8 1 percpumem 16 30 0 0 1 0 1 1 0 8 0 scsiplug 64 5 0 5 3 3 0 1 0 8 0 scxspl 192 12004 0 12004 9 8 1 6 0 8 1 sigapl 432 1115 0 1101 2 0 2 2 0 8 0 futexpl 56 10456 0 10456 1 0 1 1 0 8 1 knotepl 112 249 0 222 3 2 1 2 0 8 0 kqueuepl 104 282 0 280 1 0 1 1 0 8 0 pipepl 112 722 0 703 3 2 1 2 0 8 0 fdescpl 488 1116 0 1101 3 1 2 3 0 8 0 filepl 152 6757 0 6661 8 3 5 7 0 8 1 lockfpl 104 337 0 336 4 3 1 1 0 8 0 lockfspl 32 451 0 450 4 3 1 1 0 8 0 sessionpl 112 19 0 9 1 0 1 1 0 8 0 pgrppl 48 26 0 16 1 0 1 1 0 8 0 ucredpl 96 1756 0 1749 1 0 1 1 0 8 0 zombiepl 144 1101 0 1101 2 1 1 1 0 8 1 processpl 840 1131 0 1101 4 0 4 4 0 8 0 procpl 600 3188 0 3147 4 0 4 4 0 8 0 sosppl 128 9 0 9 3 3 0 1 0 8 0 sockpl 384 914 0 897 5 2 3 4 0 8 1 mcl64k 65536 434 0 0 53 6 47 48 0 8 0 mcl16k 16384 1 0 0 1 0 1 1 0 8 0 mcl12k 12288 7 0 0 1 0 1 1 0 8 0 mcl9k 9216 4 0 0 1 0 1 1 0 8 0 mcl8k 8192 6 0 0 1 0 1 1 0 8 0 mcl4k 4096 12 0 0 2 0 2 2 0 8 0 mcl2k2 2112 4 0 0 1 0 1 1 0 8 0 mcl2k 2048 115 0 0 14 0 14 14 0 8 0 mtagpl 80 3 0 0 1 0 1 1 0 8 0 mbufpl 256 516 0 0 30 0 30 30 0 8 0 bufpl 256 6712 0 1015 357 0 357 357 0 8 0 anonpl 16 116424 0 108546 70 36 34 49 0 125 0 amapchunkpl 152 6315 0 6226 18 14 4 9 0 158 0 amappl16 192 6043 0 5626 54 31 23 33 0 8 2 amappl15 184 1 0 0 1 0 1 1 0 8 0 amappl14 176 7 0 5 2 1 1 1 0 8 0 amappl13 168 31 0 27 1 0 1 1 0 8 0 amappl12 160 6 0 5 2 1 1 1 0 8 0 amappl11 152 179 0 169 1 0 1 1 0 8 0 amappl10 144 959 0 954 1 0 1 1 0 8 0 amappl9 136 348 0 344 1 0 1 1 0 8 0 amappl8 128 143 0 123 1 0 1 1 0 8 0 amappl7 120 40 0 34 1 0 1 1 0 8 0 amappl6 112 56 0 48 1 0 1 1 0 8 0 amappl5 104 149 0 135 1 0 1 1 0 8 0 amappl4 96 744 0 723 1 0 1 1 0 8 0 amappl3 88 163 0 158 1 0 1 1 0 8 0 amappl2 80 9800 0 9740 2 0 2 2 0 8 0 amappl1 72 31777 0 31348 23 13 10 19 0 8 0 amappl 72 3397 0 3362 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 52 0 1 1 0 1 1 0 8 0 uaddrrnd 24 1116 0 1101 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 1116 0 1101 1 0 1 1 0 8 0 vmmpekpl 168 13454 0 13433 2 0 2 2 0 8 0 vmmpepl 168 122393 0 120954 103 38 65 73 0 357 1 vmsppl 360 1115 0 1101 2 0 2 2 0 8 0 pdppl 4096 2240 0 2202 6 1 5 6 0 8 0 pvpl 32 334165 0 323207 161 53 108 126 0 265 18 pmappl 224 1115 0 1101 1 0 1 1 0 8 0 extentpl 40 39 0 25 1 0 1 1 0 8 0 phpool 112 580 0 10 17 0 17 17 0 8 0