witness: lock order reversal: 1st 0xfffffd806fd2c250 fdlock (&newfdp->fd_fd.fd_lock) 2nd 0xfffffd805b227810 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:440 witness_checkorder(fffffd805b227810,9,0) at witness_checkorder+0x10f3 witness_debugger sys/kern/subr_witness.c:2502 [inline] witness_checkorder(fffffd805b227810,9,0) at witness_checkorder+0x10f3 sys/kern/subr_witness.c:1105 rw_enter(fffffd805b227800,81) at rw_enter+0xd1 sys/kern/kern_rwlock.c:250 rrw_enter(fffffd805b227800,81) at rrw_enter+0x8b sys/kern/kern_rwlock.c:461 VOP_LOCK(fffffd806e3e0088,81) at VOP_LOCK+0x87 sys/kern/vfs_vops.c:614 vn_lock(fffffd806e3e0088,81) at vn_lock+0x84 sys/kern/vfs_vnops.c:579 uvn_get(fffffd806e3e5318,0,ffff800023089208,ffff8000230891d8,0,0,239b8fa72149c82e,ffffffff81bc1b50) at uvn_get+0x256 uvm_vnode_lock sys/uvm/uvm_vnode.c:1499 [inline] uvn_get(fffffd806e3e5318,0,ffff800023089208,ffff8000230891d8,0,0,239b8fa72149c82e,ffffffff81bc1b50) at uvn_get+0x256 sys/uvm/uvm_vnode.c:993 uvm_fault_lower(ffff800023089370,ffff8000230893a8,ffff8000230892f0,0) at uvm_fault_lower+0x302 sys/uvm/uvm_fault.c:1251 uvm_fault(fffffd806fd0d2e8,20000000,0,2) at uvm_fault+0x240 sys/uvm/uvm_fault.c:638 kpageflttrap(ffff800023089500,20000700) at kpageflttrap+0x1fd sys/arch/amd64/amd64/trap.c:264 kerntrap(ffff800023089500) at kerntrap+0xef sys/arch/amd64/amd64/trap.c:318 alltraps_kern_meltdown() at alltraps_kern_meltdown+0x7b copyout() at copyout+0x53 syscall(ffff800023089730) at syscall+0x5a9 mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff800023089730) at syscall+0x5a9 sys/arch/amd64/amd64/trap.c:587 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0xc37bc2d4200, count: -15 ddb{1}> show registers rdi 0xffff800021274000 rsi 0x6dd7 __ALIGN_SIZE+0x5dd7 rbp 0xffff800023088e80 rbx 0x3 rdx 0xffff800021274000 rcx 0x6dd6 __ALIGN_SIZE+0x5dd6 rax 0xffffffff81d23c57 db_enter+0x17 r8 0xffffffff8115c54c witness_checkorder+0x10cc r9 0x5 r10 0x80bd798f19fa4bcd r11 0x136c1db084012439 r12 0xfffffd8002db7880 r13 0 r14 0 r15 0 rip 0xffffffff81d23c58 db_enter+0x18 cs 0x8 rflags 0x246 rsp 0xffff800023088e70 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb{1}> show proc PROC (syz-executor.0) pid=326492 stat=onproc flags process=10 proc=4000000 pri=32, usrpri=86, nice=20 forw=0xffffffffffffffff, list=0xffff800021210fc8,0xffff800021211a58 process=0xffff8000ffff8008 user=0xffff800023084000, vmspace=0xfffffd806fd0d2e8 estcpu=36, cpticks=1, pctcpu=0.0 user=0, sys=0, intr=0 ddb{1}> ps PID TID PPID UID S FLAGS WAIT COMMAND 88237 116740 89665 32767 7 0x10 syz-executor.1 4392 189296 19432 32767 2 0x10 syz-executor.0 * 4392 326492 19432 32767 7 0x4000010 syz-executor.0 89665 462066 83876 32767 3 0x90 nanoslp syz-executor.1 19432 403846 48187 32767 3 0x90 nanoslp syz-executor.0 83876 272949 52471 0 3 0x82 wait syz-executor.1 48187 196928 52471 0 3 0x82 wait syz-executor.0 52471 307543 35382 0 3 0x82 thrsleep syz-fuzzer 52471 324 35382 0 3 0x4000082 nanoslp syz-fuzzer 52471 423418 35382 0 3 0x4000082 thrsleep syz-fuzzer 52471 433346 35382 0 3 0x4000082 kqread syz-fuzzer 52471 154275 35382 0 3 0x4000082 thrsleep syz-fuzzer 52471 210383 35382 0 3 0x4000082 thrsleep syz-fuzzer 52471 514198 35382 0 3 0x4000082 thrsleep syz-fuzzer 52471 101845 35382 0 3 0x4000082 thrsleep syz-fuzzer 35382 492649 96977 0 3 0x10008a sigsusp ksh 96977 496027 17281 0 3 0x9a select sshd 75526 159574 1 0 3 0x100083 ttyin getty 17281 308967 1 0 3 0x88 select sshd 14286 197796 59595 73 3 0x100090 kqread syslogd 59595 263320 1 0 3 0x100082 netio syslogd 11411 432493 1 0 3 0x100080 kqread resolvd 10172 417314 49644 77 3 0x100092 kqread dhcpleased 98501 439815 49644 77 3 0x100092 kqread dhcpleased 49644 224908 1 0 3 0x80 kqread dhcpleased 22404 394958 0 0 3 0x14200 bored smr 17091 474237 0 0 2 0x14200 zerothread 33159 169529 0 0 3 0x14200 aiodoned aiodoned 69964 499004 0 0 3 0x14200 syncer update 1589 58104 0 0 3 0x14200 cleaner cleaner 13066 477526 0 0 3 0x14200 reaper reaper 41902 315957 0 0 3 0x14200 pgdaemon pagedaemon 99909 102827 0 0 3 0x14200 bored crynlk 49271 303077 0 0 3 0x14200 bored crypto 83622 338807 0 0 3 0x14200 bored viomb 88831 214038 0 0 3 0x40014200 acpi0 acpi0 37991 427403 0 0 3 0x40014200 idle1 90254 23366 0 0 3 0x14200 bored softnet 52326 237283 0 0 3 0x14200 bored systqmp 45495 351559 0 0 3 0x14200 bored systq 70277 245384 0 0 3 0x40014200 bored softclock 69048 233132 0 0 3 0x40014200 idle0 1 356576 0 0 3 0x82 wait init 0 0 -1 0 3 0x10200 scheduler swapper ddb{1}> show all locks Process 4392 (syz-executor.0) thread 0xffff800021210548 (326492) exclusive kernel_lock &kernel_lock r = 0 (0xffffffff8290dec0) #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 (0xfffffd806fd2c250) #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{1}> show malloc Type InUse MemUse HighUse Limit Requests Type Lim devbuf 10115 6407K 6433K 78643K 11205 0 pcb 13 8K 8K 78643K 13 0 rtable 108 3K 3K 78643K 174 0 ifaddr 39 10K 10K 78643K 39 0 counters 44 34K 34K 78643K 44 0 ioctlops 0 0K 2K 78643K 430 0 iov 0 0K 12K 78643K 88 0 mount 1 1K 1K 78643K 1 0 log 0 0K 0K 78643K 6 0 vnodes 1216 76K 76K 78643K 1252 0 UFS quota 1 32K 32K 78643K 1 0 UFS mount 5 36K 36K 78643K 5 0 shm 2 1K 5K 78643K 13 0 VM map 2 1K 1K 78643K 2 0 sem 10 1K 1K 78643K 16 0 dirhash 12 2K 2K 78643K 12 0 ACPI 1697 195K 286K 78643K 12598 0 file desc 8 25K 33K 78643K 47656 0 sigio 0 0K 0K 78643K 2 0 proc 56 74K 99K 78643K 285 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 4 0 in_multi 33 2K 2K 78643K 35 0 ether_multi 1 0K 0K 78643K 2 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 395 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 540 64K 64K 78643K 572279 0 UVM aobj 16 2K 2K 78643K 25 0 memdesc 1 4K 4K 78643K 1 0 crypto data 1 1K 1K 78643K 1 0 NDP 5 0K 0K 78643K 9 0 temp 101 4209K 4273K 78643K 97422 0 kqueue 10 14K 19K 78643K 80 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 22 0 0 1 0 1 1 0 8 0 rtpcb 120 25 0 22 1 0 1 1 0 8 0 rtentry 112 46 0 1 2 0 2 2 0 8 0 unpcb 120 899 0 882 1 0 1 1 0 8 0 syncache 296 4 0 4 1 1 0 1 0 8 0 tcpqe 32 1799 0 1799 6 6 0 6 0 8 0 tcpcb 736 2947 0 2943 8 7 1 4 0 8 0 arp 120 6 0 0 1 0 1 1 0 8 0 inpcb 304 2998 0 2991 1 0 1 1 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 sysvmsgpl 40 5 0 5 1 1 0 1 0 8 0 semupl 112 2 0 2 1 1 0 1 0 8 0 semapl 112 11 0 3 1 0 1 1 0 8 0 shmpl 112 22 0 9 3 2 1 1 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino2pl 256 58398 0 56994 88 0 88 88 0 8 0 ffsino 272 58398 0 56994 95 1 94 94 0 8 0 nchpl 144 119746 0 118132 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 241976 0 241976 3 2 1 1 0 8 1 percpumem 16 34 0 0 1 0 1 1 0 8 0 scxspl 216 319043 0 319043 10 9 1 8 0 8 1 plimitpl 152 18 0 8 1 0 1 1 0 8 0 sigapl 424 47878 0 47843 5 1 4 5 0 8 0 futexpl 56 299868 0 299868 2 1 1 1 0 8 1 knotepl 112 56 0 0 2 0 2 2 0 8 0 kqueuepl 216 65697 0 65684 11 9 2 2 0 8 1 pipepl 336 2866 0 2856 23 21 2 2 0 8 1 fdescpl 496 47862 0 47843 3 0 3 3 0 8 0 filepl 152 153814 0 153700 5 0 5 5 0 8 0 lockfpl 104 17404 0 17402 1 0 1 1 0 8 0 lockfspl 48 8696 0 8694 1 0 1 1 0 8 0 sessionpl 144 17 0 7 1 0 1 1 0 8 0 pgrppl 48 17 0 7 1 0 1 1 0 8 0 ucredpl 96 1447 0 1435 1 0 1 1 0 8 0 zombiepl 144 47843 0 47843 3 2 1 1 0 8 1 processpl 1072 47878 0 47843 3 0 3 3 0 8 0 procpl 672 99380 0 99337 14 10 4 5 0 8 0 sockpl 480 3983 0 3956 30 25 5 5 0 8 1 mcl64k 65536 12 0 0 2 0 2 2 0 8 0 mcl16k 16384 5 0 0 1 0 1 1 0 8 0 mcl12k 12288 26 0 0 2 0 2 2 0 8 0 mcl9k 9216 17 0 0 2 0 2 2 0 8 0 mcl8k 8192 17 0 0 3 0 3 3 0 8 0 mcl4k 4096 33 0 0 4 1 3 3 0 8 0 mcl2k2 2112 33 0 0 2 0 2 2 0 8 0 mcl2k 2048 1061 0 0 118 80 38 118 0 8 0 mtagpl 96 2 0 0 1 0 1 1 0 8 0 mbufpl 256 1240 0 0 62 5 57 62 0 8 0 bufpl 280 51005 0 44673 453 0 453 453 0 8 0 anonpl 24 11880056 0 11804547 491 2 489 490 0 186 0 amapchunkpl 152 1327017 0 1324336 109 4 105 106 0 158 0 amappl16 200 74523 0 72019 132 0 132 132 0 8 0 amappl15 192 23831 0 23828 1 0 1 1 0 8 0 amappl14 184 6 0 3 1 0 1 1 0 8 0 amappl13 176 42 0 41 1 0 1 1 0 8 0 amappl12 168 14 0 12 1 0 1 1 0 8 0 amappl11 160 23847 0 23835 1 0 1 1 0 8 0 amappl10 152 35 0 29 1 0 1 1 0 8 0 amappl9 144 243 0 239 1 0 1 1 0 8 0 amappl8 136 398 0 332 3 0 3 3 0 8 0 amappl7 128 70 0 55 1 0 1 1 0 8 0 amappl6 120 115 0 101 1 0 1 1 0 8 0 amappl5 112 24051 0 24032 1 0 1 1 0 8 0 amappl4 104 48129 0 48099 1 0 1 1 0 8 0 amappl3 96 3195 0 3193 1 0 1 1 0 8 0 amappl2 88 837 0 785 2 0 2 2 0 8 0 amappl1 80 814672 0 814237 14 4 10 12 0 8 0 amappl 88 560241 0 559800 12 1 11 11 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 24 0 9 1 0 1 1 0 8 0 uaddrrnd 24 47862 0 47843 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 47862 0 47843 1 0 1 1 0 8 0 vmmpekpl 168 188302 0 188272 2 0 2 2 0 8 0 vmmpepl 168 5398745 0 5394440 312 123 189 278 0 357 1 vmsppl 368 47861 0 47843 2 0 2 2 0 8 0 rwobjpl 56 883063 0 879539 57 7 50 51 0 8 0 pdppl 4096 95732 0 95686 73 27 46 50 0 8 0 pvpl 32 25807094 0 25727893 690 8 682 687 0 265 0 pmappl 224 47861 0 47843 2 0 2 2 0 8 0 extentpl 40 58 0 40 1 0 1 1 0 8 0 phpool 112 501 0 146 13 0 13 13 0 8 0 ddb{1}> machine ddbcpu 0 Stopped at x86_ipi_db+0x1a: addq $0x8,%rsp ddb{0}> trace x86_ipi_db(ffffffff827ddff0) 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(ffffffff8290dcb8) at __mp_lock+0x122 __mp_lock_spin sys/kern/kern_lock.c:116 [inline] __mp_lock(ffffffff8290dcb8) 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 __mp_lock(ffffffff8290dcb8) at __mp_lock+0x122 __mp_lock_spin sys/kern/kern_lock.c:116 [inline] __mp_lock(ffffffff8290dcb8) at __mp_lock+0x122 sys/kern/kern_lock.c:147 syscall(ffff8000256b98e0) at syscall+0x42d mi_syscall sys/sys/syscall_mi.h:93 [inline] syscall(ffff8000256b98e0) at syscall+0x42d sys/arch/amd64/amd64/trap.c:587 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x7f7ffffe9500, count: -9 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:440 witness_checkorder(fffffd805b227810,9,0) at witness_checkorder+0x10f3 witness_debugger sys/kern/subr_witness.c:2502 [inline] witness_checkorder(fffffd805b227810,9,0) at witness_checkorder+0x10f3 sys/kern/subr_witness.c:1105 rw_enter(fffffd805b227800,81) at rw_enter+0xd1 sys/kern/kern_rwlock.c:250 rrw_enter(fffffd805b227800,81) at rrw_enter+0x8b sys/kern/kern_rwlock.c:461 VOP_LOCK(fffffd806e3e0088,81) at VOP_LOCK+0x87 sys/kern/vfs_vops.c:614 vn_lock(fffffd806e3e0088,81) at vn_lock+0x84 sys/kern/vfs_vnops.c:579 uvn_get(fffffd806e3e5318,0,ffff800023089208,ffff8000230891d8,0,0,239b8fa72149c82e,ffffffff81bc1b50) at uvn_get+0x256 uvm_vnode_lock sys/uvm/uvm_vnode.c:1499 [inline] uvn_get(fffffd806e3e5318,0,ffff800023089208,ffff8000230891d8,0,0,239b8fa72149c82e,ffffffff81bc1b50) at uvn_get+0x256 sys/uvm/uvm_vnode.c:993 uvm_fault_lower(ffff800023089370,ffff8000230893a8,ffff8000230892f0,0) at uvm_fault_lower+0x302 sys/uvm/uvm_fault.c:1251 uvm_fault(fffffd806fd0d2e8,20000000,0,2) at uvm_fault+0x240 sys/uvm/uvm_fault.c:638 kpageflttrap(ffff800023089500,20000700) at kpageflttrap+0x1fd sys/arch/amd64/amd64/trap.c:264 kerntrap(ffff800023089500) at kerntrap+0xef sys/arch/amd64/amd64/trap.c:318 alltraps_kern_meltdown() at alltraps_kern_meltdown+0x7b copyout() at copyout+0x53 syscall(ffff800023089730) at syscall+0x5a9 mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff800023089730) at syscall+0x5a9 sys/arch/amd64/amd64/trap.c:587 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0xc37bc2d4200, count: -15