login: witness: lock order reversal: 1st 0xfffffd80707fde90 vmmaplk (&map->lock) 2nd 0xfffffd806a474818 fdlock (&newfdp->fd_fd.fd_lock) lock order "&newfdp->fd_fd.fd_lock"(rwlock) -> "&map->lock"(rwlock) first seen at: #0 rw_enter_read+0x66 sys/kern/kern_rwlock.c:112 #1 uvmfault_lookup+0xd9 sys/uvm/uvm_fault.c:1758 #2 uvm_fault_check+0x3a sys/uvm/uvm_fault.c:674 #3 uvm_fault+0x102 sys/uvm/uvm_fault.c:602 #4 kpageflttrap+0x209 #5 kerntrap+0xef sys/arch/amd64/amd64/trap.c:318 #6 alltraps_kern_meltdown+0x7b #7 copyout+0x53 #8 syscall+0x489 mi_syscall sys/sys/syscall_mi.h:102 [inline] #8 syscall+0x489 sys/arch/amd64/amd64/trap.c:585 #9 Xsyscall+0x128 lock order "&map->lock"(rwlock) -> "&newfdp->fd_fd.fd_lock"(rwlock) first seen at: #0 rw_enter_write+0x5b sys/kern/kern_rwlock.c:128 #1 fill_file+0xad2 sys/kern/kern_sysctl.c:1304 #2 sysctl_file+0x62d sys/kern/kern_sysctl.c:1457 #3 kern_sysctl+0xfd sys/kern/kern_sysctl.c:449 #4 sys_sysctl+0x209 sys/kern/kern_sysctl.c:249 #5 syscall+0x489 mi_syscall sys/sys/syscall_mi.h:102 [inline] #5 syscall+0x489 sys/arch/amd64/amd64/trap.c:585 #6 Xsyscall+0x128 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(fffffd806a474818,9,0) at witness_checkorder+0x10b7 witness_debugger sys/kern/subr_witness.c:2502 [inline] witness_checkorder(fffffd806a474818,9,0) at witness_checkorder+0x10b7 sys/kern/subr_witness.c:1105 rw_enter_write(fffffd806a474808) at rw_enter_write+0x5b sys/kern/kern_rwlock.c:128 fill_file(ffff800000bdb800,fffffd806c8b0b60,fffffd806a4747c0,0,0,ffff8000213229b0,38ee2f37d35d368f,4a00,0) at fill_file+0xad2 sys/kern/kern_sysctl.c:1304 sysctl_file(ffff800021312848,4,20000080,ffff800021312878,ffff8000fffee548) at sysctl_file+0x62d sys/kern/kern_sysctl.c:1457 kern_sysctl(ffff800021312844,5,20000080,ffff800021312878,0,0,2c4b0f4ebed7cead) at kern_sysctl+0xfd sys/kern/kern_sysctl.c:449 sys_sysctl(ffff8000fffee548,ffff8000213128e8,ffff800021312940) at sys_sysctl+0x209 sys/kern/kern_sysctl.c:249 syscall(ffff8000213129b0) at syscall+0x489 mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff8000213129b0) at syscall+0x489 sys/arch/amd64/amd64/trap.c:585 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x7f7ffffbdd70, count: -9 ddb{0}> show registers rdi 0x3 rsi 0xffffffff8294abb0 __sancov_gen_cov_switch_values.134 rbp 0xffff8000213121b0 rbx 0x3 rdx 0x3fd rcx 0 rax 0x1 r8 0xffff800021312120 r9 0x8080808080808080 r10 0x49f1c53f1c45537b r11 0x1c753f07f429860c r12 0xffffffff82aad200 w_lodata+0x4f890 r13 0 r14 0xffffffff82aacbd0 w_lodata+0x4f260 r15 0xfffffd8002f62c80 rip 0xffffffff8138d658 db_enter+0x18 cs 0x8 rflags 0x246 rsp 0xffff8000213121a0 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb{0}> show proc PROC (syz-executor.4) pid=244266 stat=onproc flags process=10 proc=0 pri=50, usrpri=50, nice=20 forw=0xffffffffffffffff, list=0xffff8000fffeea88,0xffff8000fffef7b8 process=0xffff800021320448 user=0xffff80002130d000, vmspace=0xfffffd80707fde78 estcpu=0, cpticks=0, pctcpu=0.0 user=0, sys=0, intr=0 ddb{0}> ps PID TID PPID UID S FLAGS WAIT COMMAND 42939 107345 30801 0 2 0x100000 sh 25811 223726 81603 0 2 0x40 syz-executor.0 59619 201210 65969 32767 2 0x10 syz-executor.2 72098 417170 67518 32767 2 0x10 syz-executor.3 *42544 244266 39568 32767 7 0x10 syz-executor.4 30801 23212 95850 0 3 0x10008a sigsusp sh 44106 363126 45489 0 2 0x100002 ndp 54642 450160 54064 0 2 0x10008a sh 45489 389511 71840 0 3 0x10008a sigsusp sh 65969 154567 39959 32767 3 0x90 nanoslp syz-executor.2 67518 486701 34104 32767 2 0x10 syz-executor.3 39959 388430 60369 0 3 0x82 wait syz-executor.2 14362 195223 92774 0 7 0 syz-executor.7 34104 42708 60369 0 3 0x82 wait syz-executor.3 95850 462738 58846 0 3 0x80 wait syz-executor.6 92774 276536 60369 0 3 0x82 wait syz-executor.7 54064 204733 83303 0 3 0x80 wait syz-executor.5 58846 345862 60369 0 3 0x82 wait syz-executor.6 71840 102997 60633 0 3 0x80 wait syz-executor.1 83303 65210 60369 0 3 0x82 wait syz-executor.5 39568 8777 85753 32767 3 0x90 nanoslp syz-executor.4 85753 98652 60369 0 3 0x82 wait syz-executor.4 60633 242633 60369 0 3 0x82 wait syz-executor.1 81603 115953 18928 0 3 0x80 ppwait syz-executor.0 18928 488013 60369 0 3 0x82 wait syz-executor.0 60369 367621 83205 0 3 0x82 thrsleep syz-execprog 60369 104809 83205 0 3 0x4000082 nanoslp syz-execprog 60369 139889 83205 0 2 0x4000002 syz-execprog 60369 343207 83205 0 3 0x4000082 thrsleep syz-execprog 60369 318497 83205 0 3 0x4000082 kqread syz-execprog 60369 24754 83205 0 3 0x4000082 thrsleep syz-execprog 60369 192285 83205 0 3 0x4000082 thrsleep syz-execprog 60369 433615 83205 0 3 0x4000082 thrsleep syz-execprog 60369 516044 83205 0 3 0x4000082 thrsleep syz-execprog 83205 220389 63753 0 3 0x10008a sigsusp ksh 63753 100394 23321 0 3 0x9a kqread sshd 53059 228343 1 0 3 0x100083 ttyin getty 23321 426439 1 0 3 0x88 kqread sshd 64293 504500 88451 73 3 0x1100090 kqread syslogd 88451 32855 1 0 3 0x100082 netio syslogd 31818 404058 1 0 3 0x100080 kqread resolvd 12022 246026 50475 77 3 0x100092 kqread dhcpleased 21475 54179 50475 77 3 0x100092 kqread dhcpleased 50475 494969 1 0 3 0x80 kqread dhcpleased 1994 174787 0 0 3 0x14200 bored smr 16889 266448 0 0 2 0x14200 zerothread 95038 523777 0 0 3 0x14200 aiodoned aiodoned 35055 410411 0 0 3 0x14200 syncer update 48241 71444 0 0 3 0x14200 cleaner cleaner 89131 323800 0 0 3 0x14200 reaper reaper 18359 480393 0 0 3 0x14200 pgdaemon pagedaemon 3889 465382 0 0 3 0x14200 bored viomb 81238 22541 0 0 3 0x40014200 acpi0 acpi0 44579 431871 0 0 3 0x40014200 idle1 26714 430894 0 0 3 0x14200 bored softnet 62439 446148 0 0 3 0x14200 bored systqmp 4354 369994 0 0 3 0x14200 bored systq 13686 185875 0 0 3 0x40014200 bored softclock 18136 224009 0 0 3 0x40014200 idle0 1 183361 0 0 3 0x82 wait init 0 0 -1 0 3 0x10200 scheduler swapper ddb{0}> show all locks Process 42544 (syz-executor.4) thread 0xffff8000fffee548 (244266) shared rwlock vmmaplk r = 0 (0xfffffd80707fde90) #0 witness_lock+0x44d #1 uvm_vslock+0xc8 sys/uvm/uvm_glue.c:129 #2 sys_sysctl+0x2d8 sys/kern/kern_sysctl.c:240 #3 syscall+0x489 mi_syscall sys/sys/syscall_mi.h:102 [inline] #3 syscall+0x489 sys/arch/amd64/amd64/trap.c:585 #4 Xsyscall+0x128 exclusive rwlock sysctllk r = 0 (0xffffffff82941f10) #0 witness_lock+0x44d #1 rw_enter+0x3e1 sys/kern/kern_rwlock.c:310 #2 sys_sysctl+0x1b3 sys/kern/kern_sysctl.c:233 #3 syscall+0x489 mi_syscall sys/sys/syscall_mi.h:102 [inline] #3 syscall+0x489 sys/arch/amd64/amd64/trap.c:585 #4 Xsyscall+0x128 exclusive kernel_lock &kernel_lock r = 0 (0xffffffff829de988) #0 witness_lock+0x44d #1 syscall+0x3ef mi_syscall sys/sys/syscall_mi.h:93 [inline] #1 syscall+0x3ef sys/arch/amd64/amd64/trap.c:585 #2 Xsyscall+0x128 ddb{0}> show malloc Type InUse MemUse HighUse Limit Requests Type Lim devbuf 10167 6406K 6419K 78643K 11257 0 pcb 13 8K 8K 78643K 13 0 rtable 198 5K 6K 78643K 288 0 ifaddr 76 15K 15K 78643K 77 0 counters 56 35K 35K 78643K 56 0 ioctlops 0 0K 2K 78643K 31 0 mount 1 1K 1K 78643K 1 0 log 0 0K 0K 78643K 5 0 vnodes 1166 73K 73K 78643K 1179 0 UFS quota 1 32K 32K 78643K 1 0 UFS mount 5 36K 36K 78643K 5 0 shm 2 1K 1K 78643K 2 0 VM map 2 1K 1K 78643K 2 0 sem 2 0K 0K 78643K 2 0 dirhash 12 2K 2K 78643K 12 0 ACPI 1697 195K 286K 78643K 12548 0 file desc 27 101K 125K 78643K 133 0 proc 56 74K 111K 78643K 430 0 NFS srvsock 1 0K 0K 78643K 1 0 NFS daemon 1 16K 16K 78643K 1 0 in_multi 78 5K 5K 78643K 78 0 ether_multi 1 0K 0K 78643K 1 0 ISOFS mount 1 32K 32K 78643K 1 0 MSDOSFS mount 1 16K 16K 78643K 1 0 ttys 25 122K 122K 78643K 25 0 exec 0 0K 2K 78643K 586 0 tdb 3 0K 0K 78643K 3 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 221 73K 74K 78643K 2850 0 UVM aobj 3 2K 2K 78643K 3 0 memdesc 1 4K 4K 78643K 1 0 crypto data 1 1K 1K 78643K 1 0 NDP 23 1K 1K 78643K 23 0 temp 53 4692K 4753K 78643K 3886 0 kqueue 12 18K 18K 78643K 25 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 29 0 25 1 0 1 1 0 8 0 rtentry 112 91 0 1 3 0 3 3 0 8 0 unpcb 136 33 0 20 1 0 1 1 0 8 0 syncache 296 5 0 5 2 1 1 1 0 8 1 tcpcb 736 8 0 5 1 0 1 1 0 8 0 arp 120 16 0 0 1 0 1 1 0 8 0 inpcb 304 54 0 48 1 0 1 1 0 8 0 nd6 48 16 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 366 0 0 23 0 23 23 0 8 0 art_table 32 367 0 0 3 0 3 3 0 8 0 art_node 16 90 0 8 1 0 1 1 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino2pl 256 1472 0 48 89 0 89 89 0 8 0 ffsino 272 1472 0 48 95 0 95 95 0 8 0 nchpl 144 1719 0 57 62 0 62 62 0 8 0 uvmvnodes 80 1481 0 0 31 0 31 31 0 8 0 vnodes 224 1481 0 0 88 0 88 88 0 8 0 namei 1024 5587 0 5587 3 1 2 2 0 8 2 percpumem 16 40 0 0 1 0 1 1 0 8 0 scxspl 216 5490 0 5490 10 7 3 8 0 8 3 plimitpl 152 31 0 9 1 0 1 1 0 8 0 sigapl 424 409 0 356 7 0 7 7 0 8 0 knotepl 120 102 0 0 4 0 4 4 0 8 0 kqueuepl 216 21 0 13 1 0 1 1 0 8 0 pipepl 336 127 0 99 4 1 3 3 0 8 0 fdescpl 496 395 0 357 7 1 6 6 0 8 0 filepl 152 1378 0 1248 6 0 6 6 0 8 0 lockfpl 104 6 0 4 1 0 1 1 0 8 0 lockfspl 48 4 0 2 1 0 1 1 0 8 0 sessionpl 144 25 0 9 1 0 1 1 0 8 0 pgrppl 48 25 0 9 1 0 1 1 0 8 0 ucredpl 96 73 0 60 1 0 1 1 0 8 0 zombiepl 144 357 0 356 2 1 1 1 0 8 0 processpl 1064 409 0 356 5 1 4 4 0 8 0 procpl 672 417 0 356 6 0 6 6 0 8 0 sockpl 480 116 0 93 4 0 4 4 0 8 0 mcl8k 8192 3 0 0 1 0 1 1 0 8 0 mcl4k 4096 5 0 0 1 0 1 1 0 8 0 mcl2k 2048 73 0 0 10 1 9 10 0 8 0 mtagpl 96 1 0 0 1 0 1 1 0 8 0 mbufpl 256 282 0 0 16 0 16 16 0 8 0 bufpl 288 3549 0 142 244 0 244 244 0 8 0 anonpl 24 54954 0 49807 48 4 44 45 0 186 8 amapchunkpl 152 5748 0 5288 21 1 20 20 0 158 0 amappl16 200 217 0 137 6 1 5 5 0 8 0 amappl15 192 97 0 88 1 0 1 1 0 8 0 amappl14 184 17 0 13 1 0 1 1 0 8 0 amappl13 176 91 0 85 2 1 1 1 0 8 0 amappl12 168 14 0 12 2 1 1 1 0 8 0 amappl11 160 41 0 31 1 0 1 1 0 8 0 amappl10 152 37 0 33 1 0 1 1 0 8 0 amappl9 144 442 0 437 1 0 1 1 0 8 0 amappl8 136 526 0 496 2 0 2 2 0 8 0 amappl7 128 113 0 98 1 0 1 1 0 8 0 amappl6 120 231 0 207 2 0 2 2 0 8 1 amappl5 112 181 0 166 1 0 1 1 0 8 0 amappl4 104 772 0 744 2 0 2 2 0 8 1 amappl3 96 162 0 150 1 0 1 1 0 8 0 amappl2 88 507 0 463 3 0 3 3 0 8 1 amappl1 80 10464 0 9872 19 1 18 18 0 8 3 amappl 88 2463 0 2293 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 72 2 0 0 1 0 1 1 0 8 0 uaddrrnd 24 395 0 357 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 395 0 357 1 0 1 1 0 8 0 vmmpekpl 168 8140 0 8117 2 0 2 2 0 8 0 vmmpepl 168 36838 0 34877 96 2 94 94 0 357 2 vmsppl 368 394 0 357 4 0 4 4 0 8 0 rwobjpl 56 11778 0 9366 40 0 40 40 0 8 3 pdppl 4096 797 0 714 113 18 95 95 0 8 12 pvpl 32 230942 0 221483 262 3 259 259 0 265 174 pmappl 248 394 0 357 4 1 3 3 0 8 0 extentpl 40 58 0 38 1 0 1 1 0 8 0 phpool 112 611 0 23 17 0 17 17 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(fffffd806a474818,9,0) at witness_checkorder+0x10b7 witness_debugger sys/kern/subr_witness.c:2502 [inline] witness_checkorder(fffffd806a474818,9,0) at witness_checkorder+0x10b7 sys/kern/subr_witness.c:1105 rw_enter_write(fffffd806a474808) at rw_enter_write+0x5b sys/kern/kern_rwlock.c:128 fill_file(ffff800000bdb800,fffffd806c8b0b60,fffffd806a4747c0,0,0,ffff8000213229b0,38ee2f37d35d368f,4a00,0) at fill_file+0xad2 sys/kern/kern_sysctl.c:1304 sysctl_file(ffff800021312848,4,20000080,ffff800021312878,ffff8000fffee548) at sysctl_file+0x62d sys/kern/kern_sysctl.c:1457 kern_sysctl(ffff800021312844,5,20000080,ffff800021312878,0,0,2c4b0f4ebed7cead) at kern_sysctl+0xfd sys/kern/kern_sysctl.c:449 sys_sysctl(ffff8000fffee548,ffff8000213128e8,ffff800021312940) at sys_sysctl+0x209 sys/kern/kern_sysctl.c:249 syscall(ffff8000213129b0) at syscall+0x489 mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff8000213129b0) at syscall+0x489 sys/arch/amd64/amd64/trap.c:585 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x7f7ffffbdd70, count: -9 ddb{0}> machine ddbcpu 1 Stopped at x86_ipi_db+0x1a: addq $0x8,%rsp ddb{1}> trace x86_ipi_db(ffff800020ce8ff0) 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 __mp_lock(ffffffff829de780) at __mp_lock+0x122 __mp_lock_spin sys/kern/kern_lock.c:116 [inline] __mp_lock(ffffffff829de780) at __mp_lock+0x122 sys/kern/kern_lock.c:147 vn_read(fffffd806a5a2da8,ffff80002131e098,1) at vn_read+0x46 sys/kern/vfs_vnops.c:357 dofilereadv(ffff8000fffef268,3,ffff80002131e098,1,ffff80002131e190) at dofilereadv+0x19e sys/kern/sys_generic.c:253 sys_pread(ffff8000fffef268,ffff80002131e130,ffff80002131e190) at sys_pread+0x8f sys/kern/vfs_syscalls.c:3295 syscall(ffff80002131e200) at syscall+0x489 mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff80002131e200) at syscall+0x489 sys/arch/amd64/amd64/trap.c:585 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x7f7ffffe1930, count: -9 ddb{1}>