witness: acquiring duplicate lock of same type: "&sc->sc_lock" 1st wsmuxlk @ /syzkaller/managers/multicore/kernel/sys/dev/wscons/wsmux.c:310 2nd wsmuxlk @ /syzkaller/managers/multicore/kernel/sys/dev/wscons/wsmux.c:310 Starting stack trace... witness_checkorder(ffff800002b498d0,1,ffffffff81f36129,136,0) at witness_checkorder+0xe14 witness_debugger sys/kern/subr_witness.c:2650 [inline] witness_checkorder(ffff800002b498d0,1,ffffffff81f36129,136,0) at witness_checkorder+0xe14 sys/kern/subr_witness.c:926 _rw_enter_read(ffff800002b498c0,ffffffff81f36129,136) at _rw_enter_read+0x80 sys/kern/kern_rwlock.c:102 wsmux_mux_close(ffff800002b49800) at wsmux_mux_close+0x47 wsmux_do_close sys/dev/wscons/wsmux.c:311 [inline] wsmux_mux_close(ffff800002b49800) at wsmux_mux_close+0x47 sys/dev/wscons/wsmux.c:297 wsmuxclose(4500,82,2000,ffff800020b95528) at wsmuxclose+0xd6 wsmux_do_close sys/dev/wscons/wsmux.c:321 [inline] wsmuxclose(4500,82,2000,ffff800020b95528) at wsmuxclose+0xd6 sys/dev/wscons/wsmux.c:284 spec_close(ffff800020c293f0) at spec_close+0x3a0 sys/kern/spec_vnops.c:553 VOP_CLOSE(fffffd8070213a78,82,fffffd807f7c7840,ffff800020b95528) at VOP_CLOSE+0x70 sys/kern/vfs_vops.c:174 vn_closefile(fffffd8067217578,ffff800020b95528) at vn_closefile+0x160 vn_close sys/kern/vfs_vnops.c:289 [inline] vn_closefile(fffffd8067217578,ffff800020b95528) at vn_closefile+0x160 sys/kern/vfs_vnops.c:575 fdrop(fffffd8067217578,ffff800020b95528) at fdrop+0xe1 sys/kern/kern_descrip.c:1260 closef(fffffd8067217578,ffff800020b95528) at closef+0x129 sys/kern/kern_descrip.c:1244 fdfree(ffff800020b95528) at fdfree+0xe8 sys/kern/kern_descrip.c:1176 exit1(ffff800020b95528,0,1) at exit1+0x2ee sys/kern/kern_exit.c:194 sys_exit(ffff800020b95528,ffff800020c296f0,ffff800020c296e0) at sys_exit+0x17 sys/kern/kern_exit.c:94 syscall(ffff800020c29790) at syscall+0x5ac mi_syscall sys/sys/syscall_mi.h:99 [inline] syscall(ffff800020c29790) at syscall+0x5ac sys/arch/amd64/amd64/trap.c:574 Xsyscall(0,1,0,1,0,7f7ffffbc004) at Xsyscall+0x128 end of kernel end trace frame: 0x7f7ffffbbfd0, count: 243 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(ffff800002b498d0,1,ffffffff81f36129,136,0) at witness_checkorder+0xe19 witness_debugger sys/kern/subr_witness.c:2650 [inline] witness_checkorder(ffff800002b498d0,1,ffffffff81f36129,136,0) at witness_checkorder+0xe19 sys/kern/subr_witness.c:926 _rw_enter_read(ffff800002b498c0,ffffffff81f36129,136) at _rw_enter_read+0x80 sys/kern/kern_rwlock.c:102 wsmux_mux_close(ffff800002b49800) at wsmux_mux_close+0x47 wsmux_do_close sys/dev/wscons/wsmux.c:311 [inline] wsmux_mux_close(ffff800002b49800) at wsmux_mux_close+0x47 sys/dev/wscons/wsmux.c:297 wsmuxclose(4500,82,2000,ffff800020b95528) at wsmuxclose+0xd6 wsmux_do_close sys/dev/wscons/wsmux.c:321 [inline] wsmuxclose(4500,82,2000,ffff800020b95528) at wsmuxclose+0xd6 sys/dev/wscons/wsmux.c:284 spec_close(ffff800020c293f0) at spec_close+0x3a0 sys/kern/spec_vnops.c:553 VOP_CLOSE(fffffd8070213a78,82,fffffd807f7c7840,ffff800020b95528) at VOP_CLOSE+0x70 sys/kern/vfs_vops.c:174 vn_closefile(fffffd8067217578,ffff800020b95528) at vn_closefile+0x160 vn_close sys/kern/vfs_vnops.c:289 [inline] vn_closefile(fffffd8067217578,ffff800020b95528) at vn_closefile+0x160 sys/kern/vfs_vnops.c:575 fdrop(fffffd8067217578,ffff800020b95528) at fdrop+0xe1 sys/kern/kern_descrip.c:1260 closef(fffffd8067217578,ffff800020b95528) at closef+0x129 sys/kern/kern_descrip.c:1244 fdfree(ffff800020b95528) at fdfree+0xe8 sys/kern/kern_descrip.c:1176 exit1(ffff800020b95528,0,1) at exit1+0x2ee sys/kern/kern_exit.c:194 sys_exit(ffff800020b95528,ffff800020c296f0,ffff800020c296e0) at sys_exit+0x17 sys/kern/kern_exit.c:94 syscall(ffff800020c29790) at syscall+0x5ac mi_syscall sys/sys/syscall_mi.h:99 [inline] syscall(ffff800020c29790) at syscall+0x5ac sys/arch/amd64/amd64/trap.c:574 Xsyscall(0,1,0,1,0,7f7ffffbc004) at Xsyscall+0x128 end of kernel end trace frame: 0x7f7ffffbbfd0, count: -15 ddb{1}> show registers rdi 0 rsi 0 rbp 0xffff800020c291a0 rbx 0x3 rdx 0xffffffff81f54373 cy_pio_rec+0x1272 rcx 0 rax 0 r8 0xffffffff8155ffb3 kprintf+0x183 r9 0x1 r10 0x25 r11 0x3c1189bec4572d6 r12 0xffffffff81f36129 substchar+0xb4b1 r13 0x136 r14 0xffffffff81f25d3f apollo_udma33_tim+0x233d r15 0xffffffff81f36129 substchar+0xb4b1 rip 0xffffffff812c7448 db_enter+0x18 cs 0x8 rflags 0x246 rsp 0xffff800020c29190 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb{1}> show proc PROC (syz-executor.0) pid=237253 stat=onproc flags process=1008 proc=2000 pri=50, usrpri=86, nice=20 forw=0xffffffffffffffff, list=0xffff800020b959d8,0xffff800020b6c4d8 process=0xffff800020b453c0 user=0xffff800020c24000, vmspace=0xfffffd807efffca8 estcpu=36, cpticks=6, pctcpu=0.0 user=0, sys=0, intr=0 ddb{1}> ps PID TID PPID UID S FLAGS WAIT COMMAND 39607 195960 44934 0 2 0 syz-executor.1 39607 26669 44934 0 3 0x4000080 ttyout syz-executor.1 39607 189978 44934 0 2 0x4000000 syz-executor.1 44934 187753 78861 0 3 0x82 nanosleep syz-executor.1 32845 492939 78861 0 3 0x82 nanosleep syz-executor.0 78861 415041 52129 0 3 0x82 thrsleep syz-fuzzer 78861 225313 52129 0 3 0x4000082 thrsleep syz-fuzzer 78861 298285 52129 0 3 0x4000082 thrsleep syz-fuzzer 78861 293578 52129 0 3 0x4000082 thrsleep syz-fuzzer 78861 188155 52129 0 3 0x4000082 thrsleep syz-fuzzer 78861 448221 52129 0 3 0x4000082 thrsleep syz-fuzzer 78861 102148 52129 0 3 0x4000082 thrsleep syz-fuzzer 78861 45310 52129 0 3 0x4000082 thrsleep syz-fuzzer 78861 8987 52129 0 3 0x4000082 thrsleep syz-fuzzer 78861 497477 52129 0 3 0x4000082 thrsleep syz-fuzzer 78861 132421 52129 0 3 0x4000082 kqread syz-fuzzer 78861 63074 52129 0 3 0x4000082 thrsleep syz-fuzzer 52129 148724 553 0 3 0x10008a pause ksh 553 300296 76270 0 3 0x92 select sshd 34952 107946 1 0 3 0x100083 ttyin getty 76270 204635 1 0 3 0x80 select sshd 35806 135556 5457 73 2 0x100090 syslogd 5457 225940 1 0 3 0x100082 netio syslogd 25242 43052 1 77 3 0x100090 poll dhclient 27865 440193 1 0 3 0x80 poll dhclient 97748 298283 0 0 2 0x14200 zerothread 41517 135077 0 0 3 0x14200 aiodoned aiodoned 88902 109952 0 0 3 0x14200 syncer update 83249 339073 0 0 3 0x14200 cleaner cleaner 29474 294707 0 0 7 0x14200 reaper 30948 62720 0 0 3 0x14200 pgdaemon pagedaemon 48857 269805 0 0 3 0x14200 bored crynlk 22926 45955 0 0 3 0x14200 bored crypto 51753 450478 0 0 3 0x40014200 acpi0 acpi0 1690 384767 0 0 3 0x40014200 idle1 12902 275326 0 0 3 0x14200 bored softnet 75298 358728 0 0 3 0x14200 bored systqmp 28948 344847 0 0 3 0x14200 bored systq 56303 446104 0 0 3 0x40014200 bored softclock 64944 459427 0 0 3 0x40014200 idle0 1 393022 0 0 3 0x82 wait init 0 0 -1 0 3 0x10200 scheduler swapper ddb{1}> show all locks ddb{1}> show malloc Type InUse MemUse HighUse Limit Requests Type Lim Kern Lim devbuf 9462 6337K 6338K 78643K 10562 0 0 pcb 23 9K 9K 78643K 88 0 0 rtable 100 3K 4K 78643K 176 0 0 ifaddr 35 10K 10K 78643K 39 0 0 counters 39 33K 33K 78643K 39 0 0 ioctlops 0 0K 2K 78643K 15 0 0 iov 0 0K 4K 78643K 4 0 0 mount 1 1K 1K 78643K 1 0 0 vnodes 1197 75K 75K 78643K 1232 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 12 0K 0K 78643K 16 0 0 dirhash 12 2K 2K 78643K 12 0 0 ACPI 1792 194K 288K 78643K 12592 0 0 file desc 6 17K 25K 78643K 72 0 0 proc 41 38K 70K 78643K 255 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 6 0 0 in_multi 33 2K 2K 78643K 35 0 0 ether_multi 1 0K 0K 78643K 2 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 171 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 20K 78643K 957 0 0 UVM aobj 3 2K 2K 78643K 3 0 0 memdesc 1 4K 4K 78643K 1 0 0 crypto data 1 1K 1K 78643K 1 0 0 NDP 5 0K 0K 78643K 10 0 0 temp 81 2352K 2418K 78643K 2917 0 0 kqueue 0 0K 0K 78643K 1 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 47 0 40 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 17 0 13 1 0 1 1 0 8 0 nd6 48 4 0 0 1 0 1 1 0 8 0 ppxss 1128 1 0 1 1 0 1 1 0 8 1 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 2 0 2 1 0 1 1 0 8 1 semapl 112 14 0 4 1 0 1 1 0 8 0 shmpl 112 1 0 0 1 0 1 1 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino1pl 128 1531 0 125 46 0 46 46 0 8 0 ffsino 272 1531 0 125 95 0 95 95 0 8 0 nchpl 144 1836 0 213 61 0 61 61 0 8 0 uvmvnodes 72 1575 0 0 29 0 29 29 0 8 0 vnodes 200 1575 0 0 83 0 83 83 0 8 0 namei 1024 4520 0 4520 2 1 1 1 0 8 1 percpumem 16 30 0 0 1 0 1 1 0 8 0 scxspl 192 4312 0 4312 7 6 1 6 0 8 1 sigapl 432 240 0 226 2 0 2 2 0 8 0 futexpl 56 753 0 753 1 0 1 1 0 8 1 knotepl 112 89 0 62 2 0 2 2 0 8 1 kqueuepl 104 30 0 28 1 0 1 1 0 8 0 pipepl 112 168 0 149 2 1 1 1 0 8 0 fdescpl 488 241 0 226 3 0 3 3 0 8 1 filepl 152 1310 0 1213 6 1 5 5 0 8 1 lockfpl 104 20 0 20 2 1 1 1 0 8 1 lockfspl 32 7 0 7 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 166 0 159 1 0 1 1 0 8 0 zombiepl 144 227 0 226 2 1 1 1 0 8 0 processpl 840 255 0 226 4 0 4 4 0 8 0 procpl 600 392 0 349 4 0 4 4 0 8 0 sockpl 384 112 0 95 3 0 3 3 0 8 1 mcl64k 65536 1 0 0 1 0 1 1 0 8 0 mcl16k 16384 2 0 0 1 0 1 1 0 8 0 mcl12k 12288 1 0 0 1 0 1 1 0 8 0 mcl9k 9216 1 0 0 1 0 1 1 0 8 0 mcl4k 4096 3 0 0 1 0 1 1 0 8 0 mcl2k2 2112 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 5262 0 1013 266 0 266 266 0 8 0 anonpl 16 30283 0 22955 32 1 31 31 0 125 1 amapchunkpl 152 1066 0 971 6 0 6 6 0 158 1 amappl16 192 758 0 379 20 0 20 20 0 8 1 amappl15 184 30 0 28 1 0 1 1 0 8 0 amappl14 176 9 0 6 2 1 1 1 0 8 0 amappl13 168 51 0 46 1 0 1 1 0 8 0 amappl12 160 7 0 7 2 1 1 1 0 8 1 amappl11 152 179 0 169 1 0 1 1 0 8 0 amappl10 144 58 0 56 2 1 1 1 0 8 0 amappl9 136 338 0 335 1 0 1 1 0 8 0 amappl8 128 137 0 120 1 0 1 1 0 8 0 amappl7 120 65 0 58 1 0 1 1 0 8 0 amappl6 112 56 0 49 1 0 1 1 0 8 0 amappl5 104 180 0 166 1 0 1 1 0 8 0 amappl4 96 274 0 251 2 1 1 2 0 8 0 amappl3 88 128 0 122 1 0 1 1 0 8 0 amappl2 80 1149 0 1088 2 0 2 2 0 8 0 amappl1 72 13591 0 13166 23 9 14 19 0 8 4 amappl 72 596 0 558 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 2 0 0 1 0 1 1 0 8 0 uaddrrnd 24 241 0 226 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 241 0 226 1 0 1 1 0 8 0 vmmpekpl 168 5760 0 5737 2 0 2 2 0 8 0 vmmpepl 168 32234 0 30839 79 11 68 70 0 357 7 vmsppl 360 240 0 226 2 0 2 2 0 8 0 pdppl 4096 490 0 452 6 0 6 6 0 8 1 pvpl 32 113662 0 103295 99 7 92 96 0 265 8 pmappl 224 240 0 226 1 0 1 1 0 8 0 extentpl 40 39 0 25 1 0 1 1 0 8 0 phpool 112 412 0 3 12 0 12 12 0 8 0