witness: lock order reversal: 1st 0xfffffd8060072630 fdlock (&newfdp->fd_fd.fd_lock) 2nd 0xfffffd8060363d60 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(fffffd8060363d60,9,0) at witness_checkorder+0x10f3 witness_debugger sys/kern/subr_witness.c:2502 [inline] witness_checkorder(fffffd8060363d60,9,0) at witness_checkorder+0x10f3 sys/kern/subr_witness.c:1105 rw_enter(fffffd8060363d50,81) at rw_enter+0xd1 sys/kern/kern_rwlock.c:250 rrw_enter(fffffd8060363d50,81) at rrw_enter+0x8b sys/kern/kern_rwlock.c:461 VOP_LOCK(fffffd806e50c408,81) at VOP_LOCK+0x87 sys/kern/vfs_vops.c:614 vn_lock(fffffd806e50c408,81) at vn_lock+0x84 sys/kern/vfs_vnops.c:579 uvn_get(fffffd806e511438,0,ffff8000256b5728,ffff8000256b56f8,0,0) at uvn_get+0x256 uvm_vnode_lock sys/uvm/uvm_vnode.c:1499 [inline] uvn_get(fffffd806e511438,0,ffff8000256b5728,ffff8000256b56f8,0,0) at uvn_get+0x256 sys/uvm/uvm_vnode.c:993 uvm_fault_lower(ffff8000256b5890,ffff8000256b58c8,ffff8000256b5810,0) at uvm_fault_lower+0x302 sys/uvm/uvm_fault.c:1251 uvm_fault(fffffd806ee9c178,20000000,0,2) at uvm_fault+0x240 sys/uvm/uvm_fault.c:638 kpageflttrap(ffff8000256b5a20,20000300) at kpageflttrap+0x1fd sys/arch/amd64/amd64/trap.c:264 kerntrap(ffff8000256b5a20) at kerntrap+0xef sys/arch/amd64/amd64/trap.c:318 alltraps_kern_meltdown() at alltraps_kern_meltdown+0x7b copyout() at copyout+0x53 syscall(ffff8000256b5c50) at syscall+0x5a9 mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff8000256b5c50) at syscall+0x5a9 sys/arch/amd64/amd64/trap.c:587 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0xc274ff48ed0, count: -15 ddb{0}> show registers rdi 0xffff800021294000 rsi 0x14332 acpi_pdirpa+0x19a rbp 0xffff8000256b53a0 rbx 0x3 rdx 0xffff800021294000 rcx 0x14331 acpi_pdirpa+0x199 rax 0xffffffff82123d67 db_enter+0x17 r8 0xffffffff815a43dc witness_checkorder+0x10cc r9 0x5 r10 0x6392e0a150087db7 r11 0xb56b4992d59e27c4 r12 0xfffffd8002da87c0 r13 0 r14 0 r15 0 rip 0xffffffff82123d68 db_enter+0x18 cs 0x8 rflags 0x246 rsp 0xffff8000256b5390 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb{0}> show proc PROC (syz-executor.0) pid=173958 stat=onproc flags process=10 proc=4000000 pri=32, usrpri=77, nice=20 forw=0xffffffffffffffff, list=0xffff80002123ad28,0xffff80002123a558 process=0xffff8000ffff9d58 user=0xffff8000256b0000, vmspace=0xfffffd806ee9c178 estcpu=27, cpticks=0, pctcpu=0.0 user=0, sys=0, intr=0 ddb{0}> ps PID TID PPID UID S FLAGS WAIT COMMAND 60716 377918 96105 32767 2 0x10 syz-executor.0 *60716 173958 96105 32767 7 0x4000010 syz-executor.0 60716 78522 96105 32767 3 0x4000090 fsleep syz-executor.0 36490 335657 0 0 3 0x14200 bored sosplice 67609 435767 52068 32767 3 0x90 nanoslp syz-executor.1 96105 314766 36476 32767 3 0x90 nanoslp syz-executor.0 52068 519045 4185 0 3 0x82 wait syz-executor.1 36476 149224 4185 0 3 0x82 wait syz-executor.0 4185 312877 5829 0 3 0x82 thrsleep syz-fuzzer 4185 191969 5829 0 3 0x4000082 thrsleep syz-fuzzer 4185 391014 5829 0 3 0x4000082 thrsleep syz-fuzzer 4185 234131 5829 0 3 0x4000082 kqread syz-fuzzer 4185 315420 5829 0 3 0x4000082 thrsleep syz-fuzzer 4185 374820 5829 0 3 0x4000082 thrsleep syz-fuzzer 4185 6137 5829 0 3 0x4000082 thrsleep syz-fuzzer 4185 457608 5829 0 3 0x4000082 thrsleep syz-fuzzer 5829 390030 9194 0 3 0x10008a sigsusp ksh 9194 126417 74712 0 3 0x9a select sshd 81137 493203 1 0 3 0x100083 ttyin getty 74712 337924 1 0 3 0x88 select sshd 48856 363519 6626 73 3 0x100090 kqread syslogd 6626 270405 1 0 3 0x100082 netio syslogd 38908 160881 1 0 3 0x100080 kqread resolvd 28307 141665 13910 77 3 0x100092 kqread dhcpleased 7253 47865 13910 77 3 0x100092 kqread dhcpleased 13910 388872 1 0 3 0x80 kqread dhcpleased 99030 477550 0 0 3 0x14200 bored smr 78989 266009 0 0 2 0x14200 zerothread 62332 99640 0 0 3 0x14200 aiodoned aiodoned 55152 37196 0 0 3 0x14200 syncer update 77100 421352 0 0 3 0x14200 cleaner cleaner 81088 302370 0 0 7 0x14200 reaper 65776 415154 0 0 3 0x14200 pgdaemon pagedaemon 66426 45998 0 0 3 0x14200 bored crynlk 6016 168233 0 0 3 0x14200 bored crypto 63324 348844 0 0 3 0x14200 bored viomb 39618 510412 0 0 3 0x40014200 acpi0 acpi0 51333 102750 0 0 3 0x40014200 idle1 88374 80617 0 0 3 0x14200 bored softnet 97900 441438 0 0 3 0x14200 bored systqmp 16284 91047 0 0 3 0x14200 bored systq 65963 498436 0 0 3 0x40014200 bored softclock 37571 380366 0 0 3 0x40014200 idle0 1 333882 0 0 3 0x82 wait init 0 0 -1 0 3 0x10200 scheduler swapper ddb{0}> show all locks Process 60716 (syz-executor.0) thread 0xffff80002123afc8 (173958) exclusive kernel_lock &kernel_lock r = 0 (0xffffffff82966f78) #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 (0xfffffd8060072630) #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 10117 6354K 6380K 78643K 11207 0 pcb 13 8K 8K 78643K 13 0 rtable 108 3K 3K 78643K 177 0 ifaddr 39 10K 10K 78643K 39 0 sysctl 2 0K 0K 78643K 2 0 counters 44 34K 34K 78643K 44 0 ioctlops 0 0K 2K 78643K 911 0 iov 0 0K 2K 78643K 284 0 mount 1 1K 1K 78643K 1 0 log 0 0K 0K 78643K 6 0 vnodes 1217 77K 77K 78643K 1277 0 UFS quota 1 32K 32K 78643K 1 0 UFS mount 5 36K 36K 78643K 5 0 shm 2 1K 5K 78643K 25 0 VM map 2 1K 1K 78643K 2 0 sem 12 0K 1K 78643K 15868 0 dirhash 12 2K 2K 78643K 12 0 ACPI 1697 195K 286K 78643K 12598 0 file desc 7 21K 33K 78643K 148110 0 sigio 0 0K 0K 78643K 9 0 proc 56 74K 99K 78643K 468 0 subproc 34 2K 2K 78643K 34 0 NFS srvsock 1 0K 0K 78643K 1 0 NFS daemon 1 16K 16K 78643K 1 0 ip_moptions 0 0K 0K 78643K 68 0 in_multi 33 2K 2K 78643K 54 0 ether_multi 1 0K 0K 78643K 3 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 3492 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 482 57K 57K 78643K 1747666 0 UVM aobj 131 4K 4K 78643K 169 0 memdesc 1 4K 4K 78643K 1 0 crypto data 1 1K 1K 78643K 1 0 ip6_options 0 0K 0K 78643K 52 0 NDP 5 0K 0K 78643K 9 0 temp 102 4205K 4269K 78643K 298704 0 kqueue 14 19K 23K 78643K 264 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 32 0 29 1 0 1 1 0 8 0 rtentry 112 46 0 1 2 0 2 2 0 8 0 unpcb 120 21645 0 21627 1 0 1 1 0 8 0 syncache 296 6 0 6 2 2 0 1 0 8 0 tcpqe 32 3443 0 3443 6 6 0 5 0 8 0 tcpcb 736 288 0 284 8 7 1 3 0 8 0 arp 120 6 0 0 1 0 1 1 0 8 0 inpcb 304 596 0 589 4 3 1 2 0 8 0 nd6 48 7 0 0 1 0 1 1 0 8 0 kcovpl 48 2 0 0 1 0 1 1 0 8 0 art_heap8 4096 1 0 0 1 0 1 1 0 8 0 art_heap4 256 190 0 0 12 0 12 12 0 8 0 art_table 32 191 0 0 2 0 2 2 0 8 0 art_node 16 45 0 4 1 0 1 1 0 8 0 semupl 112 3 0 3 1 1 0 1 0 8 0 semapl 112 15861 0 15851 1 0 1 1 0 8 0 shmpl 112 166 0 38 4 0 4 4 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino2pl 256 164378 0 162973 88 0 88 88 0 8 0 ffsino 272 164378 0 162973 95 1 94 94 0 8 0 nchpl 144 338226 0 336611 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 679172 0 679172 2 1 1 1 0 8 1 percpumem 16 34 0 0 1 0 1 1 0 8 0 scxspl 216 938671 0 938671 13 12 1 8 0 8 1 plimitpl 152 34 0 24 1 0 1 1 0 8 0 sigapl 424 148333 0 148298 6 1 5 5 0 8 1 futexpl 56 713014 0 713013 1 0 1 1 0 8 0 knotepl 112 54 0 0 2 0 2 2 0 8 0 kqueuepl 216 164867 0 164848 27 25 2 3 0 8 0 pipepl 336 1880 0 1870 64 62 2 2 0 8 1 fdescpl 496 148316 0 148298 5 2 3 3 0 8 0 filepl 152 387681 0 387565 5 0 5 5 0 8 0 lockfpl 104 29436 0 29432 1 0 1 1 0 8 0 lockfspl 48 14583 0 14579 1 0 1 1 0 8 0 sessionpl 144 17 0 7 1 0 1 1 0 8 0 pgrppl 48 45 0 35 1 0 1 1 0 8 0 ucredpl 96 3706 0 3694 1 0 1 1 0 8 0 zombiepl 144 148298 0 148297 2 1 1 1 0 8 0 processpl 1072 148333 0 148297 3 0 3 3 0 8 0 procpl 672 305327 0 305281 36 31 5 5 0 8 1 sosppl 168 3 0 3 2 2 0 1 0 8 0 sockpl 480 22536 0 22508 58 54 4 5 0 8 0 mcl64k 65536 19 0 0 3 0 3 3 0 8 0 mcl16k 16384 17 0 0 3 0 3 3 0 8 0 mcl12k 12288 70 0 0 2 0 2 2 0 8 0 mcl9k 9216 25 0 0 2 0 2 2 0 8 0 mcl8k 8192 33 0 0 5 2 3 3 0 8 0 mcl4k 4096 57 0 0 4 1 3 3 0 8 0 mcl2k2 2112 17 0 0 2 0 2 2 0 8 0 mcl2k 2048 1696 0 0 121 104 17 120 0 8 0 mtagpl 96 3 0 0 1 0 1 1 0 8 0 mbufpl 256 2339 0 0 63 17 46 63 0 8 0 bufpl 280 151706 0 145374 453 0 453 453 0 8 0 anonpl 24 36417437 0 36333838 537 32 505 505 0 186 1 amapchunkpl 152 4097169 0 4095029 122 39 83 83 0 158 0 amappl16 200 217336 0 214100 173 2 171 171 0 8 0 amappl15 192 74186 0 74183 1 0 1 1 0 8 0 amappl14 184 2 0 1 1 0 1 1 0 8 0 amappl13 176 73984 0 73980 1 0 1 1 0 8 0 amappl12 168 16 0 13 1 0 1 1 0 8 0 amappl11 160 43 0 30 1 0 1 1 0 8 0 amappl10 152 38 0 33 1 0 1 1 0 8 0 amappl9 144 249 0 246 1 0 1 1 0 8 0 amappl8 136 452 0 364 4 0 4 4 0 8 0 amappl7 128 66 0 53 1 0 1 1 0 8 0 amappl6 120 112 0 100 1 0 1 1 0 8 0 amappl5 112 148364 0 148344 1 0 1 1 0 8 0 amappl4 104 9132 0 9102 1 0 1 1 0 8 0 amappl3 96 1125 0 1123 1 0 1 1 0 8 0 amappl2 88 75080 0 75027 2 0 2 2 0 8 0 amappl1 80 2416396 0 2415951 14 4 10 12 0 8 0 amappl 88 1732557 0 1732190 9 0 9 9 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 168 0 38 3 0 3 3 0 8 0 uaddrrnd 24 148316 0 148298 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 148316 0 148298 1 0 1 1 0 8 0 vmmpekpl 168 659186 0 659160 2 0 2 2 0 8 0 vmmpepl 168 16527226 0 16522239 317 98 219 219 0 357 0 vmsppl 368 148315 0 148297 2 0 2 2 0 8 0 rwobjpl 56 2683444 0 2679233 65 5 60 60 0 8 0 pdppl 4096 296640 0 296594 68 22 46 50 0 8 0 pvpl 32 68061630 0 67974664 858 149 709 713 0 265 5 pmappl 224 148315 0 148297 2 0 2 2 0 8 0 extentpl 40 58 0 40 1 0 1 1 0 8 0 phpool 112 545 0 219 13 0 13 13 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(fffffd8060363d60,9,0) at witness_checkorder+0x10f3 witness_debugger sys/kern/subr_witness.c:2502 [inline] witness_checkorder(fffffd8060363d60,9,0) at witness_checkorder+0x10f3 sys/kern/subr_witness.c:1105 rw_enter(fffffd8060363d50,81) at rw_enter+0xd1 sys/kern/kern_rwlock.c:250 rrw_enter(fffffd8060363d50,81) at rrw_enter+0x8b sys/kern/kern_rwlock.c:461 VOP_LOCK(fffffd806e50c408,81) at VOP_LOCK+0x87 sys/kern/vfs_vops.c:614 vn_lock(fffffd806e50c408,81) at vn_lock+0x84 sys/kern/vfs_vnops.c:579 uvn_get(fffffd806e511438,0,ffff8000256b5728,ffff8000256b56f8,0,0) at uvn_get+0x256 uvm_vnode_lock sys/uvm/uvm_vnode.c:1499 [inline] uvn_get(fffffd806e511438,0,ffff8000256b5728,ffff8000256b56f8,0,0) at uvn_get+0x256 sys/uvm/uvm_vnode.c:993 uvm_fault_lower(ffff8000256b5890,ffff8000256b58c8,ffff8000256b5810,0) at uvm_fault_lower+0x302 sys/uvm/uvm_fault.c:1251 uvm_fault(fffffd806ee9c178,20000000,0,2) at uvm_fault+0x240 sys/uvm/uvm_fault.c:638 kpageflttrap(ffff8000256b5a20,20000300) at kpageflttrap+0x1fd sys/arch/amd64/amd64/trap.c:264 kerntrap(ffff8000256b5a20) at kerntrap+0xef sys/arch/amd64/amd64/trap.c:318 alltraps_kern_meltdown() at alltraps_kern_meltdown+0x7b copyout() at copyout+0x53 syscall(ffff8000256b5c50) at syscall+0x5a9 mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff8000256b5c50) at syscall+0x5a9 sys/arch/amd64/amd64/trap.c:587 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0xc274ff48ed0, 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 __mp_lock(ffffffff82966d70) at __mp_lock+0x122 __mp_lock_spin sys/kern/kern_lock.c:116 [inline] __mp_lock(ffffffff82966d70) at __mp_lock+0x122 sys/kern/kern_lock.c:147 uvm_unmap_detach(ffff800021190ec0,1) at uvm_unmap_detach+0xfc sys/uvm/uvm_map.c:1586 uvm_map_teardown(fffffd806ee9c2e8) at uvm_map_teardown+0x262 sys/uvm/uvm_map.c:2762 uvmspace_free(fffffd806ee9c2e8) at uvmspace_free+0xa6 sys/uvm/uvm_map.c:3656 reaper(ffff800021193ce8) at reaper+0x189 sys/kern/kern_exit.c:462 end trace frame: 0x0, count: -8