login: witness: acquiring duplicate lock of same type: "&sc->sc_lock" 1st wsmuxlk @ /syzkaller/managers/multicore/kernel/sys/dev/wscons/wsmux.c:626 2nd wsmuxlk @ /syzkaller/managers/multicore/kernel/sys/dev/wscons/wsmux.c:242 Starting stack trace... witness_checkorder(ffff80000195fed0,1,ffffffff81f354ca,f2,0) at witness_checkorder+0xe14 witness_debugger sys/kern/subr_witness.c:2650 [inline] witness_checkorder(ffff80000195fed0,1,ffffffff81f354ca,f2,0) at witness_checkorder+0xe14 sys/kern/subr_witness.c:926 _rw_enter_read(ffff80000195fec0,ffffffff81f354ca,f2) at _rw_enter_read+0x80 sys/kern/kern_rwlock.c:102 wsmux_mux_open(ffff80000195fe00,ffff80000195fd50) at wsmux_mux_open+0x82 wsmux_do_open sys/dev/wscons/wsmux.c:243 [inline] wsmux_mux_open(ffff80000195fe00,ffff80000195fd50) at wsmux_mux_open+0x82 sys/dev/wscons/wsmux.c:225 wsmux_attach_sc(ffff80000195fd00,ffff80000195fe00) at wsmux_attach_sc+0x180 sys/dev/wscons/wsmux.c:667 VOP_IOCTL(fffffd807a167d98,80085761,ffff800020c29320,f,fffffd807f7c7ba0,ffff800020b25070) at VOP_IOCTL+0x9a sys/kern/vfs_vops.c:290 vn_ioctl(fffffd80691919a0,80085761,ffff800020c29320,ffff800020b25070) at vn_ioctl+0xc9 sys/kern/vfs_vnops.c:512 sys_ioctl(ffff800020b25070,ffff800020c29468,ffff800020c29450) at sys_ioctl+0x646 syscall(ffff800020c29500) at syscall+0x5ac mi_syscall sys/sys/syscall_mi.h:99 [inline] syscall(ffff800020c29500) at syscall+0x5ac sys/arch/amd64/amd64/trap.c:574 Xsyscall(6,0,ffffffffffffff86,0,3,b6fa1712010) at Xsyscall+0x128 end of kernel end trace frame: 0xb7255c63c70, 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(ffff80000195fed0,1,ffffffff81f354ca,f2,0) at witness_checkorder+0xe19 witness_debugger sys/kern/subr_witness.c:2650 [inline] witness_checkorder(ffff80000195fed0,1,ffffffff81f354ca,f2,0) at witness_checkorder+0xe19 sys/kern/subr_witness.c:926 _rw_enter_read(ffff80000195fec0,ffffffff81f354ca,f2) at _rw_enter_read+0x80 sys/kern/kern_rwlock.c:102 wsmux_mux_open(ffff80000195fe00,ffff80000195fd50) at wsmux_mux_open+0x82 wsmux_do_open sys/dev/wscons/wsmux.c:243 [inline] wsmux_mux_open(ffff80000195fe00,ffff80000195fd50) at wsmux_mux_open+0x82 sys/dev/wscons/wsmux.c:225 wsmux_attach_sc(ffff80000195fd00,ffff80000195fe00) at wsmux_attach_sc+0x180 sys/dev/wscons/wsmux.c:667 VOP_IOCTL(fffffd807a167d98,80085761,ffff800020c29320,f,fffffd807f7c7ba0,ffff800020b25070) at VOP_IOCTL+0x9a sys/kern/vfs_vops.c:290 vn_ioctl(fffffd80691919a0,80085761,ffff800020c29320,ffff800020b25070) at vn_ioctl+0xc9 sys/kern/vfs_vnops.c:512 sys_ioctl(ffff800020b25070,ffff800020c29468,ffff800020c29450) at sys_ioctl+0x646 syscall(ffff800020c29500) at syscall+0x5ac mi_syscall sys/sys/syscall_mi.h:99 [inline] syscall(ffff800020c29500) at syscall+0x5ac sys/arch/amd64/amd64/trap.c:574 Xsyscall(6,0,ffffffffffffff86,0,3,b6fa1712010) at Xsyscall+0x128 end of kernel end trace frame: 0xb7255c63c70, count: -10 ddb{0}> show registers rdi 0 rsi 0x3ffff acpi_pdirpa+0x2be67 rbp 0xffff800020c28f50 rbx 0x3 rdx 0x40000 acpi_pdirpa+0x2be68 rcx 0xffff800000947000 rax 0xffff800000941780 r8 0xffffffff81316553 kprintf+0x183 r9 0x1 r10 0x25 r11 0x47c5cf92dc0f826c r12 0xffffffff81f354ca substchar+0x955e r13 0xf2 r14 0xffffffff81f25297 apollo_udma33_tim+0x16e4 r15 0xffffffff81f354ca substchar+0x955e rip 0xffffffff81264218 db_enter+0x18 cs 0x8 rflags 0x246 rsp 0xffff800020c28f40 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb{0}> show proc PROC (syz-executor.0) pid=275649 stat=onproc flags process=0 proc=4000000 pri=86, usrpri=86, nice=20 forw=0xffffffffffffffff, list=0xffff800020b95528,0xffff800020b424d8 process=0xffff800020b45708 user=0xffff800020c24000, vmspace=0xfffffd807f00d5a0 estcpu=36, cpticks=0, pctcpu=0.0 user=0, sys=0, intr=0 ddb{0}> ps PID TID PPID UID S FLAGS WAIT COMMAND 63633 428612 61552 0 2 0 syz-executor.1 63633 445567 61552 0 2 0x4000000 syz-executor.1 73757 247891 19751 0 2 0 syz-executor.0 *73757 275649 19751 0 7 0x4000000 syz-executor.0 61552 2027 74075 0 3 0x82 nanosleep syz-executor.1 19751 454183 74075 0 3 0x82 nanosleep syz-executor.0 74075 308185 13426 0 3 0x82 thrsleep syz-fuzzer 74075 66514 13426 0 3 0x4000082 thrsleep syz-fuzzer 74075 368662 13426 0 3 0x4000082 thrsleep syz-fuzzer 74075 287615 13426 0 3 0x4000082 thrsleep syz-fuzzer 74075 145767 13426 0 3 0x4000082 thrsleep syz-fuzzer 74075 34903 13426 0 3 0x4000082 thrsleep syz-fuzzer 74075 18926 13426 0 3 0x4000082 thrsleep syz-fuzzer 74075 296488 13426 0 3 0x4000082 thrsleep syz-fuzzer 74075 29625 13426 0 3 0x4000082 thrsleep syz-fuzzer 74075 142316 13426 0 3 0x4000082 kqread syz-fuzzer 74075 485676 13426 0 3 0x4000082 thrsleep syz-fuzzer 13426 82935 72823 0 3 0x10008a pause ksh 72823 346800 35052 0 3 0x92 select sshd 91184 519747 1 0 3 0x100083 ttyin getty 35052 86492 1 0 3 0x80 select sshd 83858 301261 34017 73 7 0x100090 syslogd 34017 489111 1 0 3 0x100082 netio syslogd 52929 230809 1 77 3 0x100090 poll dhclient 23800 269785 1 0 3 0x80 poll dhclient 86239 358121 0 0 2 0x14200 zerothread 86692 371383 0 0 3 0x14200 aiodoned aiodoned 87427 145735 0 0 3 0x14200 syncer update 86403 187486 0 0 3 0x14200 cleaner cleaner 1250 358520 0 0 3 0x14200 reaper reaper 75298 407823 0 0 3 0x14200 pgdaemon pagedaemon 24433 359234 0 0 3 0x14200 bored crynlk 96323 214214 0 0 3 0x14200 bored crypto 71955 279280 0 0 3 0x40014200 acpi0 acpi0 63873 85743 0 0 3 0x40014200 idle1 92096 368881 0 0 3 0x14200 bored softnet 2253 417609 0 0 3 0x14200 bored systqmp 18487 242996 0 0 3 0x14200 bored systq 22838 230511 0 0 3 0x40014200 bored softclock 72083 8842 0 0 3 0x40014200 idle0 1 441520 0 0 3 0x82 wait init 0 0 -1 0 3 0x10200 scheduler swapper ddb{0}> show all locks Process 73757 (syz-executor.0) thread 0xffff800020b25070 (275649) exclusive rwlock wsmuxlk r = 0 (0xffff80000195fdd0) locked @ /syzkaller/managers/multicore/kernel/sys/dev/wscons/wsmux.c:626 #0 witness_lock+0x58a sys/kern/subr_witness.c:1205 #1 wsmux_attach_sc+0x48 sys/dev/wscons/wsmux.c:632 #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 (0xffffffff8235c720) 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 9459 6331K 6331K 78643K 10571 0 0 pcb 23 9K 9K 78643K 57 0 0 rtable 100 3K 4K 78643K 182 0 0 ifaddr 35 10K 10K 78643K 43 0 0 counters 39 33K 33K 78643K 39 0 0 ioctlops 0 0K 2K 78643K 15 0 0 mount 1 1K 1K 78643K 1 0 0 vnodes 1200 75K 75K 78643K 1229 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 3 0 0 VM map 2 1K 1K 78643K 2 0 0 sem 5 0K 0K 78643K 6 0 0 dirhash 12 2K 2K 78643K 12 0 0 ACPI 1792 194K 288K 78643K 12592 0 0 file desc 6 17K 21K 78643K 64 0 0 proc 40 38K 58K 78643K 251 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 4 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 42 185K 185K 78643K 42 0 0 exec 0 0K 1K 78643K 168 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 81 20K 25K 78643K 940 0 0 UVM aobj 4 2K 2K 78643K 4 0 0 memdesc 1 4K 4K 78643K 1 0 0 crypto data 1 1K 1K 78643K 1 0 0 NDP 5 0K 0K 78643K 11 0 0 temp 84 2357K 2421K 78643K 2910 0 0 kqueue 0 0K 0K 78643K 3 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 42 0 35 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 tcpcb 544 22 0 18 1 0 1 1 0 8 0 nd6 48 4 0 0 1 0 1 1 0 8 0 ppxss 1128 2 0 2 1 0 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 semapl 112 4 0 1 1 0 1 1 0 8 0 shmpl 112 2 0 0 1 0 1 1 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino1pl 128 1510 0 103 46 0 46 46 0 8 0 ffsino 272 1510 0 103 95 0 95 95 0 8 0 nchpl 144 1804 0 182 61 0 61 61 0 8 0 uvmvnodes 72 1560 0 0 29 0 29 29 0 8 0 vnodes 200 1560 0 0 83 0 83 83 0 8 0 namei 1024 4302 0 4302 1 0 1 1 0 8 1 percpumem 16 30 0 0 1 0 1 1 0 8 0 scsiplug 64 2 0 2 1 0 1 1 0 8 1 scxspl 192 4230 0 4230 8 4 4 6 0 8 4 sigapl 432 232 0 218 2 0 2 2 0 8 0 futexpl 56 529 0 529 1 0 1 1 0 8 1 knotepl 112 82 0 55 2 0 2 2 0 8 1 kqueuepl 104 20 0 18 1 0 1 1 0 8 0 pipepl 112 158 0 139 1 0 1 1 0 8 0 fdescpl 488 233 0 218 3 0 3 3 0 8 1 filepl 152 1173 0 1078 6 1 5 5 0 8 1 lockfpl 104 31 0 31 2 1 1 1 0 8 1 lockfspl 32 28 0 28 2 1 1 1 0 8 1 sessionpl 112 17 0 7 1 0 1 1 0 8 0 pgrppl 48 17 0 7 1 0 1 1 0 8 0 ucredpl 96 94 0 87 1 0 1 1 0 8 0 zombiepl 144 218 0 218 2 1 1 1 0 8 1 processpl 840 247 0 218 4 0 4 4 0 8 0 procpl 600 363 0 322 4 0 4 4 0 8 0 sockpl 384 86 0 69 3 0 3 3 0 8 1 mcl12k 12288 1 0 0 1 0 1 1 0 8 0 mcl8k 8192 2 0 0 1 0 1 1 0 8 0 mcl4k 4096 2 0 0 1 0 1 1 0 8 0 mcl2k 2048 109 0 0 13 0 13 13 0 8 0 mtagpl 80 1 0 0 1 0 1 1 0 8 0 mbufpl 256 130 0 0 8 0 8 8 0 8 0 bufpl 256 5250 0 1013 265 0 265 265 0 8 0 anonpl 16 30120 0 22569 32 1 31 31 0 125 0 amapchunkpl 152 1020 0 931 6 0 6 6 0 158 2 amappl16 192 687 0 296 20 0 20 20 0 8 0 amappl15 184 5 0 3 1 0 1 1 0 8 0 amappl14 176 30 0 27 2 1 1 1 0 8 0 amappl13 168 27 0 23 1 0 1 1 0 8 0 amappl12 160 39 0 36 2 1 1 1 0 8 0 amappl11 152 180 0 171 1 0 1 1 0 8 0 amappl10 144 59 0 55 1 0 1 1 0 8 0 amappl9 136 357 0 353 1 0 1 1 0 8 0 amappl8 128 151 0 133 1 0 1 1 0 8 0 amappl7 120 36 0 31 1 0 1 1 0 8 0 amappl6 112 76 0 67 1 0 1 1 0 8 0 amappl5 104 122 0 112 1 0 1 1 0 8 0 amappl4 96 262 0 241 2 1 1 2 0 8 0 amappl3 88 131 0 123 1 0 1 1 0 8 0 amappl2 80 1076 0 1017 2 0 2 2 0 8 0 amappl1 72 13261 0 12842 23 8 15 19 0 8 5 amappl 72 583 0 548 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 3 0 0 1 0 1 1 0 8 0 uaddrrnd 24 233 0 218 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 233 0 218 1 0 1 1 0 8 0 vmmpekpl 168 5658 0 5637 2 0 2 2 0 8 0 vmmpepl 168 31558 0 30161 78 9 69 70 0 357 8 vmsppl 360 232 0 218 2 0 2 2 0 8 0 pdppl 4096 473 0 436 5 0 5 5 0 8 0 pvpl 32 112682 0 102127 97 4 93 96 0 265 7 pmappl 224 232 0 218 1 0 1 1 0 8 0 extentpl 40 39 0 25 1 0 1 1 0 8 0 phpool 112 408 0 2 12 0 12 12 0 8 0