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(ffff800000026dd0,1,ffffffff81f33463,f5,0) at witness_checkorder+0xe14 witness_debugger sys/kern/subr_witness.c:2650 [inline] witness_checkorder(ffff800000026dd0,1,ffffffff81f33463,f5,0) at witness_checkorder+0xe14 sys/kern/subr_witness.c:926 _rw_enter_read(ffff800000026dc0,ffffffff81f33463,f5) at _rw_enter_read+0x80 sys/kern/kern_rwlock.c:102 wsmux_mux_open(ffff800000026d00,ffff800000026f50) at wsmux_mux_open+0x82 wsmux_do_open sys/dev/wscons/wsmux.c:246 [inline] wsmux_mux_open(ffff800000026d00,ffff800000026f50) at wsmux_mux_open+0x82 sys/dev/wscons/wsmux.c:228 wsmux_attach_sc(ffff800000026f00,ffff800000026d00) at wsmux_attach_sc+0x180 sys/dev/wscons/wsmux.c:670 VOP_IOCTL(fffffd8070594450,80085761,ffff800020c4d380,4a,fffffd807f7c79c0,ffff800020b439e0) at VOP_IOCTL+0x9a sys/kern/vfs_vops.c:290 vn_ioctl(fffffd806929aad0,80085761,ffff800020c4d380,ffff800020b439e0) at vn_ioctl+0xc9 sys/kern/vfs_vnops.c:512 sys_ioctl(ffff800020b439e0,ffff800020c4d4c8,ffff800020c4d4b0) at sys_ioctl+0x646 syscall(ffff800020c4d560) at syscall+0x5ac mi_syscall sys/sys/syscall_mi.h:99 [inline] syscall(ffff800020c4d560) at syscall+0x5ac sys/arch/amd64/amd64/trap.c:574 Xsyscall(6,0,ffffffffffffff86,0,3,9b2aebfa010) at Xsyscall+0x128 end of kernel end trace frame: 0x9b51b2584f0, 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(ffff800000026dd0,1,ffffffff81f33463,f5,0) at witness_checkorder+0xe19 witness_debugger sys/kern/subr_witness.c:2650 [inline] witness_checkorder(ffff800000026dd0,1,ffffffff81f33463,f5,0) at witness_checkorder+0xe19 sys/kern/subr_witness.c:926 _rw_enter_read(ffff800000026dc0,ffffffff81f33463,f5) at _rw_enter_read+0x80 sys/kern/kern_rwlock.c:102 wsmux_mux_open(ffff800000026d00,ffff800000026f50) at wsmux_mux_open+0x82 wsmux_do_open sys/dev/wscons/wsmux.c:246 [inline] wsmux_mux_open(ffff800000026d00,ffff800000026f50) at wsmux_mux_open+0x82 sys/dev/wscons/wsmux.c:228 wsmux_attach_sc(ffff800000026f00,ffff800000026d00) at wsmux_attach_sc+0x180 sys/dev/wscons/wsmux.c:670 VOP_IOCTL(fffffd8070594450,80085761,ffff800020c4d380,4a,fffffd807f7c79c0,ffff800020b439e0) at VOP_IOCTL+0x9a sys/kern/vfs_vops.c:290 vn_ioctl(fffffd806929aad0,80085761,ffff800020c4d380,ffff800020b439e0) at vn_ioctl+0xc9 sys/kern/vfs_vnops.c:512 sys_ioctl(ffff800020b439e0,ffff800020c4d4c8,ffff800020c4d4b0) at sys_ioctl+0x646 syscall(ffff800020c4d560) at syscall+0x5ac mi_syscall sys/sys/syscall_mi.h:99 [inline] syscall(ffff800020c4d560) at syscall+0x5ac sys/arch/amd64/amd64/trap.c:574 Xsyscall(6,0,ffffffffffffff86,0,3,9b2aebfa010) at Xsyscall+0x128 end of kernel end trace frame: 0x9b51b2584f0, count: -10 ddb{0}> show registers rdi 0 rsi 0x3ffff acpi_pdirpa+0x2be67 rbp 0xffff800020c4cfb0 rbx 0x3 rdx 0x40000 acpi_pdirpa+0x2be68 rcx 0xffff800000947000 rax 0xffff80000194de00 r8 0xffffffff818cb2f3 kprintf+0x183 r9 0x1 r10 0x25 r11 0x2e1e5f1bfb67acd 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 0xffff800020c4cfa0 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb{0}> show proc PROC (syz-executor.0) pid=233009 stat=onproc flags process=0 proc=4000000 pri=65, usrpri=65, nice=20 forw=0xffffffffffffffff, list=0xffff800020b43788,0xffff800020b43540 process=0xffff800020b446a0 user=0xffff800020c48000, vmspace=0xfffffd807effe708 estcpu=15, cpticks=0, pctcpu=1.1 user=0, sys=0, intr=0 ddb{0}> ps PID TID PPID UID S FLAGS WAIT COMMAND 18426 456738 75503 0 2 0 syz-executor.0 *18426 233009 75503 0 7 0x4000000 syz-executor.0 18426 427435 75503 0 3 0x4000080 fsleep syz-executor.0 75503 4049 1965 0 3 0x82 nanosleep syz-executor.0 55670 44558 0 0 3 0x14200 bored sosplice 10635 338848 1965 0 3 0x82 nanosleep syz-executor.1 1965 351795 82023 0 3 0x82 thrsleep syz-fuzzer 1965 285561 82023 0 3 0x4000082 thrsleep syz-fuzzer 1965 508055 82023 0 3 0x4000082 thrsleep syz-fuzzer 1965 258163 82023 0 3 0x4000082 thrsleep syz-fuzzer 1965 303447 82023 0 3 0x4000082 thrsleep syz-fuzzer 1965 216981 82023 0 3 0x4000082 thrsleep syz-fuzzer 1965 187213 82023 0 3 0x4000082 thrsleep syz-fuzzer 1965 170596 82023 0 3 0x4000082 kqread syz-fuzzer 1965 235396 82023 0 3 0x4000082 thrsleep syz-fuzzer 1965 170193 82023 0 3 0x4000082 thrsleep syz-fuzzer 82023 19893 74301 0 3 0x10008a pause ksh 74301 496963 96796 0 3 0x92 select sshd 35477 138870 1 0 3 0x100083 ttyin getty 96796 319767 1 0 3 0x80 select sshd 65043 87550 71308 73 7 0x100090 syslogd 71308 156143 1 0 3 0x100082 netio syslogd 62384 328275 1 77 3 0x100090 poll dhclient 39987 461072 1 0 3 0x80 poll dhclient 18415 273680 0 0 2 0x14200 zerothread 28273 435512 0 0 3 0x14200 aiodoned aiodoned 12574 158062 0 0 3 0x14200 syncer update 19422 468363 0 0 3 0x14200 cleaner cleaner 45270 299600 0 0 3 0x14200 reaper reaper 70096 267497 0 0 3 0x14200 pgdaemon pagedaemon 46861 464070 0 0 3 0x14200 bored crynlk 98893 445894 0 0 3 0x14200 bored crypto 10689 74668 0 0 3 0x40014200 acpi0 acpi0 95721 517801 0 0 3 0x40014200 idle1 98442 264718 0 0 3 0x14200 bored softnet 7628 115718 0 0 3 0x14200 bored systqmp 99339 465687 0 0 3 0x14200 bored systq 78236 111401 0 0 3 0x40014200 bored softclock 67085 247984 0 0 3 0x40014200 idle0 1 110825 0 0 3 0x82 wait init 0 0 -1 0 3 0x10200 scheduler swapper ddb{0}> show all locks Process 18426 (syz-executor.0) thread 0xffff800020b439e0 (233009) exclusive rwlock wsmuxlk r = 0 (0xffff800000026fd0) 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 9489 6353K 6353K 78643K 10699 0 0 pcb 23 9K 10K 78643K 175 0 0 rtable 100 3K 4K 78643K 325 0 0 ifaddr 46 11K 12K 78643K 113 0 0 counters 39 33K 33K 78643K 39 0 0 ioctlops 0 0K 2K 78643K 21 0 0 iov 0 0K 12K 78643K 30 0 0 mount 1 1K 1K 78643K 1 0 0 vnodes 1192 75K 75K 78643K 1389 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 10 0 0 VM map 2 1K 1K 78643K 2 0 0 sem 12 0K 1K 78643K 45 0 0 dirhash 12 2K 2K 78643K 12 0 0 ACPI 1792 194K 288K 78643K 12592 0 0 file desc 5 13K 25K 78643K 325 0 0 sigio 0 0K 0K 78643K 2 0 0 proc 42 38K 58K 78643K 319 0 0 subproc 64 65538K 67586K 78643K 140 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 61 0 0 in_multi 33 2K 2K 78643K 64 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 78 344K 344K 78643K 78 0 0 exec 0 0K 1K 78643K 192 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 29K 78643K 1786 0 0 UVM aobj 40 2K 2K 78643K 44 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 2 0 0 NDP 8 0K 0K 78643K 32 0 0 temp 137 2361K 2426K 78643K 3799 0 0 kqueue 0 0K 0K 78643K 1 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 183 0 176 1 0 1 1 0 8 0 plimitpl 152 22 0 15 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 60 0 56 1 0 1 1 0 8 0 nd6 48 8 0 4 1 0 1 1 0 8 0 ppxss 1128 13 0 13 2 1 1 1 0 8 1 art_heap8 4096 1 0 0 1 0 1 1 0 8 0 art_heap4 256 270 0 82 12 0 12 12 0 8 0 art_table 32 271 0 82 2 0 2 2 0 8 0 art_node 16 58 0 24 1 0 1 1 0 8 0 sysvmsgpl 40 8 0 6 1 0 1 1 0 8 0 semapl 112 43 0 33 1 0 1 1 0 8 0 shmpl 112 42 0 4 2 0 2 2 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino1pl 128 1995 0 594 46 0 46 46 0 8 0 ffsino 272 1995 0 594 95 0 95 95 0 8 0 nchpl 144 2622 0 1013 61 0 61 61 0 8 0 uvmvnodes 72 2081 0 0 38 0 38 38 0 8 0 vnodes 200 2081 0 0 110 0 110 110 0 8 0 namei 1024 7037 0 7037 1 0 1 1 0 8 1 percpumem 16 30 0 0 1 0 1 1 0 8 0 scxspl 192 6361 0 6361 7 6 1 6 0 8 1 sigapl 432 487 0 474 2 0 2 2 0 8 0 futexpl 56 3472 0 3471 1 0 1 1 0 8 0 knotepl 112 192 0 165 3 2 1 2 0 8 0 kqueuepl 104 99 0 97 1 0 1 1 0 8 0 pipepl 112 348 0 329 1 0 1 1 0 8 0 fdescpl 488 488 0 474 3 1 2 3 0 8 0 filepl 152 2782 0 2686 6 1 5 5 0 8 1 lockfpl 104 148 0 147 2 1 1 1 0 8 0 lockfspl 32 248 0 247 2 1 1 1 0 8 0 sessionpl 112 19 0 9 1 0 1 1 0 8 0 pgrppl 48 21 0 11 1 0 1 1 0 8 0 ucredpl 96 590 0 583 1 0 1 1 0 8 0 zombiepl 144 474 0 473 1 0 1 1 0 8 0 processpl 840 503 0 473 4 0 4 4 0 8 0 procpl 600 1169 0 1128 4 0 4 4 0 8 0 srpgc 64 12 0 12 1 1 0 1 0 8 0 sosppl 128 7 0 7 2 1 1 1 0 8 1 sockpl 384 328 0 311 3 0 3 3 0 8 1 mcl64k 65536 6 0 0 1 0 1 1 0 8 0 mcl16k 16384 1 0 0 1 0 1 1 0 8 0 mcl12k 12288 3 0 0 1 0 1 1 0 8 0 mcl9k 9216 3 0 0 1 0 1 1 0 8 0 mcl8k 8192 2 0 0 1 0 1 1 0 8 0 mcl4k 4096 4 0 0 1 0 1 1 0 8 0 mcl2k 2048 108 0 0 13 0 13 13 0 8 0 mtagpl 80 1 0 0 1 0 1 1 0 8 0 mbufpl 256 148 0 0 8 0 8 8 0 8 0 bufpl 256 5595 0 1013 287 0 287 287 0 8 0 anonpl 16 63564 0 56118 52 9 43 46 0 125 10 amapchunkpl 152 2991 0 2903 17 8 9 9 0 158 4 amappl16 192 2168 0 1762 43 16 27 33 0 8 6 amappl15 184 78 0 75 1 0 1 1 0 8 0 amappl14 176 143 0 140 2 1 1 1 0 8 0 amappl13 168 182 0 178 1 0 1 1 0 8 0 amappl12 160 4 0 3 2 1 1 1 0 8 0 amappl11 152 187 0 178 1 0 1 1 0 8 0 amappl10 144 55 0 53 1 0 1 1 0 8 0 amappl9 136 356 0 352 1 0 1 1 0 8 0 amappl8 128 144 0 128 1 0 1 1 0 8 0 amappl7 120 199 0 191 1 0 1 1 0 8 0 amappl6 112 195 0 185 1 0 1 1 0 8 0 amappl5 104 129 0 119 1 0 1 1 0 8 0 amappl4 96 269 0 246 2 1 1 2 0 8 0 amappl3 88 138 0 133 1 0 1 1 0 8 0 amappl2 80 3481 0 3430 2 0 2 2 0 8 0 amappl1 72 19330 0 18909 24 14 10 19 0 8 0 amappl 72 1396 0 1362 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 43 0 4 1 0 1 1 0 8 0 uaddrrnd 24 488 0 474 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 488 0 474 1 0 1 1 0 8 0 vmmpekpl 168 7685 0 7661 2 0 2 2 0 8 0 vmmpepl 168 58489 0 57146 86 15 71 73 0 357 10 vmsppl 360 487 0 474 2 0 2 2 0 8 0 pdppl 4096 984 0 948 6 1 5 6 0 8 0 pvpl 32 186856 0 175940 127 11 116 120 0 265 26 pmappl 224 487 0 474 1 0 1 1 0 8 0 extentpl 40 39 0 25 1 0 1 1 0 8 0 phpool 112 433 0 3 13 0 13 13 0 8 0