witness: lock order reversal: 1st 0xfffffd806f59dc00 fdlock (&newfdp->fd_fd.fd_lock) 2nd 0xfffffd807e57ef80 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:440 witness_checkorder(fffffd807e57ef80,9,0) at witness_checkorder+0x10f3 witness_debugger sys/kern/subr_witness.c:2502 [inline] witness_checkorder(fffffd807e57ef80,9,0) at witness_checkorder+0x10f3 sys/kern/subr_witness.c:1105 rw_enter(fffffd807e57ef70,81) at rw_enter+0xd1 sys/kern/kern_rwlock.c:250 rrw_enter(fffffd807e57ef70,81) at rrw_enter+0x8b sys/kern/kern_rwlock.c:461 VOP_LOCK(fffffd80659b0158,81) at VOP_LOCK+0x87 sys/kern/vfs_vops.c:534 vn_lock(fffffd80659b0158,81) at vn_lock+0x84 sys/kern/vfs_vnops.c:579 uvn_get(fffffd8069d13e70,0,ffff80002128d468,ffff80002128d438,0,0,3f739ff388b21cbd,ffffffff81f92ee0) at uvn_get+0x256 uvm_vnode_lock sys/uvm/uvm_vnode.c:1499 [inline] uvn_get(fffffd8069d13e70,0,ffff80002128d468,ffff80002128d438,0,0,3f739ff388b21cbd,ffffffff81f92ee0) at uvn_get+0x256 sys/uvm/uvm_vnode.c:993 uvm_fault_lower(ffff80002128d5d0,ffff80002128d608,ffff80002128d550,0) at uvm_fault_lower+0x302 sys/uvm/uvm_fault.c:1251 uvm_fault(fffffd8067ec4460,20001000,0,2) at uvm_fault+0x240 sys/uvm/uvm_fault.c:638 kpageflttrap(ffff80002128d760,20001280) at kpageflttrap+0x1fd sys/arch/amd64/amd64/trap.c:264 kerntrap(ffff80002128d760) at kerntrap+0xef sys/arch/amd64/amd64/trap.c:318 alltraps_kern_meltdown() at alltraps_kern_meltdown+0x7b copyout() at copyout+0x53 syscall(ffff80002128d9a0) at syscall+0x5a9 mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff80002128d9a0) at syscall+0x5a9 sys/arch/amd64/amd64/trap.c:587 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x49e9d4833a0, count: -15 ddb{1}> show registers rdi 0xffff8000212a0000 rsi 0x73b8 __ALIGN_SIZE+0x63b8 rbp 0xffff80002128d0e0 rbx 0x3 rdx 0xffff8000212a0000 rcx 0x73b7 __ALIGN_SIZE+0x63b7 rax 0xffffffff81f63197 db_enter+0x17 r8 0xffffffff8135078c witness_checkorder+0x10cc r9 0x5 r10 0xf1d4f52a7bc488e3 r11 0xc191ea18c991e29f r12 0xfffffd8002dc4900 r13 0 r14 0 r15 0 rip 0xffffffff81f63198 db_enter+0x18 cs 0x8 rflags 0x246 rsp 0xffff80002128d0d0 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb{1}> show proc PROC (syz-executor.0) pid=218698 stat=onproc flags process=0 proc=4000000 pri=32, usrpri=77, nice=20 forw=0xffffffffffffffff, list=0xffff800021266540,0xffff800021267510 process=0xffff8000ffffa5b8 user=0xffff800021288000, vmspace=0xfffffd8067ec4460 estcpu=36, cpticks=0, pctcpu=0.0 user=0, sys=0, intr=0 ddb{1}> ps PID TID PPID UID S FLAGS WAIT COMMAND 90167 426547 62775 0 7 0 syz-executor.0 *90167 218698 62775 0 7 0x4000000 syz-executor.0 90167 441008 62775 0 3 0x4000080 fsleep syz-executor.0 90167 175685 62775 0 3 0x4000080 fsleep syz-executor.0 90167 466957 62775 0 3 0x4000080 fsleep syz-executor.0 54285 416150 10944 0 3 0x82 nanoslp syz-executor.1 62775 520687 10944 0 3 0x82 nanoslp syz-executor.0 15811 98953 0 0 3 0x14200 bored sosplice 10944 155420 99856 0 3 0x82 thrsleep syz-fuzzer 10944 472250 99856 0 3 0x4000082 thrsleep syz-fuzzer 10944 34978 99856 0 3 0x4000082 thrsleep syz-fuzzer 10944 339601 99856 0 3 0x4000082 kqread syz-fuzzer 10944 140228 99856 0 3 0x4000082 thrsleep syz-fuzzer 10944 175799 99856 0 3 0x4000082 thrsleep syz-fuzzer 10944 517112 99856 0 3 0x4000082 thrsleep syz-fuzzer 10944 519574 99856 0 3 0x4000082 thrsleep syz-fuzzer 99856 116323 30254 0 3 0x10008a sigsusp ksh 30254 364508 69954 0 3 0x9a select sshd 64514 197572 1 0 3 0x100083 ttyin getty 69954 464432 1 0 3 0x88 select sshd 84896 62662 10466 74 3 0x100092 bpf pflogd 10466 404665 1 0 3 0x80 netio pflogd 61262 124047 81811 73 3 0x100090 kqread syslogd 81811 223847 1 0 3 0x100082 netio syslogd 86689 20673 1 0 3 0x100080 kqread resolvd 97032 247069 71059 77 3 0x100092 kqread dhcpleased 35359 9155 71059 77 3 0x100092 kqread dhcpleased 71059 514541 1 0 3 0x80 kqread dhcpleased 43354 282326 0 0 3 0x14200 bored smr 28666 199836 0 0 3 0x14200 pgzero zerothread 29135 507124 0 0 3 0x14200 aiodoned aiodoned 64116 50033 0 0 3 0x14200 syncer update 88171 501877 0 0 3 0x14200 cleaner cleaner 35749 96696 0 0 3 0x14200 reaper reaper 34814 393107 0 0 3 0x14200 pgdaemon pagedaemon 4835 95593 0 0 3 0x14200 bored crynlk 69842 5333 0 0 3 0x14200 bored crypto 73976 175675 0 0 3 0x14200 bored viomb 46273 291897 0 0 3 0x40014200 acpi0 acpi0 10744 464213 0 0 3 0x40014200 idle1 78695 78797 0 0 3 0x14200 bored softnet 12650 314060 0 0 3 0x14200 bored systqmp 98943 145141 0 0 3 0x14200 bored systq 34377 385987 0 0 3 0x40014200 bored softclock 99634 397154 0 0 3 0x40014200 idle0 1 62589 0 0 3 0x82 wait init 0 0 -1 0 3 0x10200 scheduler swapper ddb{1}> show all locks Process 90167 (syz-executor.0) thread 0xffff800021266a80 (218698) exclusive kernel_lock &kernel_lock r = 0 (0xffffffff829486f0) #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 (0xfffffd806f59dc00) #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 ddb{1}> show malloc Type InUse MemUse HighUse Limit Requests Type Lim devbuf 10138 6482K 6932K 78643K 12811 0 pcb 13 8K 8K 78643K 135 0 rtable 114 5K 5K 78643K 373 0 ifaddr 54 12K 12K 78643K 120 0 counters 44 34K 34K 78643K 66 0 ioctlops 0 0K 4K 78643K 1624 0 iov 0 0K 16K 78643K 74 0 mount 1 1K 1K 78643K 1 0 log 0 0K 0K 78643K 5 0 vnodes 1219 77K 77K 78643K 1781 0 UFS quota 1 32K 32K 78643K 1 0 UFS mount 5 36K 36K 78643K 5 0 shm 2 1K 5K 78643K 9 0 VM map 2 1K 1K 78643K 2 0 sem 11 1K 1K 78643K 11 0 dirhash 12 2K 2K 78643K 12 0 ACPI 1697 195K 286K 78643K 12598 0 file desc 5 13K 25K 78643K 2186 0 sigio 0 0K 0K 78643K 21 0 proc 70 87K 111K 78643K 527 0 subproc 32 2K 2K 78643K 68 0 NFS srvsock 1 0K 0K 78643K 1 0 NFS daemon 1 16K 16K 78643K 1 0 ip_moptions 0 0K 0K 78643K 250 0 in_multi 33 2K 2K 78643K 255 0 ether_multi 1 0K 0K 78643K 79 0 mrt 0 0K 0K 78643K 38 0 ISOFS mount 1 32K 32K 78643K 1 0 MSDOSFS mount 1 16K 16K 78643K 1 0 ttys 49 228K 228K 78643K 49 0 exec 0 0K 2K 78643K 484 0 pfkey data 0 0K 1K 78643K 5 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 216 97K 97K 78643K 27984 0 UVM aobj 22 2K 2K 78643K 22 0 memdesc 1 4K 4K 78643K 1 0 crypto data 1 1K 1K 78643K 1 0 ip6_options 0 0K 0K 78643K 55 0 NDP 8 0K 0K 78643K 31 0 temp 116 4216K 4295K 78643K 9359 0 kqueue 10 14K 20K 78643K 151 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 66 0 63 1 0 1 1 0 8 0 rtentry 112 79 0 35 2 0 2 2 0 8 0 unpcb 120 460 0 445 1 0 1 1 0 8 0 syncache 296 44 0 44 3 3 0 1 0 8 0 tcpqe 32 33 0 33 2 2 0 1 0 8 0 tcpcb 736 493 0 484 12 10 2 5 0 8 1 arp 120 10 0 4 1 0 1 1 0 8 0 inpcb 304 1134 0 1127 5 4 1 2 0 8 0 rttmr 72 8 0 8 2 1 1 1 0 8 1 nd6 48 16 0 10 1 0 1 1 0 8 0 pkpcb 40 39 0 39 2 2 0 1 0 8 0 kcovpl 48 4 0 2 1 0 1 1 0 8 0 pfosfp 40 1462 0 1013 5 0 5 5 0 8 0 pfosfpen 112 1462 0 714 22 0 22 22 0 8 0 pfrktable 1344 2 0 0 1 0 1 1 0 8 0 pfqueue 264 5 0 5 1 1 0 1 0 8 0 pfstitem 24 34 0 29 1 0 1 1 0 8 0 pfstkey 112 34 0 29 1 0 1 1 0 8 0 pfstate 320 34 0 29 2 1 1 2 0 8 0 pfrule 1360 75 0 48 4 1 3 3 0 8 0 art_heap8 4096 1 0 0 1 0 1 1 0 8 0 art_heap4 256 368 0 180 14 2 12 14 0 8 0 art_table 32 369 0 180 2 0 2 2 0 8 0 art_node 16 78 0 38 1 0 1 1 0 8 0 sysvmsgpl 40 23 0 11 1 0 1 1 0 8 0 semapl 112 9 0 0 1 0 1 1 0 8 0 shmpl 112 19 0 0 1 0 1 1 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino2pl 256 4149 0 2737 89 0 89 89 0 8 0 ffsino 272 4149 0 2737 95 0 95 95 0 8 0 nchpl 144 7000 0 5391 61 0 61 61 0 8 0 uvmvnodes 72 4569 0 0 84 0 84 84 0 8 0 vnodes 224 4569 0 0 269 0 269 269 0 8 0 namei 1024 17532 0 17532 1 0 1 1 0 8 1 percpumem 16 45 0 11 1 0 1 1 0 8 0 vcpupl 2048 5 0 0 1 0 1 1 0 8 0 vmpool 560 5 0 0 1 0 1 1 0 8 0 pfiaddrpl 120 17 0 0 1 0 1 1 0 8 0 scxspl 216 21456 0 21456 11 10 1 8 0 8 1 plimitpl 152 48 0 39 1 0 1 1 0 8 0 sigapl 424 2432 0 2397 5 0 5 5 0 8 1 futexpl 56 15921 0 15918 1 0 1 1 0 8 0 knotepl 112 55 0 0 2 0 2 2 0 8 0 kqueuepl 216 980 0 969 2 1 1 2 0 8 0 pipepl 336 147 0 135 5 3 2 2 0 8 0 fdescpl 496 2415 0 2397 3 0 3 3 0 8 0 filepl 152 8271 0 8152 6 1 5 6 0 8 0 lockfpl 104 339 0 335 1 0 1 1 0 8 0 lockfspl 48 136 0 133 1 0 1 1 0 8 0 sessionpl 144 20 0 9 1 0 1 1 0 8 0 pgrppl 48 25 0 14 1 0 1 1 0 8 0 ucredpl 96 887 0 875 1 0 1 1 0 8 0 zombiepl 144 2397 0 2396 1 0 1 1 0 8 0 processpl 1072 2432 0 2396 3 0 3 3 0 8 0 procpl 672 5024 0 4977 10 5 5 5 0 8 0 sosppl 168 13 0 13 1 1 0 1 0 8 0 sockpl 480 1713 0 1688 8 4 4 6 0 8 0 mcl64k 65536 15 0 0 2 0 2 2 0 8 0 mcl16k 16384 6 0 0 1 0 1 1 0 8 0 mcl12k 12288 17 0 0 2 0 2 2 0 8 0 mcl9k 9216 3 0 0 1 0 1 1 0 8 0 mcl8k 8192 8 0 0 1 0 1 1 0 8 0 mcl4k 4096 12 0 0 2 0 2 2 0 8 0 mcl2k 2048 219 0 0 23 0 23 23 0 8 0 mtagpl 96 69 0 0 2 0 2 2 0 8 0 mbufpl 256 577 0 0 33 0 33 33 0 8 0 bufpl 280 7193 0 865 453 0 453 453 0 8 0 anonpl 24 594901 0 586245 60 4 56 56 0 186 0 amapchunkpl 152 65728 0 65259 24 4 20 20 0 158 0 amappl16 200 4421 0 4194 14 1 13 13 0 8 0 amappl15 192 80 0 74 1 0 1 1 0 8 0 amappl14 184 1086 0 1081 2 1 1 1 0 8 0 amappl13 176 779 0 777 1 0 1 1 0 8 0 amappl12 168 6 0 6 1 1 0 1 0 8 0 amappl11 160 80 0 62 1 0 1 1 0 8 0 amappl10 152 24 0 19 1 0 1 1 0 8 0 amappl9 144 348 0 344 1 0 1 1 0 8 0 amappl8 136 745 0 695 2 0 2 2 0 8 0 amappl7 128 407 0 397 1 0 1 1 0 8 0 amappl6 120 66 0 57 1 0 1 1 0 8 0 amappl5 112 1897 0 1877 1 0 1 1 0 8 0 amappl4 104 1087 0 1060 1 0 1 1 0 8 0 amappl3 96 289 0 272 1 0 1 1 0 8 0 amappl2 88 1149 0 1108 2 1 1 2 0 8 0 amappl1 80 44378 0 43921 14 4 10 13 0 8 0 amappl 88 27437 0 27290 4 0 4 4 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 21 0 0 1 0 1 1 0 8 0 uaddrrnd 24 2420 0 2397 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 2420 0 2397 1 0 1 1 0 8 0 vmmpekpl 168 15748 0 15719 2 0 2 2 0 8 0 vmmpepl 168 268297 0 266724 82 8 74 76 0 357 0 vmsppl 368 2419 0 2397 3 0 3 3 0 8 0 rwobjpl 56 48039 0 47042 17 2 15 15 0 8 0 pdppl 4096 4848 0 4799 68 17 51 52 0 8 2 pvpl 32 1286562 0 1273876 157 48 109 135 0 265 6 pmappl 224 2419 0 2397 2 0 2 2 0 8 0 extentpl 40 58 0 40 1 0 1 1 0 8 0 phpool 112 361 0 35 10 0 10 10 0 8 0 ddb{1}> machine ddbcpu 0 Stopped at x86_ipi_db+0x1a: addq $0x8,%rsp ddb{0}> trace x86_ipi_db(ffffffff8280dff0) at x86_ipi_db+0x1a sys/arch/amd64/amd64/db_interface.c:393 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+0x3e kd_curproc sys/dev/kcov.c:571 [inline] __sanitizer_cov_trace_pc() at __sanitizer_cov_trace_pc+0x3e sys/dev/kcov.c:143 __mp_lock(ffffffff829484e8) at __mp_lock+0x133 __mp_lock_spin sys/kern/kern_lock.c:116 [inline] __mp_lock(ffffffff829484e8) 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 tsc_get_timecount(ffff8000212772f8) at tsc_get_timecount+0x7 sys/arch/amd64/amd64/tsc.c:238 clock_gettime(ffff800021266540,3,ffff8000212772f8) at clock_gettime+0x88 sys/kern/kern_time.c:125 sys_clock_gettime(ffff800021266540,ffff800021277360,ffff8000212773b0) at sys_clock_gettime+0x4c sys/kern/kern_time.c:167 syscall(ffff800021277430) at syscall+0x5a9 mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff800021277430) at syscall+0x5a9 sys/arch/amd64/amd64/trap.c:587 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x7f7ffffdd860, 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:440 witness_checkorder(fffffd807e57ef80,9,0) at witness_checkorder+0x10f3 witness_debugger sys/kern/subr_witness.c:2502 [inline] witness_checkorder(fffffd807e57ef80,9,0) at witness_checkorder+0x10f3 sys/kern/subr_witness.c:1105 rw_enter(fffffd807e57ef70,81) at rw_enter+0xd1 sys/kern/kern_rwlock.c:250 rrw_enter(fffffd807e57ef70,81) at rrw_enter+0x8b sys/kern/kern_rwlock.c:461 VOP_LOCK(fffffd80659b0158,81) at VOP_LOCK+0x87 sys/kern/vfs_vops.c:534 vn_lock(fffffd80659b0158,81) at vn_lock+0x84 sys/kern/vfs_vnops.c:579 uvn_get(fffffd8069d13e70,0,ffff80002128d468,ffff80002128d438,0,0,3f739ff388b21cbd,ffffffff81f92ee0) at uvn_get+0x256 uvm_vnode_lock sys/uvm/uvm_vnode.c:1499 [inline] uvn_get(fffffd8069d13e70,0,ffff80002128d468,ffff80002128d438,0,0,3f739ff388b21cbd,ffffffff81f92ee0) at uvn_get+0x256 sys/uvm/uvm_vnode.c:993 uvm_fault_lower(ffff80002128d5d0,ffff80002128d608,ffff80002128d550,0) at uvm_fault_lower+0x302 sys/uvm/uvm_fault.c:1251 uvm_fault(fffffd8067ec4460,20001000,0,2) at uvm_fault+0x240 sys/uvm/uvm_fault.c:638 kpageflttrap(ffff80002128d760,20001280) at kpageflttrap+0x1fd sys/arch/amd64/amd64/trap.c:264 kerntrap(ffff80002128d760) at kerntrap+0xef sys/arch/amd64/amd64/trap.c:318 alltraps_kern_meltdown() at alltraps_kern_meltdown+0x7b copyout() at copyout+0x53 syscall(ffff80002128d9a0) at syscall+0x5a9 mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff80002128d9a0) at syscall+0x5a9 sys/arch/amd64/amd64/trap.c:587 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x49e9d4833a0, count: -15