witness: lock order reversal: 1st 0xfffffd806f0ef250 fdlock (&newfdp->fd_fd.fd_lock) 2nd 0xfffffd807a4dca38 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{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(fffffd807a4dca38,9,0) at witness_checkorder+0x10f3 witness_debugger sys/kern/subr_witness.c:2502 [inline] witness_checkorder(fffffd807a4dca38,9,0) at witness_checkorder+0x10f3 sys/kern/subr_witness.c:1105 rw_enter(fffffd807a4dca28,81) at rw_enter+0xd1 sys/kern/kern_rwlock.c:250 rrw_enter(fffffd807a4dca28,81) at rrw_enter+0x8b sys/kern/kern_rwlock.c:461 VOP_LOCK(fffffd807a4890f8,81) at VOP_LOCK+0x87 sys/kern/vfs_vops.c:614 vn_lock(fffffd807a4890f8,81) at vn_lock+0x84 sys/kern/vfs_vnops.c:579 uvn_get(fffffd80643c15b8,8000000000000000,ffff800021256e38,ffff800021256e08,0,0) at uvn_get+0x256 uvm_vnode_lock sys/uvm/uvm_vnode.c:1499 [inline] uvn_get(fffffd80643c15b8,8000000000000000,ffff800021256e38,ffff800021256e08,0,0) at uvn_get+0x256 sys/uvm/uvm_vnode.c:993 uvm_fault_lower(ffff800021256fa0,ffff800021256fd8,ffff800021256f20,0) at uvm_fault_lower+0x302 sys/uvm/uvm_fault.c:1251 uvm_fault(fffffd8069bb9748,20000000,0,2) at uvm_fault+0x240 sys/uvm/uvm_fault.c:638 kpageflttrap(ffff800021257130,200000c0) at kpageflttrap+0x1fd sys/arch/amd64/amd64/trap.c:264 kerntrap(ffff800021257130) at kerntrap+0xef sys/arch/amd64/amd64/trap.c:318 alltraps_kern_meltdown() at alltraps_kern_meltdown+0x7b copyout() at copyout+0x53 syscall(ffff800021257370) at syscall+0x5a9 mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff800021257370) at syscall+0x5a9 sys/arch/amd64/amd64/trap.c:587 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0xd565fdaba70, count: -15 ddb{0}> show registers rdi 0xffff8000230a0000 rsi 0x109b5 __ALIGN_SIZE+0xf9b5 rbp 0xffff800021256ab0 rbx 0x3 rdx 0xffff8000230a0000 rcx 0x109b4 __ALIGN_SIZE+0xf9b4 rax 0xffffffff81757fb7 db_enter+0x17 r8 0xffffffff813b9e4c witness_checkorder+0x10cc r9 0x5 r10 0x24a2f73f89409dcd r11 0x2b15555080868612 r12 0xfffffd8002da87c0 r13 0 r14 0 r15 0 rip 0xffffffff81757fb8 db_enter+0x18 cs 0x8 rflags 0x246 rsp 0xffff800021256aa0 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb{0}> show proc PROC (syz-executor.0) pid=11802 stat=onproc flags process=0 proc=4000000 pri=32, usrpri=79, nice=20 forw=0xffffffffffffffff, list=0xffff800021272000,0xffff800021273cf0 process=0xffff8000ffff94f8 user=0xffff800021252000, vmspace=0xfffffd8069bb9748 estcpu=36, cpticks=0, pctcpu=0.0 user=0, sys=0, intr=0 ddb{0}> ps PID TID PPID UID S FLAGS WAIT COMMAND 8446 327725 84571 0 7 0 syz-executor.0 * 8446 11802 84571 0 7 0x4000000 syz-executor.0 8446 343586 84571 0 3 0x4000080 fsleep syz-executor.0 8446 273251 84571 0 3 0x4000080 fsleep syz-executor.0 84571 344661 52264 0 3 0x82 nanoslp syz-executor.0 90641 349688 1 0 3 0x100083 ttyin getty 11758 498126 52264 0 3 0x2 biowait syz-executor.1 82200 398465 0 0 3 0x14200 bored sosplice 52264 30775 90153 0 3 0x82 thrsleep syz-fuzzer 52264 489860 90153 0 3 0x4000082 nanoslp syz-fuzzer 52264 500119 90153 0 3 0x4000082 kqread syz-fuzzer 52264 18008 90153 0 3 0x4000082 thrsleep syz-fuzzer 52264 189952 90153 0 3 0x4000082 thrsleep syz-fuzzer 52264 377275 90153 0 3 0x4000082 thrsleep syz-fuzzer 52264 320688 90153 0 3 0x4000082 thrsleep syz-fuzzer 52264 397668 90153 0 3 0x4000082 thrsleep syz-fuzzer 90153 111836 46920 0 3 0x10008a sigsusp ksh 46920 387579 62167 0 3 0x9a select sshd 62167 444208 1 0 3 0x88 select sshd 62305 69457 47359 74 3 0x100092 bpf pflogd 47359 381978 1 0 3 0x80 netio pflogd 16880 2813 99913 73 3 0x100090 kqread syslogd 99913 442361 1 0 3 0x100082 netio syslogd 23150 483664 1 0 3 0x100080 kqread resolvd 3292 394096 32836 77 3 0x100092 kqread dhcpleased 16549 518513 32836 77 3 0x100092 kqread dhcpleased 32836 112823 1 0 3 0x80 kqread dhcpleased 51421 521873 0 0 3 0x14200 bored smr 92717 474989 0 0 3 0x14200 pgzero zerothread 58647 420003 0 0 3 0x14200 aiodoned aiodoned 19521 95149 0 0 3 0x14200 syncer update 14696 282876 0 0 3 0x14200 cleaner cleaner 84110 448600 0 0 3 0x14200 reaper reaper 38578 404270 0 0 3 0x14200 pgdaemon pagedaemon 22412 504361 0 0 3 0x14200 bored crynlk 26213 125413 0 0 3 0x14200 bored crypto 32540 210057 0 0 3 0x14200 bored viomb 63344 16473 0 0 3 0x40014200 acpi0 acpi0 55675 164361 0 0 3 0x40014200 idle1 88323 420648 0 0 3 0x14200 bored softnet 90279 29308 0 0 3 0x14200 bored systqmp 43343 83531 0 0 3 0x14200 bored systq 4733 314998 0 0 3 0x40014200 bored softclock 23439 391973 0 0 3 0x40014200 idle0 1 206155 0 0 3 0x82 wait init 0 0 -1 0 3 0x10200 scheduler swapper ddb{0}> show all locks Process 8446 (syz-executor.0) thread 0xffff800021272540 (11802) exclusive kernel_lock &kernel_lock r = 0 (0xffffffff8291d520) #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 (0xfffffd806f0ef250) #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 11758 (syz-executor.1) thread 0xffff800021272d20 (498126) exclusive rrwlock inode r = 0 (0xfffffd807a4dc3d8) #0 witness_lock+0x4b0 stacktrace_save sys/sys/stacktrace.h:36 [inline] #0 witness_lock+0x4b0 sys/kern/subr_witness.c:1182 #1 rw_enter+0x3e2 sys/kern/kern_rwlock.c:310 #2 rrw_enter+0x8b sys/kern/kern_rwlock.c:461 #3 VOP_LOCK+0x87 sys/kern/vfs_vops.c:614 #4 vn_lock+0x84 sys/kern/vfs_vnops.c:579 #5 vget+0x1eb sys/kern/vfs_subr.c:676 #6 ufs_ihashget+0x121 sys/ufs/ufs/ufs_ihash.c:119 #7 ffs_vget+0x7c sys/ufs/ffs/ffs_vfsops.c:1321 #8 ufs_lookup+0x145f sys/ufs/ufs/ufs_lookup.c:487 #9 VOP_LOOKUP+0x5b sys/kern/vfs_vops.c:88 #10 vfs_lookup+0x737 sys/kern/vfs_lookup.c:561 #11 namei+0x55a sys/kern/vfs_lookup.c:245 #12 dounlinkat+0x99 sys/kern/vfs_syscalls.c:1854 #13 syscall+0x5a9 mi_syscall sys/sys/syscall_mi.h:102 [inline] #13 syscall+0x5a9 sys/arch/amd64/amd64/trap.c:587 #14 Xsyscall+0x128 exclusive rrwlock inode r = 0 (0xfffffd807a4dc4e8) #0 witness_lock+0x4b0 stacktrace_save sys/sys/stacktrace.h:36 [inline] #0 witness_lock+0x4b0 sys/kern/subr_witness.c:1182 #1 rw_enter+0x3e2 sys/kern/kern_rwlock.c:310 #2 rrw_enter+0x8b sys/kern/kern_rwlock.c:461 #3 VOP_LOCK+0x87 sys/kern/vfs_vops.c:614 #4 vn_lock+0x84 sys/kern/vfs_vnops.c:579 #5 vget+0x1eb sys/kern/vfs_subr.c:676 #6 cache_lookup+0x2b4 sys/kern/vfs_cache.c:224 #7 ufs_lookup+0x1c2 sys/ufs/ufs/ufs_lookup.c:162 #8 VOP_LOOKUP+0x5b sys/kern/vfs_vops.c:88 #9 vfs_lookup+0x737 sys/kern/vfs_lookup.c:561 #10 namei+0x55a sys/kern/vfs_lookup.c:245 #11 dounlinkat+0x99 sys/kern/vfs_syscalls.c:1854 #12 syscall+0x5a9 mi_syscall sys/sys/syscall_mi.h:102 [inline] #12 syscall+0x5a9 sys/arch/amd64/amd64/trap.c:587 #13 Xsyscall+0x128 ddb{0}> show malloc Type InUse MemUse HighUse Limit Requests Type Lim devbuf 10160 6441K 7668K 78643K 14778 0 pcb 13 8K 8K 78643K 119 0 rtable 112 4K 5K 78643K 353 0 ifaddr 62 13K 15K 78643K 230 0 sysctl 3 1K 1K 78643K 3 0 counters 44 34K 34K 78643K 118 0 ioctlops 0 0K 4K 78643K 1655 0 iov 0 0K 24K 78643K 77 0 mount 1 1K 1K 78643K 1 0 log 0 0K 0K 78643K 6 0 vnodes 1218 77K 77K 78643K 2406 0 UFS quota 1 32K 32K 78643K 1 0 UFS mount 5 36K 36K 78643K 5 0 shm 2 1K 5K 78643K 16 0 VM map 2 1K 1K 78643K 2 0 sem 12 0K 0K 78643K 278 0 dirhash 12 2K 2K 78643K 12 0 ACPI 1697 195K 286K 78643K 12598 0 file desc 5 13K 25K 78643K 3249 0 sigio 0 0K 0K 78643K 25 0 proc 72 87K 111K 78643K 512 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 123 0 in_multi 33 2K 2K 78643K 100 0 ether_multi 1 0K 0K 78643K 31 0 mrt 0 0K 0K 78643K 12 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 565 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 352 585K 586K 78643K 40697 0 UVM aobj 41 2K 2K 78643K 57 0 memdesc 1 4K 4K 78643K 1 0 crypto data 1 1K 1K 78643K 1 0 ip6_options 0 0K 0K 78643K 70 0 NDP 10 0K 0K 78643K 55 0 temp 122 4206K 4272K 78643K 14892 0 kqueue 10 14K 18K 78643K 122 0 SYN cache 2 16K 16K 78643K 2 0 ddb{0}> 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 126 0 123 1 0 1 1 0 8 0 rtentry 112 69 0 25 2 0 2 2 0 8 0 unpcb 120 707 0 692 2 1 1 2 0 8 0 syncache 296 41 0 41 4 4 0 1 0 8 0 tcpqe 32 71 0 71 3 3 0 1 0 8 0 tcpcb 736 338 0 326 11 8 3 5 0 8 0 arp 120 10 0 4 1 0 1 1 0 8 0 inpcb 304 861 0 845 4 2 2 3 0 8 0 rttmr 72 5 0 5 1 1 0 1 0 8 0 nd6 48 13 0 7 1 0 1 1 0 8 0 pkpcb 40 15 0 15 3 3 0 1 0 8 0 kcovpl 48 4 0 2 1 0 1 1 0 8 0 ppxss 1248 4 0 4 1 1 0 1 0 8 0 pffrag 232 3 0 1 2 1 1 1 0 482 0 pffrnode 88 3 0 1 2 1 1 1 0 8 0 pffrent 40 22 0 20 3 2 1 1 0 8 0 pfosfp 40 1462 0 1021 5 0 5 5 0 8 0 pfosfpen 112 1462 0 714 22 0 22 22 0 8 0 pfrktable 1344 11 0 10 1 0 1 1 0 8 0 pfstitem 24 53 0 23 1 0 1 1 0 8 0 pfstkey 112 53 0 23 1 0 1 1 0 8 0 pfstate 320 53 0 23 4 1 3 3 0 8 0 pfrule 1360 72 0 57 3 1 2 2 0 8 0 art_heap8 4096 1 0 0 1 0 1 1 0 8 0 art_heap4 256 334 0 142 16 3 13 16 0 8 0 art_table 32 335 0 142 2 0 2 2 0 8 0 art_node 16 68 0 28 1 0 1 1 0 8 0 sysvmsgpl 40 29 0 0 1 0 1 1 0 8 0 semapl 112 276 0 266 1 0 1 1 0 8 0 shmpl 112 54 0 16 2 0 2 2 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino2pl 256 5574 0 4150 90 0 90 90 0 8 0 ffsino 272 5574 0 4150 96 0 96 96 0 8 0 nchpl 144 9456 0 7848 61 0 61 61 0 8 0 uvmvnodes 72 5926 0 0 108 0 108 108 0 8 0 vnodes 224 5926 0 0 349 0 349 349 0 8 0 namei 1024 23606 0 23606 1 0 1 1 0 8 1 percpumem 16 71 0 37 1 0 1 1 0 8 0 vcpupl 1984 36 0 0 5 0 5 5 0 8 0 vmpool 560 36 0 0 3 0 3 3 0 8 0 scxspl 216 28508 0 28507 9 8 1 8 0 8 0 plimitpl 152 99 0 90 1 0 1 1 0 8 0 sigapl 424 3495 0 3460 5 0 5 5 0 8 1 futexpl 56 20322 0 20320 1 0 1 1 0 8 0 knotepl 112 54 0 0 2 0 2 2 0 8 0 kqueuepl 216 1339 0 1328 4 3 1 2 0 8 0 pipepl 336 279 0 267 8 6 2 2 0 8 1 fdescpl 496 3478 0 3460 3 0 3 3 0 8 0 filepl 152 10964 0 10846 6 1 5 6 0 8 0 lockfpl 104 424 0 421 1 0 1 1 0 8 0 lockfspl 48 184 0 181 1 0 1 1 0 8 0 sessionpl 144 21 0 10 1 0 1 1 0 8 0 pgrppl 48 34 0 23 1 0 1 1 0 8 0 ucredpl 96 1256 0 1244 1 0 1 1 0 8 0 zombiepl 144 3460 0 3460 1 0 1 1 0 8 1 processpl 1072 3495 0 3460 3 0 3 3 0 8 0 procpl 672 7433 0 7388 10 5 5 5 0 8 1 sosppl 168 15 0 15 2 2 0 1 0 8 0 sockpl 480 1712 0 1678 11 5 6 8 0 8 0 mcl64k 65536 17 0 0 3 0 3 3 0 8 0 mcl16k 16384 9 0 0 2 0 2 2 0 8 0 mcl12k 12288 17 0 0 2 0 2 2 0 8 0 mcl9k 9216 9 0 0 1 0 1 1 0 8 0 mcl8k 8192 9 0 0 2 0 2 2 0 8 0 mcl4k 4096 17 0 0 3 0 3 3 0 8 0 mcl2k2 2112 1 0 0 1 0 1 1 0 8 0 mcl2k 2048 276 0 0 21 0 21 21 0 8 0 mtagpl 96 178 0 0 5 0 5 5 0 8 0 mbufpl 256 889 0 0 55 0 55 55 0 8 0 bufpl 280 7841 0 1505 453 0 453 453 0 8 0 anonpl 24 873796 0 861298 85 7 78 78 0 186 0 amapchunkpl 152 95426 0 94910 27 5 22 22 0 158 0 amappl16 200 6653 0 6242 26 4 22 23 0 8 0 amappl15 192 381 0 379 1 0 1 1 0 8 0 amappl14 184 6 0 5 1 0 1 1 0 8 0 amappl13 176 734 0 733 1 0 1 1 0 8 0 amappl12 168 12 0 8 1 0 1 1 0 8 0 amappl11 160 43 0 29 1 0 1 1 0 8 0 amappl10 152 919 0 910 1 0 1 1 0 8 0 amappl9 144 1503 0 1500 1 0 1 1 0 8 0 amappl8 136 474 0 405 3 0 3 3 0 8 0 amappl7 128 80 0 65 1 0 1 1 0 8 0 amappl6 120 1398 0 1385 1 0 1 1 0 8 0 amappl5 112 4255 0 4233 1 0 1 1 0 8 0 amappl4 104 661 0 633 1 0 1 1 0 8 0 amappl3 96 115 0 110 1 0 1 1 0 8 0 amappl2 88 1248 0 1171 2 0 2 2 0 8 0 amappl1 80 60795 0 60345 13 3 10 13 0 8 0 amappl 88 40089 0 39893 5 0 5 5 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 56 0 16 1 0 1 1 0 8 0 uaddrrnd 24 3514 0 3460 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 3514 0 3460 1 0 1 1 0 8 0 vmmpekpl 168 22576 0 22544 2 0 2 2 0 8 0 vmmpepl 168 385986 0 384102 99 11 88 95 0 357 0 vmsppl 368 3513 0 3460 5 0 5 5 0 8 0 rwobjpl 56 68011 0 66740 23 4 19 19 0 8 0 pdppl 4096 7036 0 6956 97 15 82 83 0 8 2 pvpl 32 1878605 0 1864640 181 63 118 138 0 265 0 pmappl 224 3513 0 3460 4 0 4 4 0 8 0 extentpl 40 58 0 40 1 0 1 1 0 8 0 phpool 112 420 0 35 12 0 12 12 0 8 0 ddb{0}> machine ddbcpu 0 Invalid cpu 0 ddb{0}> trace db_enter() at db_enter+0x18 sys/arch/amd64/amd64/db_interface.c:399 witness_checkorder(fffffd807a4dca38,9,0) at witness_checkorder+0x10f3 witness_debugger sys/kern/subr_witness.c:2502 [inline] witness_checkorder(fffffd807a4dca38,9,0) at witness_checkorder+0x10f3 sys/kern/subr_witness.c:1105 rw_enter(fffffd807a4dca28,81) at rw_enter+0xd1 sys/kern/kern_rwlock.c:250 rrw_enter(fffffd807a4dca28,81) at rrw_enter+0x8b sys/kern/kern_rwlock.c:461 VOP_LOCK(fffffd807a4890f8,81) at VOP_LOCK+0x87 sys/kern/vfs_vops.c:614 vn_lock(fffffd807a4890f8,81) at vn_lock+0x84 sys/kern/vfs_vnops.c:579 uvn_get(fffffd80643c15b8,8000000000000000,ffff800021256e38,ffff800021256e08,0,0) at uvn_get+0x256 uvm_vnode_lock sys/uvm/uvm_vnode.c:1499 [inline] uvn_get(fffffd80643c15b8,8000000000000000,ffff800021256e38,ffff800021256e08,0,0) at uvn_get+0x256 sys/uvm/uvm_vnode.c:993 uvm_fault_lower(ffff800021256fa0,ffff800021256fd8,ffff800021256f20,0) at uvm_fault_lower+0x302 sys/uvm/uvm_fault.c:1251 uvm_fault(fffffd8069bb9748,20000000,0,2) at uvm_fault+0x240 sys/uvm/uvm_fault.c:638 kpageflttrap(ffff800021257130,200000c0) at kpageflttrap+0x1fd sys/arch/amd64/amd64/trap.c:264 kerntrap(ffff800021257130) at kerntrap+0xef sys/arch/amd64/amd64/trap.c:318 alltraps_kern_meltdown() at alltraps_kern_meltdown+0x7b copyout() at copyout+0x53 syscall(ffff800021257370) at syscall+0x5a9 mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff800021257370) at syscall+0x5a9 sys/arch/amd64/amd64/trap.c:587 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0xd565fdaba70, count: -15 ddb{0}> machine ddbcpu 1 Stopped at x86_ipi_db+0x1a: addq $0x8,%rsp ddb{1}> trace x86_ipi_db(ffff800020d38ff0) 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 end of kernel end trace frame: 0x7f7ffffcf670, count: -3