login: witness: lock order reversal: 1st 0xfffffd8078de3258 fdlock (&newfdp->fd_fd.fd_lock) 2nd 0xfffffd806d6f13d8 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{1}> ddb{1}> set $lines = 0 ddb{1}> set $maxwidth = 0 ddb{1}> show panic the kernel did not panic ddb{1}> trace db_enter() at db_enter+0x18 sys/arch/amd64/amd64/db_interface.c:398 witness_checkorder(fffffd806d6f13d8,9,0) at witness_checkorder+0x108b rw_enter(fffffd806d6f13c8,81) at rw_enter+0xd4 rrw_enter(fffffd806d6f13c8,81) at rrw_enter+0x88 sys/kern/kern_rwlock.c:461 VOP_LOCK(fffffd8078819ea0,81) at VOP_LOCK+0x87 sys/kern/vfs_vops.c:614 vn_lock(fffffd8078819ea0,81) at vn_lock+0x84 sys/kern/vfs_vnops.c:579 uvn_get(fffffd806ce810f0,0,ffff80002126ec08,ffff80002126ebd8,0,2) at uvn_get+0x276 uvm_vnode_lock sys/uvm/uvm_vnode.c:1499 [inline] uvn_get(fffffd806ce810f0,0,ffff80002126ec08,ffff80002126ebd8,0,2) at uvn_get+0x276 sys/uvm/uvm_vnode.c:993 uvm_fault_lower(ffff80002126ed70,ffff80002126eda8,ffff80002126ecf0,0) at uvm_fault_lower+0x302 sys/uvm/uvm_fault.c:1251 uvm_fault(fffffd807f00aa10,20000000,0,2) at uvm_fault+0x256 sys/uvm/uvm_fault.c:638 kpageflttrap(ffff80002126ef00,20000040) at kpageflttrap+0x1fd sys/arch/amd64/amd64/trap.c:262 kerntrap(ffff80002126ef00) at kerntrap+0xef sys/arch/amd64/amd64/trap.c:316 alltraps_kern_meltdown() at alltraps_kern_meltdown+0x7b copyout() at copyout+0x53 syscall(ffff80002126f130) at syscall+0x5bf mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff80002126f130) at syscall+0x5bf sys/arch/amd64/amd64/trap.c:585 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x2229aa33480, count: -15 ddb{1}> show registers rdi 0x3 rsi 0xffffffff82701ff0 __sancov_gen_cov_switch_values.134 rbp 0xffff80002126e880 rbx 0x3 rdx 0x8b rcx 0x3 rax 0x1 r8 0xffffffff8157e211 witness_checkorder+0x1061 r9 0x5 r10 0xa5633de55a00ae8 r11 0xe65e1acd83735101 r12 0 r13 0xfffffd806d6f13d8 r14 0 r15 0xfffffd8002cfa740 rip 0xffffffff8215de78 db_enter+0x18 cs 0x8 rflags 0x246 rsp 0xffff80002126e870 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb{1}> show proc PROC (syz-executor1318) pid=437562 stat=onproc flags process=0 proc=4000000 pri=17, usrpri=86, nice=20 forw=0xffffffffffffffff, list=0xffff8000211b2548,0xffff8000211ffcf0 process=0xffff800021225528 user=0xffff80002126a000, vmspace=0xfffffd807f00aa10 estcpu=36, cpticks=0, pctcpu=0.0 user=0, sys=0, intr=0 ddb{1}> ps PID TID PPID UID S FLAGS WAIT COMMAND 18658 367970 33679 0 2 0 syz-executor1318 18658 147011 33679 0 2 0x4000000 syz-executor1318 18658 279271 33679 0 2 0x4000000 syz-executor1318 81172 122678 68255 0 7 0 syz-executor1318 81172 120155 68255 0 2 0x4000000 syz-executor1318 *81172 437562 68255 0 7 0x4000000 syz-executor1318 68255 204459 26179 0 3 0x80 nanoslp syz-executor1318 33679 41886 26179 0 3 0x80 nanoslp syz-executor1318 26179 435943 34781 0 3 0x82 nanoslp syz-executor1318 34781 106065 75170 0 3 0x10008a sigsusp ksh 75170 13804 62453 0 3 0x92 select sshd 84191 8621 1 0 3 0x100083 ttyin getty 62453 515962 1 0 3 0x80 select sshd 5006 457843 94027 74 3 0x100092 bpf pflogd 94027 361569 1 0 3 0x80 netio pflogd 78923 452222 47376 73 3 0x100090 kqread syslogd 47376 314832 1 0 3 0x100082 netio syslogd 42503 373725 1 77 3 0x100090 poll dhclient 96507 362896 1 0 3 0x80 poll dhclient 61410 167439 0 0 3 0x14200 bored smr 56402 233381 0 0 2 0x14200 zerothread 75076 500739 0 0 3 0x14200 aiodoned aiodoned 94364 509141 0 0 3 0x14200 syncer update 4182 18791 0 0 3 0x14200 cleaner cleaner 25683 369622 0 0 3 0x14200 reaper reaper 69374 20730 0 0 3 0x14200 pgdaemon pagedaemon 24845 41843 0 0 3 0x14200 bored crynlk 13311 474656 0 0 3 0x14200 bored crypto 16610 314362 0 0 3 0x14200 bored viomb 38177 462861 0 0 3 0x40014200 acpi0 acpi0 25468 378697 0 0 3 0x40014200 idle1 21756 25469 0 0 3 0x14200 bored softnet 24875 110186 0 0 3 0x14200 bored systqmp 55786 27774 0 0 3 0x14200 bored systq 9218 518078 0 0 3 0x40014200 bored softclock 72794 155600 0 0 3 0x40014200 idle0 1 275794 0 0 3 0x82 wait init 0 0 -1 0 3 0x10200 scheduler swapper ddb{1}> show all locks Process 81172 (syz-executor1318) thread 0xffff8000ffff7cf0 (437562) exclusive kernel_lock &kernel_lock r = 0 (0xffffffff828b2e60) #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 (0xfffffd8078de3258) #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+0x5bf mi_syscall sys/sys/syscall_mi.h:102 [inline] #2 syscall+0x5bf sys/arch/amd64/amd64/trap.c:585 #3 Xsyscall+0x128 ddb{1}> show malloc Type InUse MemUse HighUse Limit Requests Type Lim devbuf 10112 6476K 6477K 78643K 11202 0 pcb 13 8K 8K 78643K 13 0 rtable 61 2K 2K 78643K 119 0 ifaddr 29 8K 8K 78643K 30 0 counters 40 33K 33K 78643K 40 0 ioctlops 0 0K 4K 78643K 1467 0 mount 1 1K 1K 78643K 1 0 log 0 0K 0K 78643K 1 0 vnodes 1183 74K 75K 78643K 1221 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 12598 0 file desc 1 0K 0K 78643K 1 0 proc 59 63K 71K 78643K 357 0 NFS srvsock 1 0K 0K 78643K 1 0 NFS daemon 1 16K 16K 78643K 1 0 in_multi 11 0K 0K 78643K 11 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 19 95K 95K 78643K 19 0 exec 0 0K 2K 78643K 300 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 99 4K 5K 78643K 1834 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 4 0K 0K 78643K 4 0 temp 23 3969K 4033K 78643K 1745 0 kqueue 2 2K 2K 78643K 2 0 SYN cache 2 16K 16K 78643K 2 0 ddb{1}> 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 15 0 13 1 0 1 1 0 8 0 rtentry 112 23 0 1 1 0 1 1 0 8 0 unpcb 120 163 0 151 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 2 0 0 1 0 1 1 0 8 0 inpcb 304 28 0 23 1 0 1 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 9 0 2 1 0 1 1 0 8 0 pfstkey 112 9 0 2 1 0 1 1 0 8 0 pfstate 320 9 0 2 1 0 1 1 0 8 0 pfrule 1360 21 0 16 2 1 1 2 0 8 0 art_heap8 4096 1 0 0 1 0 1 1 0 8 0 art_heap4 256 97 0 0 7 0 7 7 0 8 0 art_table 32 98 0 0 1 0 1 1 0 8 0 art_node 16 22 0 2 1 0 1 1 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino2pl 256 1504 0 115 87 0 87 87 0 8 0 ffsino 272 1504 0 115 93 0 93 93 0 8 0 nchpl 144 1715 0 167 58 0 58 58 0 8 0 uvmvnodes 72 1514 0 0 28 0 28 28 0 8 0 vnodes 224 1514 0 0 90 0 90 90 0 8 0 namei 1024 4052 0 4052 2 1 1 1 0 8 1 percpumem 16 31 0 0 1 0 1 1 0 8 0 scxspl 216 3974 0 3974 11 10 1 8 0 8 1 plimitpl 152 14 0 8 1 0 1 1 0 8 0 sigapl 424 257 0 224 4 0 4 4 0 8 0 futexpl 56 75 0 75 1 0 1 1 0 8 1 knotepl 112 5 0 0 1 0 1 1 0 8 0 kqueuepl 168 1 0 0 1 0 1 1 0 8 0 pipepl 336 64 0 60 2 1 1 1 0 8 0 fdescpl 496 241 0 224 3 0 3 3 0 8 0 filepl 152 1091 0 1041 2 0 2 2 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 18 0 9 1 0 1 1 0 8 0 pgrppl 48 18 0 9 1 0 1 1 0 8 0 ucredpl 96 62 0 53 1 0 1 1 0 8 0 zombiepl 144 224 0 224 2 1 1 1 0 8 1 processpl 1080 257 0 224 3 0 3 3 0 8 0 procpl 672 296 0 259 4 0 4 4 0 8 0 sockpl 480 206 0 187 4 1 3 3 0 8 0 mcl8k 8192 3 0 0 1 0 1 1 0 8 0 mcl2k 2048 82 0 0 11 0 11 11 0 8 0 mtagpl 96 1 0 0 1 0 1 1 0 8 0 mbufpl 256 127 0 0 7 0 7 7 0 8 0 bufpl 280 2056 0 90 141 0 141 141 0 8 0 anonpl 24 35780 0 33232 18 2 16 16 0 186 0 amapchunkpl 152 3504 0 3322 9 1 8 8 0 158 1 amappl16 200 66 0 62 1 0 1 1 0 8 0 amappl15 192 51 0 46 1 0 1 1 0 8 0 amappl13 176 14 0 13 2 1 1 1 0 8 0 amappl12 168 27 0 24 1 0 1 1 0 8 0 amappl11 160 44 0 32 1 0 1 1 0 8 0 amappl10 152 6 0 2 1 0 1 1 0 8 0 amappl9 144 241 0 241 3 2 1 1 0 8 1 amappl8 136 240 0 235 1 0 1 1 0 8 0 amappl7 128 36 0 32 1 0 1 1 0 8 0 amappl6 120 82 0 73 1 0 1 1 0 8 0 amappl5 112 137 0 127 1 0 1 1 0 8 0 amappl4 104 504 0 482 1 0 1 1 0 8 0 amappl3 96 68 0 62 1 0 1 1 0 8 0 amappl2 88 345 0 306 1 0 1 1 0 8 0 amappl1 80 7038 0 6644 12 3 9 9 0 8 0 amappl 88 1628 0 1548 2 0 2 2 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 2 0 0 1 0 1 1 0 8 0 uaddrrnd 24 241 0 224 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 241 0 224 1 0 1 1 0 8 0 vmmpekpl 168 5592 0 5575 1 0 1 1 0 8 0 vmmpepl 168 21769 0 20802 46 3 43 43 0 357 0 vmsppl 368 240 0 224 2 0 2 2 0 8 0 rwobjpl 56 6618 0 6085 10 2 8 8 0 8 0 pdppl 4096 489 0 448 59 18 41 41 0 8 0 pvpl 32 107277 0 102784 44 7 37 37 0 265 0 pmappl 232 240 0 224 1 0 1 1 0 8 0 extentpl 40 58 0 40 1 0 1 1 0 8 0 phpool 112 281 0 23 8 0 8 8 0 8 0 ddb{1}> machine ddbcpu 0 Stopped at x86_ipi_db+0x1a: addq $0x8,%rsp ddb{0}> trace x86_ipi_db(ffffffff8270cff0) 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 __mp_lock(ffffffff828b2c58) at __mp_lock+0x122 __mp_lock_spin sys/kern/kern_lock.c:116 [inline] __mp_lock(ffffffff828b2c58) at __mp_lock+0x122 sys/kern/kern_lock.c:147 softintr_dispatch(0) at softintr_dispatch+0x4e sys/arch/amd64/amd64/softintr.c:90 Xsoftclock() at Xsoftclock+0x1f end of kernel end trace frame: 0x7f7ffffe8bd0, count: -6 ddb{0}> machine ddbcpu 1 Stopped at db_enter+0x18: addq $0x8,%rsp ddb{1}> trace db_enter() at db_enter+0x18 sys/arch/amd64/amd64/db_interface.c:398 witness_checkorder(fffffd806d6f13d8,9,0) at witness_checkorder+0x108b rw_enter(fffffd806d6f13c8,81) at rw_enter+0xd4 rrw_enter(fffffd806d6f13c8,81) at rrw_enter+0x88 sys/kern/kern_rwlock.c:461 VOP_LOCK(fffffd8078819ea0,81) at VOP_LOCK+0x87 sys/kern/vfs_vops.c:614 vn_lock(fffffd8078819ea0,81) at vn_lock+0x84 sys/kern/vfs_vnops.c:579 uvn_get(fffffd806ce810f0,0,ffff80002126ec08,ffff80002126ebd8,0,2) at uvn_get+0x276 uvm_vnode_lock sys/uvm/uvm_vnode.c:1499 [inline] uvn_get(fffffd806ce810f0,0,ffff80002126ec08,ffff80002126ebd8,0,2) at uvn_get+0x276 sys/uvm/uvm_vnode.c:993 uvm_fault_lower(ffff80002126ed70,ffff80002126eda8,ffff80002126ecf0,0) at uvm_fault_lower+0x302 sys/uvm/uvm_fault.c:1251 uvm_fault(fffffd807f00aa10,20000000,0,2) at uvm_fault+0x256 sys/uvm/uvm_fault.c:638 kpageflttrap(ffff80002126ef00,20000040) at kpageflttrap+0x1fd sys/arch/amd64/amd64/trap.c:262 kerntrap(ffff80002126ef00) at kerntrap+0xef sys/arch/amd64/amd64/trap.c:316 alltraps_kern_meltdown() at alltraps_kern_meltdown+0x7b copyout() at copyout+0x53 syscall(ffff80002126f130) at syscall+0x5bf mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff80002126f130) at syscall+0x5bf sys/arch/amd64/amd64/trap.c:585 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x2229aa33480, count: -15 ddb{1}>