witness: lock order reversal: 1st 0xfffffd806f1b7060 fdlock (&newfdp->fd_fd.fd_lock) 2nd 0xfffffd806b06ca28 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:440 witness_checkorder(fffffd806b06ca28,9,0) at witness_checkorder+0x10f3 witness_debugger sys/kern/subr_witness.c:2502 [inline] witness_checkorder(fffffd806b06ca28,9,0) at witness_checkorder+0x10f3 sys/kern/subr_witness.c:1105 rw_enter(fffffd806b06ca18,81) at rw_enter+0xd1 sys/kern/kern_rwlock.c:250 rrw_enter(fffffd806b06ca18,81) at rrw_enter+0x8b sys/kern/kern_rwlock.c:461 VOP_LOCK(fffffd8069e40868,81) at VOP_LOCK+0x87 sys/kern/vfs_vops.c:614 vn_lock(fffffd8069e40868,81) at vn_lock+0x84 sys/kern/vfs_vnops.c:579 uvn_get(fffffd806afc95b0,0,ffff800021295788,ffff800021295758,0,0,1c0fdd6d83cda4e7,ffffffff82189290) at uvn_get+0x256 uvm_vnode_lock sys/uvm/uvm_vnode.c:1499 [inline] uvn_get(fffffd806afc95b0,0,ffff800021295788,ffff800021295758,0,0,1c0fdd6d83cda4e7,ffffffff82189290) at uvn_get+0x256 sys/uvm/uvm_vnode.c:993 uvm_fault_lower(ffff8000212958f0,ffff800021295928,ffff800021295870,0) at uvm_fault_lower+0x302 sys/uvm/uvm_fault.c:1251 uvm_fault(fffffd8065b53010,20000000,0,2) at uvm_fault+0x240 sys/uvm/uvm_fault.c:638 kpageflttrap(ffff800021295a80,20000040) at kpageflttrap+0x1fd sys/arch/amd64/amd64/trap.c:264 kerntrap(ffff800021295a80) at kerntrap+0xef sys/arch/amd64/amd64/trap.c:318 alltraps_kern_meltdown() at alltraps_kern_meltdown+0x7b copyout() at copyout+0x53 syscall(ffff800021295cb0) at syscall+0x5a9 mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff800021295cb0) at syscall+0x5a9 sys/arch/amd64/amd64/trap.c:587 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0xa413e92ab30, count: -15 ddb{0}> show registers rdi 0xffff8000220a0000 rsi 0x7382 __ALIGN_SIZE+0x6382 rbp 0xffff800021295400 rbx 0x3 rdx 0xffff8000220a0000 rcx 0x7381 __ALIGN_SIZE+0x6381 rax 0xffffffff81fcb967 db_enter+0x17 r8 0xffffffff81aeeb2c witness_checkorder+0x10cc r9 0x5 r10 0x99226e47f25df280 r11 0x4561cb97f8286135 r12 0xfffffd8002db7840 r13 0 r14 0 r15 0 rip 0xffffffff81fcb968 db_enter+0x18 cs 0x8 rflags 0x246 rsp 0xffff8000212953f0 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb{0}> show proc PROC (syz-executor.1) pid=3819 stat=onproc flags process=0 proc=4000000 pri=78, usrpri=78, nice=20 forw=0xffffffffffffffff, list=0xffff80002121e2b0,0xffff80002121f7c0 process=0xffff8000ffffa188 user=0xffff800021290000, vmspace=0xfffffd8065b53010 estcpu=36, cpticks=0, pctcpu=0.0 user=0, sys=0, intr=0 ddb{0}> ps PID TID PPID UID S FLAGS WAIT COMMAND 58469 210338 7988 0 7 0 syz-executor.1 *58469 3819 7988 0 7 0x4000000 syz-executor.1 58469 95855 7988 0 2 0x4000080 syz-executor.1 9737 70416 62486 0 3 0x82 nanoslp syz-executor.0 7988 382145 62486 0 3 0x82 nanoslp syz-executor.1 38941 22427 1 0 3 0x100083 ttyin getty 61603 8297 0 0 3 0x14200 bored sosplice 62486 56463 33456 0 3 0x82 thrsleep syz-fuzzer 62486 496081 33456 0 3 0x4000082 nanoslp syz-fuzzer 62486 104581 33456 0 3 0x4000082 thrsleep syz-fuzzer 62486 438204 33456 0 3 0x4000082 thrsleep syz-fuzzer 62486 189877 33456 0 3 0x4000082 thrsleep syz-fuzzer 62486 225744 33456 0 3 0x4000082 thrsleep syz-fuzzer 62486 513291 33456 0 3 0x4000082 thrsleep syz-fuzzer 62486 355275 33456 0 3 0x4000082 kqread syz-fuzzer 33456 63451 63489 0 3 0x10008a sigsusp ksh 63489 156527 63356 0 3 0x9a select sshd 63356 56905 1 0 3 0x88 select sshd 12113 350950 80432 74 3 0x100092 bpf pflogd 80432 104750 1 0 3 0x80 netio pflogd 13954 467326 44182 73 3 0x100090 kqread syslogd 44182 103588 1 0 3 0x100082 netio syslogd 24394 426878 1 0 3 0x100080 kqread resolvd 31167 294245 6239 77 3 0x100092 kqread dhcpleased 15803 10286 6239 77 3 0x100092 kqread dhcpleased 6239 29923 1 0 3 0x80 kqread dhcpleased 78632 30553 0 0 3 0x14200 bored smr 31978 450027 0 0 3 0x14200 pgzero zerothread 22850 56604 0 0 3 0x14200 aiodoned aiodoned 18352 110652 0 0 3 0x14200 syncer update 63717 228030 0 0 3 0x14200 cleaner cleaner 30007 16904 0 0 3 0x14200 reaper reaper 51892 117359 0 0 3 0x14200 pgdaemon pagedaemon 82299 58547 0 0 3 0x14200 bored crynlk 21085 434438 0 0 3 0x14200 bored crypto 46418 317033 0 0 3 0x14200 bored viomb 78718 421529 0 0 3 0x40014200 acpi0 acpi0 76692 266598 0 0 3 0x40014200 idle1 39939 345472 0 0 3 0x14200 bored softnet 70790 104761 0 0 3 0x14200 bored systqmp 87086 130708 0 0 3 0x14200 bored systq 69189 52207 0 0 3 0x40014200 bored softclock 46686 144904 0 0 3 0x40014200 idle0 1 69295 0 0 3 0x82 wait init 0 0 -1 0 3 0x10200 scheduler swapper ddb{0}> show all locks Process 58469 (syz-executor.1) thread 0xffff80002121e010 (3819) exclusive kernel_lock &kernel_lock r = 0 (0xffffffff829e2bd8) #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 (0xfffffd806f1b7060) #0 witness_lock+0x4b0 stacktrace_save sys/sys/stacktrace.h:36 [inline] #0 witness_lock+0x4b0 sys/kern/subr_witness.c:1182 #1 sys_socketpair+0x20f #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{0}> show malloc Type InUse MemUse HighUse Limit Requests Type Lim devbuf 10184 6517K 7255K 78643K 18763 0 pcb 13 8K 8K 78643K 458 0 rtable 108 3K 4K 78643K 740 0 ifaddr 80 15K 16K 78643K 311 0 sysctl 2 0K 0K 78643K 2 0 counters 44 34K 34K 78643K 126 0 ioctlops 0 0K 4K 78643K 1736 0 iov 0 0K 32K 78643K 248 0 mount 1 1K 1K 78643K 1 0 log 0 0K 0K 78643K 6 0 vnodes 1221 77K 77K 78643K 3686 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 12 0K 0K 78643K 859 0 dirhash 12 2K 2K 78643K 12 0 ACPI 1697 195K 286K 78643K 12598 0 file desc 5 13K 25K 78643K 25330 0 sigio 0 0K 0K 78643K 47 0 proc 71 87K 99K 78643K 893 0 subproc 32 2K 2K 78643K 195 0 NFS srvsock 1 0K 0K 78643K 1 0 NFS daemon 1 16K 16K 78643K 1 0 ip_moptions 0 0K 0K 78643K 420 0 in_multi 33 2K 2K 78643K 401 0 ether_multi 1 0K 0K 78643K 77 0 mrt 0 0K 0K 78643K 102 0 ISOFS mount 1 32K 32K 78643K 1 0 MSDOSFS mount 1 16K 16K 78643K 1 0 ttys 55 254K 254K 78643K 55 0 exec 0 0K 2K 78643K 757 0 pfkey data 0 0K 1K 78643K 2 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 312 132K 133K 78643K 299064 0 UVM aobj 22 4K 4K 78643K 27 0 memdesc 1 4K 4K 78643K 1 0 crypto data 1 1K 1K 78643K 1 0 ip6_options 0 0K 1K 78643K 380 0 NDP 14 0K 0K 78643K 91 0 temp 139 4214K 4305K 78643K 99102 0 kqueue 10 14K 22K 78643K 291 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 197 0 194 1 0 1 1 0 8 0 rtentry 112 201 0 157 2 0 2 2 0 8 0 unpcb 120 1314 0 1295 2 1 1 2 0 8 0 syncache 296 61 0 61 8 8 0 1 0 8 0 tcpqe 32 241 0 241 9 9 0 1 0 8 0 tcpcb 736 1243 0 1239 24 23 1 5 0 8 0 arp 120 25 0 19 1 0 1 1 0 8 0 inpcb 304 3219 0 3212 13 12 1 2 0 8 0 rttmr 72 36 0 36 6 6 0 1 0 8 0 nd6 48 48 0 42 1 0 1 1 0 8 0 pkpcb 40 41 0 41 7 7 0 1 0 8 0 kcovpl 48 11 0 9 1 0 1 1 0 8 0 swfcl 56 1 0 0 1 0 1 1 0 8 0 ppxss 1248 13 0 13 4 4 0 1 0 8 0 pffrag 232 10 0 10 4 4 0 1 0 482 0 pffrnode 88 10 0 10 4 4 0 1 0 8 0 pffrent 40 187 0 187 4 4 0 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 48 0 46 1 0 1 1 0 8 0 pfstkey 112 48 0 46 1 0 1 1 0 8 0 pfstate 320 48 0 46 3 2 1 3 0 8 0 pfrule 1360 78 0 62 3 1 2 2 0 8 0 art_heap8 4096 1 0 0 1 0 1 1 0 8 0 art_heap4 256 651 0 459 17 5 12 14 0 8 0 art_table 32 652 0 459 2 0 2 2 0 8 0 art_node 16 200 0 160 1 0 1 1 0 8 0 sysvmsgpl 40 25 0 25 1 1 0 1 0 8 0 semapl 112 857 0 847 1 0 1 1 0 8 0 shmpl 112 24 0 5 1 0 1 1 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino2pl 256 28491 0 27075 89 0 89 89 0 8 0 ffsino 272 28491 0 27075 95 0 95 95 0 8 0 nchpl 144 55213 0 53604 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 119757 0 119757 3 2 1 1 0 8 1 percpumem 16 75 0 41 1 0 1 1 0 8 0 vcpupl 2048 8 0 0 1 0 1 1 0 8 0 vmpool 560 8 0 0 1 0 1 1 0 8 0 scsiplug 72 8 0 8 2 2 0 1 0 8 0 scxspl 216 163719 0 163719 13 12 1 5 0 8 1 plimitpl 152 223 0 214 1 0 1 1 0 8 0 sigapl 424 25564 0 25529 6 1 5 5 0 8 0 futexpl 56 118786 0 118786 3 2 1 1 0 8 1 knotepl 112 74 0 0 2 0 2 2 0 8 0 kqueuepl 216 20741 0 20716 4 2 2 3 0 8 0 pipepl 336 401 0 391 12 10 2 2 0 8 0 fdescpl 496 25539 0 25521 3 0 3 3 0 8 0 filepl 152 60384 0 60264 7 2 5 6 0 8 0 lockfpl 104 860 0 858 1 0 1 1 0 8 0 lockfspl 48 320 0 318 1 0 1 1 0 8 0 sessionpl 144 29 0 18 1 0 1 1 0 8 0 pgrppl 48 48 0 37 1 0 1 1 0 8 0 ucredpl 96 2510 0 2497 1 0 1 1 0 8 0 zombiepl 144 25529 0 25528 1 0 1 1 0 8 0 processpl 1072 25564 0 25528 3 0 3 3 0 8 0 procpl 672 53176 0 53131 18 13 5 5 0 8 0 sosppl 168 56 0 56 8 8 0 1 0 8 0 sockpl 480 4820 0 4791 18 14 4 6 0 8 0 mcl64k 65536 23 0 0 3 0 3 3 0 8 0 mcl16k 16384 17 0 0 3 0 3 3 0 8 0 mcl12k 12288 33 0 0 2 0 2 2 0 8 0 mcl9k 9216 9 0 0 1 0 1 1 0 8 0 mcl8k 8192 25 0 0 4 1 3 3 0 8 0 mcl4k 4096 25 0 0 4 1 3 3 0 8 0 mcl2k2 2112 7 0 0 1 0 1 1 0 8 0 mcl2k 2048 575 0 0 26 0 26 26 0 8 0 mtagpl 96 284 0 0 7 4 3 7 0 8 0 mbufpl 256 917 0 0 52 1 51 51 0 8 0 bufpl 280 32854 0 26518 453 0 453 453 0 8 0 anonpl 24 6333759 0 6320596 138 56 82 86 0 186 1 amapchunkpl 152 714027 0 713566 70 50 20 38 0 158 1 amappl16 200 37606 0 37125 52 26 26 30 0 8 0 amappl15 192 202 0 201 4 3 1 1 0 8 0 amappl14 184 418 0 415 1 0 1 1 0 8 0 amappl13 176 12176 0 12175 1 0 1 1 0 8 0 amappl12 168 14 0 9 1 0 1 1 0 8 0 amappl11 160 2205 0 2190 1 0 1 1 0 8 0 amappl10 152 1940 0 1933 1 0 1 1 0 8 0 amappl9 144 8734 0 8729 1 0 1 1 0 8 0 amappl8 136 752 0 629 5 0 5 5 0 8 0 amappl7 128 108 0 95 1 0 1 1 0 8 0 amappl6 120 8683 0 8663 1 0 1 1 0 8 0 amappl5 112 25949 0 25929 1 0 1 1 0 8 0 amappl4 104 3625 0 3589 3 2 1 2 0 8 0 amappl3 96 900 0 896 1 0 1 1 0 8 0 amappl2 88 12846 0 12785 2 0 2 2 0 8 0 amappl1 80 427147 0 426707 13 3 10 13 0 8 0 amappl 88 297972 0 297816 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 26 0 5 1 0 1 1 0 8 0 uaddrrnd 24 25547 0 25521 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 25547 0 25521 1 0 1 1 0 8 0 vmmpekpl 168 94846 0 94807 3 0 3 3 0 8 0 vmmpepl 168 2834188 0 2832272 189 100 89 105 0 357 1 vmsppl 368 25546 0 25521 3 0 3 3 0 8 0 rwobjpl 56 470232 0 468919 33 14 19 20 0 8 0 pdppl 4096 51102 0 51050 78 24 54 54 0 8 2 pvpl 32 13640829 0 13624146 295 149 146 146 0 265 8 pmappl 224 25546 0 25521 2 0 2 2 0 8 0 extentpl 40 58 0 40 1 0 1 1 0 8 0 phpool 112 424 0 70 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:440 witness_checkorder(fffffd806b06ca28,9,0) at witness_checkorder+0x10f3 witness_debugger sys/kern/subr_witness.c:2502 [inline] witness_checkorder(fffffd806b06ca28,9,0) at witness_checkorder+0x10f3 sys/kern/subr_witness.c:1105 rw_enter(fffffd806b06ca18,81) at rw_enter+0xd1 sys/kern/kern_rwlock.c:250 rrw_enter(fffffd806b06ca18,81) at rrw_enter+0x8b sys/kern/kern_rwlock.c:461 VOP_LOCK(fffffd8069e40868,81) at VOP_LOCK+0x87 sys/kern/vfs_vops.c:614 vn_lock(fffffd8069e40868,81) at vn_lock+0x84 sys/kern/vfs_vnops.c:579 uvn_get(fffffd806afc95b0,0,ffff800021295788,ffff800021295758,0,0,1c0fdd6d83cda4e7,ffffffff82189290) at uvn_get+0x256 uvm_vnode_lock sys/uvm/uvm_vnode.c:1499 [inline] uvn_get(fffffd806afc95b0,0,ffff800021295788,ffff800021295758,0,0,1c0fdd6d83cda4e7,ffffffff82189290) at uvn_get+0x256 sys/uvm/uvm_vnode.c:993 uvm_fault_lower(ffff8000212958f0,ffff800021295928,ffff800021295870,0) at uvm_fault_lower+0x302 sys/uvm/uvm_fault.c:1251 uvm_fault(fffffd8065b53010,20000000,0,2) at uvm_fault+0x240 sys/uvm/uvm_fault.c:638 kpageflttrap(ffff800021295a80,20000040) at kpageflttrap+0x1fd sys/arch/amd64/amd64/trap.c:264 kerntrap(ffff800021295a80) at kerntrap+0xef sys/arch/amd64/amd64/trap.c:318 alltraps_kern_meltdown() at alltraps_kern_meltdown+0x7b copyout() at copyout+0x53 syscall(ffff800021295cb0) at syscall+0x5a9 mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff800021295cb0) at syscall+0x5a9 sys/arch/amd64/amd64/trap.c:587 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0xa413e92ab30, 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: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+0x37 kd_curproc sys/dev/kcov.c:570 [inline] __sanitizer_cov_trace_pc() at __sanitizer_cov_trace_pc+0x37 sys/dev/kcov.c:143 __mp_lock(ffffffff829e29d0) at __mp_lock+0x133 __mp_lock_spin sys/kern/kern_lock.c:116 [inline] __mp_lock(ffffffff829e29d0) at __mp_lock+0x133 sys/kern/kern_lock.c:147 syscall(ffff800021aa3c30) at syscall+0x42d mi_syscall sys/sys/syscall_mi.h:93 [inline] syscall(ffff800021aa3c30) at syscall+0x42d sys/arch/amd64/amd64/trap.c:587 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x7f7ffffe5620, count: -7