""ûpS ¡Œ·V8P3ûpS ¡Œ·V8P3witness: lock order reversal: 1st 0xffff800020b8cb40 &pr->ps_mtx (&pr->ps_mtx) 2nd 0xffffffff82384c80 &sched_lock (&sched_lock) lock order "&sched_lock"(sched_lock) -> "&pr->ps_mtx"(mutex) first seen at: #0 witness_checkorder+0x6a7 sys/kern/subr_witness.c:877 #1 mtx_enter+0x3a sys/kern/kern_lock.c:265 #2 tuagg+0x32 sys/kern/kern_resource.c:360 #3 mi_switch+0x1c7 x86_atomic_clearbits_u32 sys/arch/amd64/compile/SYZKALLER/obj/machine/atomic.h:298 [inline] #3 mi_switch+0x1c7 sys/kern/sched_bsd.c:392 #4 sleep_finish+0x110 sys/kern/kern_synch.c:303 #5 msleep+0x1af sleep_finish_timeout sys/kern/kern_synch.c:327 [inline] #5 msleep+0x1af sleep_finish_all sys/kern/kern_synch.c:157 [inline] #5 msleep+0x1af sys/kern/kern_synch.c:220 #6 scsi_xs_sync+0x14f sys/scsi/scsi_base.c:1339 #7 scsi_start+0x86 sys/scsi/scsi_base.c:938 #8 sdopen+0x22b sys/scsi/sd.c:400 #9 spec_open+0x41c sys/kern/spec_vnops.c:158 #10 VOP_OPEN+0x6a sys/kern/vfs_vops.c:153 #11 sr_meta_native_bootprobe+0xd3 sys/dev/softraid.c:1038 #12 sr_boot_assembly+0x1aa sys/dev/softraid.c:1202 #13 sr_attach+0x183 sys/dev/softraid.c:1822 #14 config_attach+0x347 sys/kern/subr_autoconf.c:404 #15 main+0x6de sys/kern/init_main.c:483 #16 longmode_hi+0x95 lock order "&pr->ps_mtx"(mutex) -> "&sched_lock"(sched_lock) first seen at: #0 witness_checkorder+0x6a7 sys/kern/subr_witness.c:877 #1 __mp_lock+0xa1 #2 schedclock+0x99 sys/kern/sched_bsd.c:547 #3 hardclock+0x1d8 sys/kern/kern_clock.c:174 #4 lapic_clockintr+0x44 sys/arch/amd64/amd64/lapic.c:425 #5 Xresume_lapic_ltimer+0x26 #6 __sanitizer_cov_trace_pc+0x25 sys/dev/kcov.c:99 #7 exit1+0x6e5 sys/kern/kern_exit.c:292 #8 sys_exit+0x17 sys/kern/kern_exit.c:94 #9 syscall+0x552 mi_syscall sys/sys/syscall_mi.h:99 [inline] #9 syscall+0x552 sys/arch/amd64/amd64/trap.c:574 #10 Xsyscall+0x128 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:398 witness_checkorder(ffffffff82384c80,9,0) at witness_checkorder+0xffc witness_debugger sys/kern/subr_witness.c:2504 [inline] witness_checkorder(ffffffff82384c80,9,0) at witness_checkorder+0xffc sys/kern/subr_witness.c:1084 __mp_lock(ffffffff82384a78) at __mp_lock+0xa1 schedclock(ffff800020b33c40) at schedclock+0x99 sys/kern/sched_bsd.c:547 hardclock(ffff800023c5ba50) at hardclock+0x1d8 sys/kern/kern_clock.c:174 lapic_clockintr(0,0) at lapic_clockintr+0x44 sys/arch/amd64/amd64/lapic.c:425 Xresume_lapic_ltimer(9,ffff800020ab0ff0,0,0,0,ffff800020b33c40) at Xresume_lapic_ltimer+0x26 __sanitizer_cov_trace_pc() at __sanitizer_cov_trace_pc+0x25 sys/dev/kcov.c:99 exit1(ffff800020b33c40,0,1) at exit1+0x6e5 sys/kern/kern_exit.c:292 sys_exit(ffff800020b33c40,ffff800023c5bc40,ffff800023c5bcb0) at sys_exit+0x17 sys/kern/kern_exit.c:94 syscall(ffff800023c5bd20) at syscall+0x552 mi_syscall sys/sys/syscall_mi.h:99 [inline] syscall(ffff800023c5bd20) at syscall+0x552 sys/arch/amd64/amd64/trap.c:574 Xsyscall(6,1,0,1,0,7f7fffff7ce4) at Xsyscall+0x128 end of kernel end trace frame: 0x7f7fffff7cb0, count: -12 ddb{1}> show registers rdi 0x3 rsi 0xffffffff821fc9e0 __sancov_gen_cov_switch_values.122 rbp 0xffff800023c5b850 rbx 0x3 rdx 0xffff800020ab0ff0 rcx 0x3 rax 0xffff800020ab0ff0 r8 0xffffffff818c8c95 witness_checkorder+0xfd5 r9 0x5 r10 0x3 r11 0xd0e5a754bc1c15c5 r12 0xfffffd8002661340 r13 0xc r14 0xffffffff82330740 w_lodata+0x454f0 r15 0xffffffff823425f0 w_lodata+0x573a0 rip 0xffffffff81a42468 db_enter+0x18 cs 0x8 rflags 0x246 rsp 0xffff800023c5b840 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb{1}> show proc PROC (syz-executor.0) pid=261128 stat=dead flags process=1008 proc=2000 pri=17, usrpri=86, nice=20 forw=0xffffffffffffffff, list=0xffffffffffffffff,0xffffffffffffffff process=0xffff800020b8ca80 user=0xffff800023c56000, vmspace=0xfffffd807effd9d8 estcpu=36, cpticks=5, pctcpu=0.0 user=0, sys=1, intr=0 ddb{1}> ps PID TID PPID UID S FLAGS WAIT COMMAND 18039 301362 0 0 3 0x14200 bored sosplice 52508 36165 1 0 3 0x100083 ttyin getty 8207 485896 57473 0 3 0x2 biowait syz-executor.1 44649 182113 57473 0 3 0x82 nanosleep syz-executor.0 57473 515670 18562 0 3 0x82 thrsleep syz-fuzzer 57473 254983 18562 0 3 0x4000082 nanosleep syz-fuzzer 57473 239603 18562 0 3 0x4000082 thrsleep syz-fuzzer 57473 279340 18562 0 3 0x4000082 thrsleep syz-fuzzer 57473 221269 18562 0 3 0x4000082 thrsleep syz-fuzzer 57473 123822 18562 0 3 0x4000082 thrsleep syz-fuzzer 57473 288197 18562 0 3 0x4000082 thrsleep syz-fuzzer 57473 434944 18562 0 3 0x4000082 thrsleep syz-fuzzer 57473 360371 18562 0 3 0x4000082 kqread syz-fuzzer 57473 453192 18562 0 3 0x4000082 thrsleep syz-fuzzer 18562 429386 27914 0 3 0x10008a pause ksh 27914 139277 498 0 3 0x92 select sshd 498 301125 1 0 3 0x80 select sshd 91166 380441 54022 74 3 0x100092 bpf pflogd 54022 30536 1 0 3 0x80 netio pflogd 69560 32607 76338 73 7 0x100090 syslogd 76338 356598 1 0 3 0x100082 netio syslogd 488 182036 1 77 3 0x100090 poll dhclient 80792 216679 1 0 3 0x80 poll dhclient 35721 212940 0 0 3 0x14200 pgzero zerothread 73214 367449 0 0 3 0x14200 aiodoned aiodoned 26439 113544 0 0 3 0x14200 syncer update 87804 414218 0 0 3 0x14200 cleaner cleaner 78874 101237 0 0 3 0x14200 reaper reaper 13887 481192 0 0 3 0x14200 pgdaemon pagedaemon 92227 432701 0 0 3 0x14200 bored crynlk 31709 239709 0 0 3 0x14200 bored crypto 98745 139820 0 0 3 0x40014200 acpi0 acpi0 67688 178775 0 0 3 0x40014200 idle1 79102 164742 0 0 3 0x14200 bored softnet 89849 360449 0 0 3 0x14200 bored systqmp 59185 189115 0 0 3 0x14200 bored systq 29262 16319 0 0 3 0x40014200 bored softclock 11963 511693 0 0 3 0x40014200 idle0 58884 82223 0 0 3 0x14200 bored smr 1 416299 0 0 3 0x82 wait init 0 0 -1 0 3 0x10200 scheduler swapper ddb{1}> show all locks CPU 1: exclusive mutex &pr->ps_mtx r = 0 (0xffff800020b8cb40) #0 witness_lock+0x52e sys/kern/subr_witness.c:1161 #1 mtx_enter_try+0x102 #2 mtx_enter+0x4b sys/kern/kern_lock.c:266 #3 tuagg+0x32 sys/kern/kern_resource.c:360 #4 exit1+0x6e5 sys/kern/kern_exit.c:292 #5 sys_exit+0x17 sys/kern/kern_exit.c:94 #6 syscall+0x552 mi_syscall sys/sys/syscall_mi.h:99 [inline] #6 syscall+0x552 sys/arch/amd64/amd64/trap.c:574 #7 Xsyscall+0x128 Process 8207 (syz-executor.1) thread 0xffff800020b332e0 (485896) exclusive rrwlock inode r = 0 (0xfffffd806f7bf2b8) #0 witness_lock+0x52e sys/kern/subr_witness.c:1161 #1 rw_enter+0x46d sys/kern/kern_rwlock.c:306 #2 rrw_enter+0x4f sys/kern/kern_rwlock.c:435 #3 ufs_ihashins+0x45 sys/ufs/ufs/ufs_ihash.c:140 #4 ffs_vget+0x133 sys/ufs/ffs/ffs_vfsops.c:1352 #5 ffs_inode_alloc+0x1cf sys/ufs/ffs/ffs_alloc.c:392 #6 ufs_mkdir+0xf4 sys/ufs/ufs/ufs_vnops.c:1164 #7 VOP_MKDIR+0x6a sys/kern/vfs_vops.c:449 #8 domkdirat+0x121 sys/kern/vfs_syscalls.c:2974 #9 syscall+0x552 mi_syscall sys/sys/syscall_mi.h:99 [inline] #9 syscall+0x552 sys/arch/amd64/amd64/trap.c:574 #10 Xsyscall+0x128 exclusive rrwlock inode r = 0 (0xfffffd806caf94e8) #0 witness_lock+0x52e sys/kern/subr_witness.c:1161 #1 rw_enter+0x46d sys/kern/kern_rwlock.c:306 #2 rrw_enter+0x4f sys/kern/kern_rwlock.c:435 #3 VOP_LOCK+0x4b sys/kern/vfs_vops.c:602 #4 vn_lock+0x6e sys/kern/vfs_vnops.c:549 #5 vfs_lookup+0xe9 sys/kern/vfs_lookup.c:422 #6 namei+0x61c sys/kern/vfs_lookup.c:252 #7 domkdirat+0x75 sys/kern/vfs_syscalls.c:2959 #8 syscall+0x552 mi_syscall sys/sys/syscall_mi.h:99 [inline] #8 syscall+0x552 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 9516 6431K 7198K 78643K 14198 0 0 pcb 25 9K 11K 78643K 801 0 0 rtable 128 4K 5K 78643K 565 0 0 ifaddr 56 13K 14K 78643K 188 0 0 counters 39 33K 33K 78643K 39 0 0 ioctlops 0 0K 4K 78643K 1552 0 0 iov 0 0K 24K 78643K 181 0 0 mount 1 1K 1K 78643K 1 0 0 vnodes 1202 76K 76K 78643K 2643 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 22 0 0 VM map 2 1K 1K 78643K 2 0 0 sem 12 0K 0K 78643K 146 0 0 dirhash 12 2K 2K 78643K 12 0 0 ACPI 1808 196K 290K 78643K 12628 0 0 file desc 4 9K 25K 78643K 1779 0 0 sigio 0 0K 0K 78643K 21 0 0 proc 53 50K 83K 78643K 633 0 0 subproc 32 2K 2K 78643K 72 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 152 0 0 in_multi 33 2K 2K 78643K 94 0 0 ether_multi 1 0K 0K 78643K 5 0 0 mrt 0 0K 0K 78643K 5 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 355 0 0 pfkey data 0 0K 4K 78643K 3 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 90 21K 30K 78643K 6748 0 0 UVM aobj 68 3K 3K 78643K 73 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 63 0 0 NDP 11 0K 0K 78643K 51 0 0 temp 167 2735K 2807K 78643K 8640 0 0 kqueue 0 0K 0K 78643K 25 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 4 1 0 1 1 0 8 0 inpcbpl 280 736 0 729 1 0 1 1 0 8 0 plimitpl 152 63 0 55 1 0 1 1 0 8 0 plcache 128 20 0 0 1 0 1 1 0 8 0 rtentry 112 78 0 26 2 0 2 2 0 8 0 syncache 264 4 0 4 1 1 0 1 0 8 0 tcpcb 544 260 0 256 1 0 1 1 0 8 0 rttmr 72 1 0 1 1 1 0 1 0 8 0 nd6 48 12 0 6 1 0 1 1 0 8 0 ppxss 1128 28 0 28 8 8 0 1 0 8 0 pfosfp 40 846 0 423 5 0 5 5 0 8 0 pfosfpen 112 1428 0 714 21 0 21 21 0 8 0 pfstitem 24 27 0 18 1 0 1 1 0 8 0 pfstkey 112 27 0 18 1 0 1 1 0 8 0 pfstate 328 27 0 18 1 0 1 1 0 8 0 pfrule 1360 21 0 16 2 1 1 2 0 8 0 art_heap8 4096 1 0 0 1 0 1 1 0 8 0 art_heap4 256 281 0 92 13 1 12 12 0 8 0 art_table 32 282 0 92 2 0 2 2 0 8 0 art_node 16 75 0 35 1 0 1 1 0 8 0 sysvmsgpl 40 21 0 6 1 0 1 1 0 8 0 semupl 112 1 0 1 1 1 0 1 0 8 0 semapl 112 144 0 134 1 0 1 1 0 8 0 shmpl 112 71 0 5 2 0 2 2 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino1pl 128 4222 0 2794 49 2 47 47 0 8 0 ffsino 272 4222 0 2794 96 0 96 96 0 8 0 nchpl 144 6872 0 5241 62 1 61 62 0 8 0 uvmvnodes 72 5170 0 0 94 0 94 94 0 8 0 vnodes 200 5170 0 0 273 0 273 273 0 8 0 namei 1024 20617 0 20616 4 3 1 1 0 8 0 percpumem 16 30 0 0 1 0 1 1 0 8 0 scsiplug 64 2 0 2 2 2 0 1 0 8 0 scxspl 192 20639 0 20638 16 13 3 6 0 8 2 sigapl 432 1974 0 1959 4 2 2 3 0 8 0 futexpl 56 22937 0 22937 2 1 1 1 0 8 1 knotepl 112 384 0 365 2 1 1 2 0 8 0 kqueuepl 104 361 0 359 1 0 1 1 0 8 0 pipepl 112 1172 0 1153 4 3 1 2 0 8 0 fdescpl 488 1975 0 1960 5 2 3 3 0 8 0 filepl 152 11110 0 11011 8 3 5 6 0 8 1 lockfpl 104 630 0 630 4 3 1 1 0 8 1 lockfspl 48 220 0 220 4 3 1 1 0 8 1 sessionpl 112 21 0 10 1 0 1 1 0 8 0 pgrppl 48 30 0 19 1 0 1 1 0 8 0 ucredpl 96 2157 0 2148 1 0 1 1 0 8 0 zombiepl 144 1960 0 1959 3 2 1 1 0 8 0 processpl 888 1991 0 1959 4 0 4 4 0 8 0 procpl 600 5825 0 5784 6 2 4 5 0 8 0 srpgc 64 13 0 13 3 3 0 1 0 8 0 sosppl 128 5 0 5 3 3 0 1 0 8 0 sockpl 384 1428 0 1409 8 5 3 4 0 8 1 mcl64k 65536 12 0 0 2 0 2 2 0 8 0 mcl16k 16384 3 0 0 1 0 1 1 0 8 0 mcl12k 12288 12 0 0 2 0 2 2 0 8 0 mcl9k 9216 6 0 0 1 0 1 1 0 8 0 mcl8k 8192 12 0 0 2 0 2 2 0 8 0 mcl4k 4096 13 0 0 2 0 2 2 0 8 0 mcl2k2 2112 7 0 0 1 0 1 1 0 8 0 mcl2k 2048 124 0 0 15 0 15 15 0 8 0 mtagpl 80 3 0 0 1 0 1 1 0 8 0 mbufpl 256 212 0 0 9 0 9 9 0 8 0 bufpl 256 9768 0 2760 439 0 439 439 0 8 0 anonpl 16 175067 0 164768 98 48 50 59 0 125 6 amapchunkpl 152 11376 0 11262 19 9 10 10 0 158 3 amappl16 192 8260 0 7715 56 27 29 40 0 8 1 amappl15 184 808 0 806 1 0 1 1 0 8 0 amappl14 176 854 0 850 2 1 1 1 0 8 0 amappl13 168 71 0 71 1 1 0 1 0 8 0 amappl12 160 791 0 789 1 0 1 1 0 8 0 amappl11 152 72 0 52 2 1 1 2 0 8 0 amappl10 144 79 0 77 1 0 1 1 0 8 0 amappl9 136 687 0 684 1 0 1 1 0 8 0 amappl8 128 264 0 245 1 0 1 1 0 8 0 amappl7 120 42 0 37 1 0 1 1 0 8 0 amappl6 112 58 0 51 1 0 1 1 0 8 0 amappl5 104 923 0 908 1 0 1 1 0 8 0 amappl4 96 1383 0 1354 2 1 1 2 0 8 0 amappl3 88 1022 0 1010 1 0 1 1 0 8 0 amappl2 80 15853 0 15781 3 1 2 3 0 8 0 amappl1 72 52302 0 51870 25 15 10 19 0 8 0 amappl 80 6133 0 6094 1 0 1 1 0 84 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 72 0 5 2 0 2 2 0 8 0 uaddrrnd 24 1975 0 1959 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 1975 0 1959 1 0 1 1 0 8 0 vmmpekpl 168 20400 0 20370 2 0 2 2 0 8 0 vmmpepl 168 212373 0 210788 135 60 75 90 0 357 1 vmsppl 360 1974 0 1959 2 0 2 2 0 8 0 pdppl 4096 3958 0 3918 8 2 6 6 0 8 0 pvpl 32 514730 0 501188 221 91 130 147 0 265 16 pmappl 232 1974 0 1959 3 2 1 2 0 8 0 extentpl 40 41 0 26 1 0 1 1 0 8 0 phpool 112 600 0 9 17 0 17 17 0 8 0