witness: lock order reversal: 1st 0xfffffd807f7d6438 fdlock (&newfdp->fd_fd.fd_lock) 2nd 0xfffffd80633cf1b0 inode (&ip->i_lock) lock order data w2 -> w1 missing lock order data w1 -> w2 missing 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(fffffd80633cf1b0,9,0) at witness_checkorder+0x10f3 witness_debugger sys/kern/subr_witness.c:2502 [inline] witness_checkorder(fffffd80633cf1b0,9,0) at witness_checkorder+0x10f3 sys/kern/subr_witness.c:1105 rw_enter(fffffd80633cf1a0,81) at rw_enter+0xd1 sys/kern/kern_rwlock.c:250 rrw_enter(fffffd80633cf1a0,81) at rrw_enter+0x8b sys/kern/kern_rwlock.c:461 VOP_LOCK(fffffd805f855428,81) at VOP_LOCK+0x87 sys/kern/vfs_vops.c:614 vn_lock(fffffd805f855428,81) at vn_lock+0x84 sys/kern/vfs_vnops.c:579 uvn_get(fffffd8062e928d0,0,ffff80002229bd58,ffff80002229bd28,0,0) at uvn_get+0x256 uvm_vnode_lock sys/uvm/uvm_vnode.c:1499 [inline] uvn_get(fffffd8062e928d0,0,ffff80002229bd58,ffff80002229bd28,0,0) at uvn_get+0x256 sys/uvm/uvm_vnode.c:993 uvm_fault_lower(ffff80002229bec0,ffff80002229bef8,ffff80002229be40,0) at uvm_fault_lower+0x302 sys/uvm/uvm_fault.c:1251 uvm_fault(fffffd806ed38a18,20000000,0,2) at uvm_fault+0x240 sys/uvm/uvm_fault.c:638 kpageflttrap(ffff80002229c050,200000c0) at kpageflttrap+0x1fd sys/arch/amd64/amd64/trap.c:264 kerntrap(ffff80002229c050) at kerntrap+0xef sys/arch/amd64/amd64/trap.c:318 alltraps_kern_meltdown() at alltraps_kern_meltdown+0x7b copyout() at copyout+0x53 syscall(ffff80002229c290) at syscall+0x5a9 mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff80002229c290) at syscall+0x5a9 sys/arch/amd64/amd64/trap.c:587 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0xd2247b739a0, count: -15 ddb{1}> show registers rdi 0xffff80002349d000 rsi 0x145f9 acpi_pdirpa+0x461 rbp 0xffff80002229b9d0 rbx 0x3 rdx 0xffff80002349d000 rcx 0x145f8 acpi_pdirpa+0x460 rax 0xffffffff812592f7 db_enter+0x17 r8 0xffffffff818d823c witness_checkorder+0x10cc r9 0x5 r10 0x8a8dd6c50afe9dcb r11 0x8132a0bc86ea0946 r12 0xfffffd8002da97c0 r13 0 r14 0 r15 0 rip 0xffffffff812592f8 db_enter+0x18 cs 0x8 rflags 0x246 rsp 0xffff80002229b9c0 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb{1}> show proc PROC (syz-executor.1) pid=45696 stat=onproc flags process=0 proc=4000000 pri=32, usrpri=74, nice=20 forw=0xffffffffffffffff, list=0xffff80002288a7e8,0xffffffff8296f688 process=0xffff8000ffffa5b8 user=0xffff800022297000, vmspace=0xfffffd806ed38a18 estcpu=36, cpticks=0, pctcpu=0.0 user=0, sys=0, intr=0 ddb{1}> ps PID TID PPID UID S FLAGS WAIT COMMAND 42335 460333 20342 0 2 0 syz-executor.1 *42335 45696 20342 0 7 0x4000000 syz-executor.1 66166 493751 12721 0 7 0 syz-executor.0 66166 310286 12721 0 3 0x4000080 fsleep syz-executor.0 99478 324422 0 0 3 0x14200 acct acct 20342 228537 40692 0 3 0x82 nanoslp syz-executor.1 12721 108507 40692 0 3 0x82 nanoslp syz-executor.0 40692 101544 94546 0 3 0x82 thrsleep syz-fuzzer 40692 139051 94546 0 3 0x4000082 thrsleep syz-fuzzer 40692 430535 94546 0 3 0x4000082 thrsleep syz-fuzzer 40692 214585 94546 0 3 0x4000082 kqread syz-fuzzer 40692 214583 94546 0 3 0x4000082 thrsleep syz-fuzzer 40692 63371 94546 0 3 0x4000082 thrsleep syz-fuzzer 40692 421906 94546 0 3 0x4000082 thrsleep syz-fuzzer 40692 151097 94546 0 3 0x4000082 thrsleep syz-fuzzer 94546 172733 17715 0 3 0x10008a sigsusp ksh 17715 328553 37940 0 3 0x9a select sshd 15406 455605 1 0 3 0x100083 ttyin getty 37940 275519 1 0 3 0x88 select sshd 94296 36742 46554 74 3 0x100092 bpf pflogd 46554 102002 1 0 3 0x80 netio pflogd 53869 423025 67433 73 3 0x100090 kqread syslogd 67433 82422 1 0 3 0x100082 netio syslogd 54868 316972 1 0 3 0x100080 kqread resolvd 64961 519320 30901 77 3 0x100092 kqread dhcpleased 19146 397614 30901 77 3 0x100092 kqread dhcpleased 30901 295791 1 0 3 0x80 kqread dhcpleased 35338 226030 0 0 3 0x14200 bored smr 77738 255048 0 0 2 0x14200 zerothread 25496 490382 0 0 3 0x14200 aiodoned aiodoned 59580 350526 0 0 3 0x14200 syncer update 50768 347356 0 0 3 0x14200 cleaner cleaner 89894 143680 0 0 3 0x14200 reaper reaper 31261 51209 0 0 3 0x14200 pgdaemon pagedaemon 68719 257376 0 0 3 0x14200 bored crynlk 3310 125054 0 0 3 0x14200 bored crypto 7652 501687 0 0 3 0x14200 bored viomb 94476 210210 0 0 3 0x40014200 acpi0 acpi0 42286 263486 0 0 3 0x40014200 idle1 22409 21379 0 0 3 0x14200 bored softnet 35680 502570 0 0 3 0x14200 bored systqmp 40548 381698 0 0 3 0x14200 bored systq 65186 469985 0 0 3 0x40014200 bored softclock 80563 21708 0 0 3 0x40014200 idle0 1 305403 0 0 3 0x82 wait init 0 0 -1 0 3 0x10200 scheduler swapper ddb{1}> show all locks Process 42335 (syz-executor.1) thread 0xffff80002288afc8 (45696) exclusive kernel_lock &kernel_lock r = 0 (0xffffffff8299c698) #0 witness_lock+0x4b0 stacktrace_save sys/sys/stacktrace.h:36 [inline] #0 witness_lock+0x4b0 sys/kern/subr_witness.c:1182 #1 uvm_fault+0x224 sys/uvm/uvm_fault.c:637 #2 kpageflttrap+0x1fd sys/arch/amd64/amd64/trap.c:264 #3 kerntrap+0xef sys/arch/amd64/amd64/trap.c:318 #4 alltraps_kern_meltdown+0x7b #5 copyout+0x53 #6 syscall+0x5a9 mi_syscall sys/sys/syscall_mi.h:102 [inline] #6 syscall+0x5a9 sys/arch/amd64/amd64/trap.c:587 #7 Xsyscall+0x128 exclusive rwlock fdlock r = 0 (0xfffffd807f7d6438) #0 witness_lock+0x4b0 stacktrace_save sys/sys/stacktrace.h:36 [inline] #0 witness_lock+0x4b0 sys/kern/subr_witness.c:1182 #1 dopipe+0xd6 #2 syscall+0x5a9 mi_syscall sys/sys/syscall_mi.h:102 [inline] #2 syscall+0x5a9 sys/arch/amd64/amd64/trap.c:587 #3 Xsyscall+0x128 Process 66166 (syz-executor.0) thread 0xffff80002288ad28 (493751) shared rwlock vmmaplk r = 0 (0xfffffd806ed38ba0) #0 witness_lock+0x4b0 stacktrace_save sys/sys/stacktrace.h:36 [inline] #0 witness_lock+0x4b0 sys/kern/subr_witness.c:1182 #1 uvmfault_lookup+0xd9 sys/uvm/uvm_fault.c:1701 #2 uvm_fault_check+0x3a sys/uvm/uvm_fault.c:674 #3 uvm_fault+0x102 sys/uvm/uvm_fault.c:601 #4 upageflttrap+0x82 sys/arch/amd64/amd64/trap.c:181 #5 usertrap+0x214 sys/arch/amd64/amd64/trap.c:403 #6 recall_trap+0x8 ddb{1}> show malloc Type InUse MemUse HighUse Limit Requests Type Lim devbuf 10121 6428K 6436K 78643K 11223 0 pcb 13 8K 8K 78643K 15 0 rtable 106 3K 3K 78643K 172 0 ifaddr 44 10K 10K 78643K 45 0 counters 44 34K 34K 78643K 44 0 ioctlops 0 0K 4K 78643K 1481 0 mount 1 1K 1K 78643K 1 0 log 0 0K 0K 78643K 6 0 vnodes 1219 77K 77K 78643K 1227 0 UFS quota 1 32K 32K 78643K 1 0 UFS mount 5 36K 36K 78643K 5 0 shm 2 1K 5K 78643K 3 0 VM map 2 1K 1K 78643K 2 0 sem 12 0K 0K 78643K 583 0 dirhash 12 2K 2K 78643K 12 0 ACPI 1697 195K 286K 78643K 12598 0 file desc 6 17K 25K 78643K 475 0 proc 68 87K 111K 78643K 335 0 subproc 32 2K 2K 78643K 34 0 NFS srvsock 1 0K 0K 78643K 1 0 NFS daemon 1 16K 16K 78643K 1 0 in_multi 33 2K 2K 78643K 33 0 ether_multi 1 0K 0K 78643K 1 0 ISOFS mount 1 32K 32K 78643K 1 0 MSDOSFS mount 1 16K 16K 78643K 1 0 ttys 31 148K 148K 78643K 31 0 exec 0 0K 2K 78643K 410 0 pagedep 1 8K 8K 78643K 1 0 inodedep 1 32K 32K 78643K 1 0 newblk 1 0K 0K 78643K 1 0 VM swap 7 26K 26K 78643K 7 0 UVM amap 336 37K 37K 78643K 7703 0 UVM aobj 3 2K 2K 78643K 3 0 memdesc 1 4K 4K 78643K 1 0 crypto data 1 1K 1K 78643K 1 0 NDP 6 0K 0K 78643K 10 0 temp 66 4195K 4259K 78643K 3229 0 kqueue 10 14K 19K 78643K 16 0 SYN cache 2 16K 16K 78643K 2 0 ddb{1}> show all pools Name Size Requests Fail Releases Pgreq Pgrel Npage Hiwat Minpg Maxpg Idle plcache 128 22 0 0 1 0 1 1 0 8 0 rtpcb 120 21 0 18 1 0 1 1 0 8 0 rtentry 112 45 0 1 2 0 2 2 0 8 0 unpcb 120 143 0 126 1 0 1 1 0 8 0 syncache 296 4 0 4 1 1 0 1 0 8 0 tcpqe 32 56 0 56 1 1 0 1 0 8 0 tcpcb 736 11 0 7 1 0 1 1 0 8 0 arp 120 6 0 0 1 0 1 1 0 8 0 inpcb 304 45 0 38 1 0 1 1 0 8 0 nd6 48 6 0 0 1 0 1 1 0 8 0 kcovpl 48 2 0 0 1 0 1 1 0 8 0 pfosfp 40 1428 0 1005 5 0 5 5 0 8 0 pfosfpen 112 1428 0 714 21 0 21 21 0 8 0 pfstitem 24 11 0 3 1 0 1 1 0 8 0 pfstkey 112 11 0 3 1 0 1 1 0 8 0 pfstate 320 11 0 3 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 188 0 0 12 0 12 12 0 8 0 art_table 32 189 0 0 2 0 2 2 0 8 0 art_node 16 44 0 4 1 0 1 1 0 8 0 semupl 112 4 0 4 1 1 0 1 0 8 0 semapl 112 581 0 571 1 0 1 1 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino2pl 256 1888 0 475 89 0 89 89 0 8 0 ffsino 272 1888 0 475 95 0 95 95 0 8 0 nchpl 144 2565 0 944 61 0 61 61 0 8 0 uvmvnodes 72 1936 0 0 36 0 36 36 0 8 0 vnodes 224 1936 0 0 114 0 114 114 0 8 0 namei 1024 6542 0 6542 2 1 1 1 0 8 1 percpumem 16 34 0 0 1 0 1 1 0 8 0 scxspl 216 7629 0 7629 9 7 2 8 0 8 2 plimitpl 152 17 0 8 1 0 1 1 0 8 0 sigapl 424 725 0 689 5 0 5 5 0 8 0 futexpl 56 3698 0 3697 1 0 1 1 0 8 0 knotepl 112 46 0 0 2 0 2 2 0 8 0 kqueuepl 216 507 0 498 1 0 1 1 0 8 0 pipepl 336 89 0 77 2 0 2 2 0 8 1 fdescpl 496 708 0 689 3 0 3 3 0 8 0 filepl 152 2380 0 2257 6 0 6 6 0 8 1 lockfpl 104 17 0 15 1 0 1 1 0 8 0 lockfspl 48 8 0 6 1 0 1 1 0 8 0 sessionpl 144 18 0 7 1 0 1 1 0 8 0 pgrppl 48 18 0 7 1 0 1 1 0 8 0 ucredpl 96 80 0 68 1 0 1 1 0 8 0 zombiepl 144 689 0 689 2 1 1 1 0 8 1 processpl 1072 725 0 689 3 0 3 3 0 8 0 procpl 672 1253 0 1208 5 0 5 5 0 8 0 sockpl 480 209 0 182 5 0 5 5 0 8 1 mcl12k 12288 2 0 0 1 0 1 1 0 8 0 mcl8k 8192 6 0 0 1 0 1 1 0 8 0 mcl4k 4096 4 0 0 1 0 1 1 0 8 0 mcl2k 2048 205 0 0 25 0 25 25 0 8 0 mtagpl 96 3 0 0 1 0 1 1 0 8 0 mbufpl 256 252 0 0 16 0 16 16 0 8 0 bufpl 280 3878 0 136 268 0 268 268 0 8 0 anonpl 24 185164 0 146311 237 2 235 235 0 186 0 amapchunkpl 152 17700 0 16233 61 2 59 59 0 158 0 amappl16 200 2062 0 958 59 0 59 59 0 8 0 amappl15 192 1 0 0 1 0 1 1 0 8 0 amappl14 184 6 0 3 1 0 1 1 0 8 0 amappl13 176 243 0 241 1 0 1 1 0 8 0 amappl12 168 19 0 16 1 0 1 1 0 8 0 amappl11 160 44 0 30 1 0 1 1 0 8 0 amappl10 152 41 0 33 1 0 1 1 0 8 0 amappl9 144 475 0 471 1 0 1 1 0 8 0 amappl8 136 374 0 334 2 0 2 2 0 8 0 amappl7 128 73 0 58 1 0 1 1 0 8 0 amappl6 120 356 0 345 1 0 1 1 0 8 0 amappl5 112 595 0 576 1 0 1 1 0 8 0 amappl4 104 564 0 540 1 0 1 1 0 8 0 amappl3 96 53 0 47 1 0 1 1 0 8 0 amappl2 88 688 0 634 2 0 2 2 0 8 0 amappl1 80 15351 0 14884 15 5 10 13 0 8 0 amappl 88 7108 0 6836 7 0 7 7 0 92 0 dma4096 4096 1 0 1 1 1 0 1 0 8 0 dma1024 1024 1 0 0 1 0 1 1 0 8 0 dma256 256 6 0 6 1 1 0 1 0 8 0 dma128 128 253 0 253 1 1 0 1 0 8 0 dma64 64 6 0 6 1 1 0 1 0 8 0 dma32 32 7 0 7 1 1 0 1 0 8 0 dma16 16 18 0 17 1 0 1 1 0 8 0 aobjpl 64 2 0 0 1 0 1 1 0 8 0 uaddrrnd 24 708 0 689 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 708 0 689 1 0 1 1 0 8 0 vmmpekpl 168 8563 0 8536 2 0 2 2 0 8 0 vmmpepl 168 79391 0 76739 158 5 153 158 0 357 37 vmsppl 368 707 0 689 2 0 2 2 0 8 0 rwobjpl 56 17346 0 15357 30 1 29 29 0 8 0 pdppl 4096 1424 0 1378 69 23 46 50 0 8 0 pvpl 32 456905 0 414310 345 1 344 344 0 265 0 pmappl 224 707 0 689 2 0 2 2 0 8 0 extentpl 40 58 0 40 1 0 1 1 0 8 0 phpool 112 324 0 27 9 0 9 9 0 8 0 ddb{1}> machine ddbcpu 0 Stopped at x86_ipi_db+0x1a: addq $0x8,%rsp ddb{0}> trace x86_ipi_db(ffffffff82817ff0) at x86_ipi_db+0x1a sys/arch/amd64/amd64/db_interface.c:353 x86_ipi_handler() at x86_ipi_handler+0xb7 sys/arch/amd64/amd64/ipi.c:106 Xresume_lapic_ipi() at Xresume_lapic_ipi+0x23 __sanitizer_cov_trace_pc() at __sanitizer_cov_trace_pc+0x25 kd_curproc sys/dev/kcov.c:559 [inline] __sanitizer_cov_trace_pc() at __sanitizer_cov_trace_pc+0x25 sys/dev/kcov.c:143 __mp_lock(ffffffff8299c490) at __mp_lock+0x133 __mp_lock_spin sys/kern/kern_lock.c:116 [inline] __mp_lock(ffffffff8299c490) at __mp_lock+0x133 sys/kern/kern_lock.c:147 softintr_dispatch(0) at softintr_dispatch+0x4e sys/arch/amd64/amd64/softintr.c:90 Xsoftclock() at Xsoftclock+0x1f __mp_lock(ffffffff8299c490) at __mp_lock+0x122 __mp_lock_spin sys/kern/kern_lock.c:116 [inline] __mp_lock(ffffffff8299c490) at __mp_lock+0x122 sys/kern/kern_lock.c:147 uvm_fault(fffffd806ed38b88,e854b1ef000,0,1) at uvm_fault+0x192 sys/uvm/uvm_fault.c:623 upageflttrap(ffff80002349cb10,e854b1ef000) at upageflttrap+0x82 sys/arch/amd64/amd64/trap.c:181 usertrap(ffff80002349cb10) at usertrap+0x214 sys/arch/amd64/amd64/trap.c:403 recall_trap() at recall_trap+0x8 end of kernel end trace frame: 0x7f7ffffccf20, count: -12 ddb{0}> machine ddbcpu 1 Stopped at db_enter+0x18: addq $0x8,%rsp ddb{1}> trace db_enter() at db_enter+0x18 sys/arch/amd64/amd64/db_interface.c:399 witness_checkorder(fffffd80633cf1b0,9,0) at witness_checkorder+0x10f3 witness_debugger sys/kern/subr_witness.c:2502 [inline] witness_checkorder(fffffd80633cf1b0,9,0) at witness_checkorder+0x10f3 sys/kern/subr_witness.c:1105 rw_enter(fffffd80633cf1a0,81) at rw_enter+0xd1 sys/kern/kern_rwlock.c:250 rrw_enter(fffffd80633cf1a0,81) at rrw_enter+0x8b sys/kern/kern_rwlock.c:461 VOP_LOCK(fffffd805f855428,81) at VOP_LOCK+0x87 sys/kern/vfs_vops.c:614 vn_lock(fffffd805f855428,81) at vn_lock+0x84 sys/kern/vfs_vnops.c:579 uvn_get(fffffd8062e928d0,0,ffff80002229bd58,ffff80002229bd28,0,0) at uvn_get+0x256 uvm_vnode_lock sys/uvm/uvm_vnode.c:1499 [inline] uvn_get(fffffd8062e928d0,0,ffff80002229bd58,ffff80002229bd28,0,0) at uvn_get+0x256 sys/uvm/uvm_vnode.c:993 uvm_fault_lower(ffff80002229bec0,ffff80002229bef8,ffff80002229be40,0) at uvm_fault_lower+0x302 sys/uvm/uvm_fault.c:1251 uvm_fault(fffffd806ed38a18,20000000,0,2) at uvm_fault+0x240 sys/uvm/uvm_fault.c:638 kpageflttrap(ffff80002229c050,200000c0) at kpageflttrap+0x1fd sys/arch/amd64/amd64/trap.c:264 kerntrap(ffff80002229c050) at kerntrap+0xef sys/arch/amd64/amd64/trap.c:318 alltraps_kern_meltdown() at alltraps_kern_meltdown+0x7b copyout() at copyout+0x53 syscall(ffff80002229c290) at syscall+0x5a9 mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff80002229c290) at syscall+0x5a9 sys/arch/amd64/amd64/trap.c:587 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0xd2247b739a0, count: -15