witness: lock order reversal: 1st 0xfffffd807f7d6438 fdlock (&newfdp->fd_fd.fd_lock) 2nd 0xfffffd8065a50a30 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:398 witness_checkorder(fffffd8065a50a30,9,0) at witness_checkorder+0x108b rw_enter(fffffd8065a50a20,81) at rw_enter+0xd4 rrw_enter(fffffd8065a50a20,81) at rrw_enter+0x88 sys/kern/kern_rwlock.c:461 VOP_LOCK(fffffd806444f0f8,81) at VOP_LOCK+0x87 sys/kern/vfs_vops.c:614 vn_lock(fffffd806444f0f8,81) at vn_lock+0x84 sys/kern/vfs_vnops.c:579 uvn_get(fffffd80646ae918,0,ffff8000256b58f8,ffff8000256b58c8,0,0) at uvn_get+0x276 uvm_vnode_lock sys/uvm/uvm_vnode.c:1499 [inline] uvn_get(fffffd80646ae918,0,ffff8000256b58f8,ffff8000256b58c8,0,0) at uvn_get+0x276 sys/uvm/uvm_vnode.c:993 uvm_fault_lower(ffff8000256b5a60,ffff8000256b5a98,ffff8000256b59e0,0) at uvm_fault_lower+0x302 sys/uvm/uvm_fault.c:1251 uvm_fault(fffffd80084d62e0,20000000,0,2) at uvm_fault+0x256 sys/uvm/uvm_fault.c:638 kpageflttrap(ffff8000256b5bf0,20000180) at kpageflttrap+0x1fd sys/arch/amd64/amd64/trap.c:262 kerntrap(ffff8000256b5bf0) at kerntrap+0xef sys/arch/amd64/amd64/trap.c:316 alltraps_kern_meltdown() at alltraps_kern_meltdown+0x7b copyout() at copyout+0x53 syscall(ffff8000256b5e20) at syscall+0x5bf mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff8000256b5e20) at syscall+0x5bf sys/arch/amd64/amd64/trap.c:585 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x45c54945f20, count: -15 ddb{0}> show registers rdi 0xffff8000212b0000 rsi 0xece7 __ALIGN_SIZE+0xdce7 rbp 0xffff8000256b5570 rbx 0x3 rdx 0xffff8000212b0000 rcx 0xece6 __ALIGN_SIZE+0xdce6 rax 0xffffffff8189f267 db_enter+0x17 r8 0xffffffff814607b1 witness_checkorder+0x1061 r9 0x5 r10 0x5ba357b7db013551 r11 0x56acbb12f2832cca r12 0 r13 0xfffffd8065a50a30 r14 0 r15 0xfffffd8002cf9740 rip 0xffffffff8189f268 db_enter+0x18 cs 0x8 rflags 0x246 rsp 0xffff8000256b5560 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb{0}> show proc PROC (syz-executor.0) pid=112713 stat=onproc flags process=10 proc=4000000 pri=32, usrpri=78, nice=20 forw=0xffffffffffffffff, list=0xffff800021283500,0xffff8000212837b0 process=0xffff800021286610 user=0xffff8000256b0000, vmspace=0xfffffd80084d62e0 estcpu=36, cpticks=0, pctcpu=0.0 user=0, sys=0, intr=0 ddb{0}> ps PID TID PPID UID S FLAGS WAIT COMMAND 63159 3739 7703 32767 2 0x10 syz-executor.1 97845 193507 38388 32767 7 0x10 syz-executor.0 *97845 112713 38388 32767 7 0x4000010 syz-executor.0 7703 190743 83573 32767 3 0x90 nanoslp syz-executor.1 83573 90274 18097 0 3 0x82 wait syz-executor.1 26094 423403 0 0 3 0x14200 bored sosplice 38388 235852 22022 32767 3 0x90 nanoslp syz-executor.0 22022 422339 18097 0 3 0x82 wait syz-executor.0 18097 85356 29313 0 3 0x82 thrsleep syz-fuzzer 18097 74011 29313 0 3 0x4000082 thrsleep syz-fuzzer 18097 127940 29313 0 3 0x4000082 kqread syz-fuzzer 18097 166109 29313 0 3 0x4000082 thrsleep syz-fuzzer 18097 263829 29313 0 3 0x4000082 thrsleep syz-fuzzer 18097 455197 29313 0 3 0x4000082 thrsleep syz-fuzzer 18097 259203 29313 0 3 0x4000082 thrsleep syz-fuzzer 18097 371577 29313 0 3 0x4000082 thrsleep syz-fuzzer 29313 19645 43008 0 3 0x10008a sigsusp ksh 43008 424168 43504 0 3 0x92 select sshd 59641 520459 1 0 3 0x100083 ttyin getty 43504 286133 1 0 3 0x80 select sshd 83017 139641 47305 73 3 0x100090 kqread syslogd 47305 390574 1 0 3 0x100082 netio syslogd 60578 358539 1 77 3 0x100090 poll dhclient 6361 441544 1 0 3 0x80 poll dhclient 75975 501484 0 0 3 0x14200 bored smr 89906 456142 0 0 2 0x14200 zerothread 67367 60579 0 0 3 0x14200 aiodoned aiodoned 84620 90373 0 0 3 0x14200 syncer update 48139 439534 0 0 3 0x14200 cleaner cleaner 1507 76119 0 0 3 0x14200 reaper reaper 59228 399077 0 0 3 0x14200 pgdaemon pagedaemon 46973 301856 0 0 3 0x14200 bored crynlk 91640 15205 0 0 3 0x14200 bored crypto 24696 440351 0 0 3 0x14200 bored viomb 40801 25623 0 0 3 0x40014200 acpi0 acpi0 53328 326507 0 0 3 0x40014200 idle1 88450 193742 0 0 3 0x14200 bored softnet 96469 321908 0 0 3 0x14200 bored systqmp 23830 46288 0 0 3 0x14200 bored systq 78774 213667 0 0 3 0x40014200 bored softclock 76207 362393 0 0 3 0x40014200 idle0 1 282393 0 0 3 0x82 wait init 0 0 -1 0 3 0x10200 scheduler swapper ddb{0}> show all locks Process 97845 (syz-executor.0) thread 0xffff8000212822a0 (112713) exclusive kernel_lock &kernel_lock r = 0 (0xffffffff82948808) #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+0x23a sys/uvm/uvm_fault.c:637 #2 kpageflttrap+0x1fd sys/arch/amd64/amd64/trap.c:262 #3 kerntrap+0xef sys/arch/amd64/amd64/trap.c:316 #4 alltraps_kern_meltdown+0x7b #5 copyout+0x53 #6 syscall+0x5bf mi_syscall sys/sys/syscall_mi.h:102 [inline] #6 syscall+0x5bf sys/arch/amd64/amd64/trap.c:585 #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+0xe0 #2 syscall+0x5bf mi_syscall sys/sys/syscall_mi.h:102 [inline] #2 syscall+0x5bf sys/arch/amd64/amd64/trap.c:585 #3 Xsyscall+0x128 ddb{0}> show malloc Type InUse MemUse HighUse Limit Requests Type Lim devbuf 10117 6414K 6414K 78643K 11213 0 pcb 13 8K 8K 78643K 13 0 rtable 109 3K 3K 78643K 341 0 ifaddr 39 10K 10K 78643K 53 0 sysctl 2 0K 0K 78643K 2 0 counters 44 34K 34K 78643K 48 0 ioctlops 0 0K 2K 78643K 137 0 iov 0 0K 16K 78643K 127 0 mount 1 1K 1K 78643K 1 0 log 0 0K 0K 78643K 1 0 vnodes 1216 76K 77K 78643K 1358 0 UFS quota 1 32K 32K 78643K 1 0 UFS mount 5 36K 36K 78643K 5 0 shm 2 1K 5K 78643K 27 0 VM map 2 1K 1K 78643K 2 0 sem 11 1K 1K 78643K 19 0 dirhash 12 2K 2K 78643K 12 0 ACPI 1697 195K 286K 78643K 12598 0 file desc 8 25K 33K 78643K 13988 0 sigio 0 0K 0K 78643K 46 0 proc 48 50K 82K 78643K 716 0 subproc 34 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 524 0 in_multi 33 2K 2K 78643K 158 0 ether_multi 1 0K 0K 78643K 19 0 ISOFS mount 1 32K 32K 78643K 1 0 MSDOSFS mount 1 16K 16K 78643K 1 0 ttys 43 201K 201K 78643K 43 0 exec 0 0K 2K 78643K 833 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 325 38K 38K 78643K 168887 0 UVM aobj 95 6K 6K 78643K 123 0 memdesc 1 4K 4K 78643K 1 0 crypto data 1 1K 1K 78643K 1 0 ip6_options 0 0K 0K 78643K 252 0 NDP 5 0K 0K 78643K 15 0 temp 101 3981K 4109K 78643K 30348 0 kqueue 3 4K 8K 78643K 217 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 20 0 0 1 0 1 1 0 8 0 rtpcb 120 173 0 171 1 0 1 1 0 8 0 rtentry 112 71 0 25 2 0 2 2 0 8 0 unpcb 120 2036 0 2026 1 0 1 1 0 8 0 syncache 296 97 0 97 9 9 0 1 0 8 0 sackhl 24 1 0 1 1 1 0 1 0 8 0 tcpqe 32 421 0 421 12 12 0 1 0 8 0 tcpcb 736 3407 0 3403 22 20 2 5 0 8 1 arp 120 11 0 5 1 0 1 1 0 8 0 ipq 40 4 0 4 2 2 0 1 0 8 0 ipqe 40 19 0 19 2 2 0 1 0 8 0 inpcb 304 4759 0 4753 7 6 1 3 0 8 0 ip6q 72 12 0 12 3 3 0 1 0 8 0 ip6af 40 23 0 23 3 3 0 1 0 8 0 nd6 48 15 0 7 1 0 1 1 0 8 0 kcovpl 48 4 0 2 1 0 1 1 0 8 0 art_heap8 4096 1 0 0 1 0 1 1 0 8 0 art_heap4 256 311 0 90 14 0 14 14 0 8 0 art_table 32 312 0 90 2 0 2 2 0 8 0 art_node 16 70 0 28 1 0 1 1 0 8 0 sysvmsgpl 40 8 0 8 1 1 0 1 0 8 0 semupl 112 12 0 12 1 1 0 1 0 8 0 semapl 112 17 0 8 1 0 1 1 0 8 0 shmpl 112 120 0 28 3 0 3 3 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino2pl 256 16224 0 14818 94 6 88 89 0 8 0 ffsino 272 16224 0 14818 95 0 95 95 0 8 0 nchpl 144 32907 0 31318 60 0 60 60 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 72060 0 72060 1 0 1 1 0 8 1 percpumem 16 35 0 2 1 0 1 1 0 8 0 scxspl 216 93861 0 93860 18 17 1 8 0 8 0 plimitpl 152 191 0 182 1 0 1 1 0 8 0 sigapl 424 14170 0 14136 4 0 4 4 0 8 0 futexpl 56 149329 0 149329 1 0 1 1 0 8 1 knotepl 112 313 0 293 1 0 1 1 0 8 0 kqueuepl 168 15036 0 15021 7 6 1 2 0 8 0 pipepl 336 539 0 527 9 7 2 2 0 8 0 fdescpl 496 14153 0 14136 3 0 3 3 0 8 0 filepl 152 45006 0 44905 10 5 5 5 0 8 1 lockfpl 104 669 0 667 1 0 1 1 0 8 0 lockfspl 48 247 0 245 1 0 1 1 0 8 0 sessionpl 144 19 0 9 1 0 1 1 0 8 0 pgrppl 48 35 0 25 1 0 1 1 0 8 0 ucredpl 96 3063 0 3054 1 0 1 1 0 8 0 zombiepl 144 14136 0 14136 1 0 1 1 0 8 1 processpl 1080 14170 0 14136 4 1 3 3 0 8 0 procpl 672 30494 0 30452 4 0 4 4 0 8 0 sosppl 168 118 0 118 8 8 0 1 0 8 0 sockpl 480 7009 0 6991 16 13 3 6 0 8 0 mcl64k 65536 25 0 0 4 0 4 4 0 8 0 mcl16k 16384 18 0 0 3 0 3 3 0 8 0 mcl12k 12288 26 0 0 2 0 2 2 0 8 0 mcl9k 9216 5 0 0 1 0 1 1 0 8 0 mcl8k 8192 18 0 0 3 1 2 3 0 8 0 mcl4k 4096 25 0 0 3 0 3 3 0 8 0 mcl2k2 2112 11 0 0 1 0 1 1 0 8 0 mcl2k 2048 506 0 0 30 0 30 30 0 8 0 mtagpl 96 1 0 0 1 0 1 1 0 8 0 mbufpl 256 1266 0 0 72 0 72 72 0 8 0 bufpl 280 23980 0 17716 448 0 448 448 0 8 0 anonpl 24 3571280 0 3547048 212 63 149 149 0 186 2 amapchunkpl 152 396880 0 396156 54 24 30 33 0 158 2 amappl16 200 22370 0 21471 87 39 48 48 0 8 0 amappl15 192 3793 0 3786 1 0 1 1 0 8 0 amappl14 184 10 0 5 1 0 1 1 0 8 0 amappl13 176 3091 0 3090 1 0 1 1 0 8 0 amappl12 168 7291 0 7282 1 0 1 1 0 8 0 amappl11 160 46 0 39 1 0 1 1 0 8 0 amappl10 152 29 0 24 1 0 1 1 0 8 0 amappl9 144 150 0 149 1 0 1 1 0 8 0 amappl8 136 587 0 464 5 0 5 5 0 8 0 amappl7 128 65 0 53 1 0 1 1 0 8 0 amappl6 120 128 0 100 1 0 1 1 0 8 0 amappl5 112 7179 0 7169 1 0 1 1 0 8 0 amappl4 104 7876 0 7842 1 0 1 1 0 8 0 amappl3 96 3525 0 3520 1 0 1 1 0 8 0 amappl2 88 7834 0 7784 2 0 2 2 0 8 0 amappl1 80 243149 0 242726 15 5 10 12 0 8 0 amappl 88 166736 0 166551 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 122 0 28 3 1 2 2 0 8 0 uaddrrnd 24 14153 0 14136 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 14153 0 14136 1 0 1 1 0 8 0 vmmpekpl 168 76102 0 76083 2 0 2 2 0 8 0 vmmpepl 168 1620302 0 1617853 155 46 109 111 0 357 2 vmsppl 368 14152 0 14136 2 0 2 2 0 8 0 rwobjpl 56 267644 0 265974 36 12 24 25 0 8 0 pdppl 4096 28313 0 28272 55 14 41 45 0 8 0 pvpl 32 7994466 0 7966687 353 123 230 230 0 265 5 pmappl 232 14152 0 14136 2 1 1 2 0 8 0 extentpl 40 58 0 40 1 0 1 1 0 8 0 phpool 112 414 0 50 11 0 11 11 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:398 witness_checkorder(fffffd8065a50a30,9,0) at witness_checkorder+0x108b rw_enter(fffffd8065a50a20,81) at rw_enter+0xd4 rrw_enter(fffffd8065a50a20,81) at rrw_enter+0x88 sys/kern/kern_rwlock.c:461 VOP_LOCK(fffffd806444f0f8,81) at VOP_LOCK+0x87 sys/kern/vfs_vops.c:614 vn_lock(fffffd806444f0f8,81) at vn_lock+0x84 sys/kern/vfs_vnops.c:579 uvn_get(fffffd80646ae918,0,ffff8000256b58f8,ffff8000256b58c8,0,0) at uvn_get+0x276 uvm_vnode_lock sys/uvm/uvm_vnode.c:1499 [inline] uvn_get(fffffd80646ae918,0,ffff8000256b58f8,ffff8000256b58c8,0,0) at uvn_get+0x276 sys/uvm/uvm_vnode.c:993 uvm_fault_lower(ffff8000256b5a60,ffff8000256b5a98,ffff8000256b59e0,0) at uvm_fault_lower+0x302 sys/uvm/uvm_fault.c:1251 uvm_fault(fffffd80084d62e0,20000000,0,2) at uvm_fault+0x256 sys/uvm/uvm_fault.c:638 kpageflttrap(ffff8000256b5bf0,20000180) at kpageflttrap+0x1fd sys/arch/amd64/amd64/trap.c:262 kerntrap(ffff8000256b5bf0) at kerntrap+0xef sys/arch/amd64/amd64/trap.c:316 alltraps_kern_meltdown() at alltraps_kern_meltdown+0x7b copyout() at copyout+0x53 syscall(ffff8000256b5e20) at syscall+0x5bf mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff8000256b5e20) at syscall+0x5bf sys/arch/amd64/amd64/trap.c:585 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x45c54945f20, count: -15 ddb{0}> machine ddbcpu 1 Stopped at x86_ipi_db+0x1a: addq $0x8,%rsp ddb{1}> trace x86_ipi_db(ffff800020d58ff0) at x86_ipi_db+0x1a sys/arch/amd64/amd64/db_interface.c:352 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_switch(0,ffffffff82766300) at __sanitizer_cov_trace_switch+0x98 kd_curproc sys/dev/kcov.c:570 [inline] __sanitizer_cov_trace_switch(0,ffffffff82766300) at __sanitizer_cov_trace_switch+0x98 trace_cmp sys/dev/kcov.c:165 [inline] __sanitizer_cov_trace_switch(0,ffffffff82766300) at __sanitizer_cov_trace_switch+0x98 sys/dev/kcov.c:262 syscall(ffff8000212a1670) at syscall+0x610 sys/arch/amd64/amd64/trap.c:587 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x7f7ffffca520, count: -6