witness: lock order reversal: 1st 0xfffffd806e7c4638 fdlock (&newfdp->fd_fd.fd_lock) 2nd 0xfffffd807b075808 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:398 witness_checkorder(fffffd807b075808,9,0) at witness_checkorder+0x108b rw_enter(fffffd807b0757f8,1) at rw_enter+0xd4 rrw_enter(fffffd807b0757f8,1) at rrw_enter+0x88 sys/kern/kern_rwlock.c:461 VOP_LOCK(fffffd807014b9b8,2001) at VOP_LOCK+0x87 sys/kern/vfs_vops.c:614 vn_lock(fffffd807014b9b8,2001) at vn_lock+0x84 sys/kern/vfs_vnops.c:579 vget(fffffd807014b9b8,2001) at vget+0x1f7 sys/kern/vfs_subr.c:676 ktrwriteraw(ffff8000212687e0,fffffd807014b9b8,fffffd807f7d89c0,ffff8000212ad000,ffff8000212acfe0) at ktrwriteraw+0x138 sys/kern/kern_ktrace.c:659 ktrstruct(ffff8000212687e0,ffffffff823c1b4a,ffff8000212ad0e8,8) at ktrstruct+0x169 ktrwrite2 sys/kern/kern_ktrace.c:627 [inline] ktrstruct(ffff8000212687e0,ffffffff823c1b4a,ffff8000212ad0e8,8) at ktrstruct+0x169 sys/kern/kern_ktrace.c:311 sys_socketpair(ffff8000212687e0,ffff8000212ad158,ffff8000212ad1a0) at sys_socketpair+0x3ed sys/kern/uipc_syscalls.c:470 syscall(ffff8000212ad220) at syscall+0x5bf mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff8000212ad220) at syscall+0x5bf sys/arch/amd64/amd64/trap.c:585 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0xa596fd23710, count: -12 ddb{0}> show registers rdi 0xffff8000212ba000 rsi 0xdb37 __ALIGN_SIZE+0xcb37 rbp 0xffff8000212acc10 rbx 0x3 rdx 0xffff8000212ba000 rcx 0xdb36 __ALIGN_SIZE+0xcb36 rax 0xffffffff81b46ed7 db_enter+0x17 r8 0xffffffff81c4ab21 witness_checkorder+0x1061 r9 0x5 r10 0xa7af0d71b9f23e47 r11 0xd24f62c180e06eda r12 0 r13 0xfffffd807b075808 r14 0 r15 0xfffffd8002cfb740 rip 0xffffffff81b46ed8 db_enter+0x18 cs 0x8 rflags 0x246 rsp 0xffff8000212acc00 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb{0}> show proc PROC (syz-executor.0) pid=307220 stat=onproc flags process=0 proc=4000001 pri=32, usrpri=86, nice=20 forw=0xffffffffffffffff, list=0xffff800021268000,0xffffffff82948c08 process=0xffff800021224cb8 user=0xffff8000212a8000, vmspace=0xfffffd8071c708b8 estcpu=36, cpticks=0, pctcpu=0.0 user=0, sys=0, intr=0 ddb{0}> ps PID TID PPID UID S FLAGS WAIT COMMAND 29414 188356 70029 0 7 0x1 syz-executor.0 *29414 307220 70029 0 7 0x4000001 syz-executor.0 2232 311077 1 0 3 0x82 nanoslp getty 83375 51793 67690 0 3 0x82 nanoslp syz-executor.1 75207 321819 0 0 3 0x14200 bored sosplice 70029 114757 67690 0 3 0x82 nanoslp syz-executor.0 67690 392610 46080 0 3 0x82 thrsleep syz-fuzzer 67690 361927 46080 0 3 0x4000082 thrsleep syz-fuzzer 67690 399372 46080 0 3 0x4000082 kqread syz-fuzzer 67690 323733 46080 0 3 0x4000082 thrsleep syz-fuzzer 67690 450299 46080 0 3 0x4000082 thrsleep syz-fuzzer 67690 451597 46080 0 3 0x4000082 thrsleep syz-fuzzer 67690 419690 46080 0 3 0x4000082 thrsleep syz-fuzzer 67690 145264 46080 0 3 0x4000082 thrsleep syz-fuzzer 46080 302994 96556 0 3 0x10008a sigsusp ksh 96556 112814 89230 0 3 0x92 select sshd 89230 233036 1 0 3 0x80 select sshd 94593 24101 4837 74 3 0x100092 bpf pflogd 4837 334336 1 0 3 0x80 netio pflogd 69380 479021 35238 73 3 0x100090 kqread syslogd 35238 366513 1 0 3 0x100082 netio syslogd 79218 178332 1 77 3 0x100090 poll dhclient 61022 502957 1 0 3 0x80 poll dhclient 63383 425975 0 0 3 0x14200 bored smr 60014 461342 0 0 3 0x14200 pgzero zerothread 61222 28722 0 0 3 0x14200 aiodoned aiodoned 60551 349955 0 0 3 0x14200 syncer update 41370 174467 0 0 3 0x14200 cleaner cleaner 54556 251640 0 0 3 0x14200 reaper reaper 45512 490783 0 0 3 0x14200 pgdaemon pagedaemon 78805 340410 0 0 3 0x14200 bored crynlk 70184 265553 0 0 3 0x14200 bored crypto 42901 136893 0 0 3 0x14200 bored viomb 76518 377893 0 0 3 0x40014200 acpi0 acpi0 52150 58886 0 0 3 0x40014200 idle1 54502 312153 0 0 3 0x14200 bored softnet 97777 81517 0 0 3 0x14200 bored systqmp 2797 104505 0 0 3 0x14200 bored systq 3875 190314 0 0 3 0x40014200 bored softclock 79443 44484 0 0 3 0x40014200 idle0 1 93668 0 0 3 0x82 wait init 0 0 -1 0 3 0x10200 scheduler swapper ddb{0}> show all locks Process 29414 (syz-executor.0) thread 0xffff8000212687e0 (307220) exclusive kernel_lock &kernel_lock r = 0 (0xffffffff82826ca0) #0 witness_lock+0x4b0 stacktrace_save sys/sys/stacktrace.h:36 [inline] #0 witness_lock+0x4b0 sys/kern/subr_witness.c:1182 #1 ktrstruct+0xee #2 sys_socketpair+0x3ed sys/kern/uipc_syscalls.c:470 #3 syscall+0x5bf mi_syscall sys/sys/syscall_mi.h:102 [inline] #3 syscall+0x5bf sys/arch/amd64/amd64/trap.c:585 #4 Xsyscall+0x128 exclusive rwlock fdlock r = 0 (0xfffffd806e7c4638) #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+0x219 #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{0}> show malloc Type InUse MemUse HighUse Limit Requests Type Lim devbuf 10201 6520K 7215K 78643K 16094 0 pcb 13 8K 8K 78643K 356 0 rtable 109 4K 4K 78643K 739 0 ifaddr 87 16K 16K 78643K 290 0 sysctl 2 0K 0K 78643K 2 0 counters 44 34K 34K 78643K 126 0 ioctlops 0 0K 4K 78643K 1645 0 iov 0 0K 16K 78643K 125 0 mount 1 1K 1K 78643K 1 0 log 0 0K 0K 78643K 1 0 vnodes 1218 77K 77K 78643K 2840 0 UFS quota 1 32K 32K 78643K 1 0 UFS mount 5 36K 36K 78643K 5 0 shm 2 1K 5K 78643K 4 0 VM map 2 1K 1K 78643K 2 0 sem 11 0K 1K 78643K 165 0 dirhash 12 2K 2K 78643K 12 0 ACPI 1697 195K 286K 78643K 12598 0 file desc 5 13K 25K 78643K 5232 0 sigio 0 0K 0K 78643K 46 0 proc 62 63K 95K 78643K 898 0 subproc 32 2K 2K 78643K 90 0 NFS srvsock 1 0K 0K 78643K 1 0 NFS daemon 1 16K 16K 78643K 1 0 ip_moptions 0 0K 0K 78643K 198 0 in_multi 33 2K 2K 78643K 268 0 ether_multi 1 0K 0K 78643K 81 0 mrt 3 0K 0K 78643K 41 0 ISOFS mount 1 32K 32K 78643K 1 0 MSDOSFS mount 1 16K 16K 78643K 1 0 ttys 73 334K 334K 78643K 73 0 exec 0 0K 2K 78643K 565 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 253 240K 241K 78643K 64092 0 UVM aobj 11 2K 2K 78643K 50 0 memdesc 1 4K 4K 78643K 1 0 crypto data 1 1K 1K 78643K 1 0 ip6_options 0 0K 0K 78643K 197 0 NDP 16 0K 0K 78643K 67 0 temp 146 3983K 4048K 78643K 24392 0 kqueue 12 22K 30K 78643K 169 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 20 0 0 1 0 1 1 0 8 0 rtpcb 120 220 0 218 1 0 1 1 0 8 0 rtentry 112 80 0 36 2 0 2 2 0 8 0 unpcb 120 1010 0 992 2 1 1 2 0 8 0 syncache 296 34 0 34 4 3 1 1 0 8 1 tcpqe 32 9 0 9 2 2 0 1 0 8 0 tcpcb 736 571 0 567 21 19 2 4 0 8 1 arp 120 12 0 6 1 0 1 1 0 8 0 inpcb 304 1922 0 1916 6 4 2 2 0 8 1 rttmr 72 1 0 1 1 0 1 1 0 8 1 nd6 48 16 0 10 1 0 1 1 0 8 0 pkpcb 40 46 0 46 8 7 1 1 0 8 1 kcovpl 48 5 0 3 1 0 1 1 0 8 0 ppxss 1128 5 0 5 1 1 0 1 0 8 0 pfstscr 40 10 0 10 1 1 0 1 0 8 0 pffrag 232 5 0 5 1 1 0 1 0 482 0 pffrnode 88 5 0 5 1 1 0 1 0 8 0 pffrent 40 20 0 20 1 1 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 pfrktable 1344 2 0 2 1 1 0 1 0 8 0 pfstitem 24 72 0 54 1 0 1 1 0 8 0 pfstkey 112 82 0 64 1 0 1 1 0 8 0 pfstate 320 77 0 59 4 2 2 3 0 8 0 pfrule 1360 51 0 41 2 1 1 2 0 8 0 art_heap8 4096 1 0 0 1 0 1 1 0 8 0 art_heap4 256 345 0 154 13 1 12 13 0 8 0 art_table 32 346 0 154 2 0 2 2 0 8 0 art_node 16 79 0 39 1 0 1 1 0 8 0 sysvmsgpl 40 35 0 25 3 2 1 1 0 8 0 semupl 112 11 0 11 2 2 0 1 0 8 0 semapl 112 156 0 147 1 0 1 1 0 8 0 shmpl 112 47 0 39 2 1 1 1 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino2pl 256 8336 0 6932 89 0 89 89 0 8 0 ffsino 272 8336 0 6932 95 0 95 95 0 8 0 nchpl 144 14436 0 12838 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 35627 0 35627 4 3 1 1 0 8 1 percpumem 16 74 0 41 1 0 1 1 0 8 0 vcpupl 1984 17 0 0 3 0 3 3 0 8 0 vmpool 560 17 0 0 2 0 2 2 0 8 0 scxspl 216 42244 0 42244 10 9 1 8 0 8 1 plimitpl 152 120 0 112 1 0 1 1 0 8 0 sigapl 424 5444 0 5411 4 0 4 4 0 8 0 futexpl 56 35129 0 35129 3 2 1 1 0 8 1 knotepl 112 296 0 276 1 0 1 1 0 8 0 kqueuepl 168 2790 0 2777 2 1 1 2 0 8 0 pipepl 336 262 0 251 11 9 2 2 0 8 0 fdescpl 496 5425 0 5409 3 0 3 3 0 8 0 filepl 152 17513 0 17411 7 2 5 6 0 8 1 lockfpl 104 588 0 587 1 0 1 1 0 8 0 lockfspl 48 258 0 257 1 0 1 1 0 8 0 sessionpl 144 22 0 12 1 0 1 1 0 8 0 pgrppl 48 30 0 20 1 0 1 1 0 8 0 ucredpl 96 1948 0 1939 1 0 1 1 0 8 0 zombiepl 144 5411 0 5410 2 1 1 1 0 8 0 processpl 1080 5444 0 5410 3 0 3 3 0 8 0 procpl 672 11961 0 11919 6 2 4 5 0 8 0 sosppl 168 58 0 58 8 7 1 1 0 8 1 sockpl 480 3201 0 3173 13 8 5 7 0 8 0 mcl64k 65536 17 0 0 3 1 2 3 0 8 0 mcl16k 16384 17 0 0 3 0 3 3 0 8 0 mcl12k 12288 15 0 0 2 0 2 2 0 8 0 mcl9k 9216 15 0 0 2 0 2 2 0 8 0 mcl8k 8192 18 0 0 3 0 3 3 0 8 1 mcl4k 4096 17 0 0 3 0 3 3 0 8 0 mcl2k2 2112 3 0 0 1 0 1 1 0 8 0 mcl2k 2048 309 0 0 18 0 18 18 0 8 0 mtagpl 96 228 0 0 6 0 6 6 0 8 0 mbufpl 256 811 0 0 39 0 39 39 0 8 0 bufpl 280 9705 0 3441 448 0 448 448 0 8 0 anonpl 24 1380171 0 1372065 81 26 55 70 0 186 3 amapchunkpl 152 156756 0 156352 61 43 18 37 0 158 1 amappl16 200 10039 0 9814 25 11 14 19 0 8 2 amappl15 192 2060 0 2053 1 0 1 1 0 8 0 amappl14 184 2638 0 2636 1 0 1 1 0 8 0 amappl13 176 74 0 72 1 0 1 1 0 8 0 amappl12 168 48 0 41 1 0 1 1 0 8 0 amappl11 160 53 0 40 1 0 1 1 0 8 0 amappl10 152 581 0 570 1 0 1 1 0 8 0 amappl9 144 294 0 294 1 1 0 1 0 8 0 amappl8 136 469 0 392 3 0 3 3 0 8 0 amappl7 128 70 0 59 1 0 1 1 0 8 0 amappl6 120 680 0 660 1 0 1 1 0 8 0 amappl5 112 5304 0 5291 1 0 1 1 0 8 0 amappl4 104 693 0 662 1 0 1 1 0 8 0 amappl3 96 117 0 112 1 0 1 1 0 8 0 amappl2 88 3190 0 3141 2 0 2 2 0 8 0 amappl1 80 95274 0 94856 12 2 10 12 0 8 0 amappl 88 63591 0 63448 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 49 0 39 1 0 1 1 0 8 0 uaddrrnd 24 5442 0 5409 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 5442 0 5409 1 0 1 1 0 8 0 vmmpekpl 168 29933 0 29905 2 0 2 2 0 8 0 vmmpepl 168 607575 0 606042 91 17 74 77 0 357 2 vmsppl 368 5441 0 5409 4 0 4 4 0 8 0 rwobjpl 56 104977 0 104023 20 5 15 15 0 8 1 pdppl 4096 10891 0 10835 80 22 58 59 0 8 2 pvpl 32 3047170 0 3035782 239 134 105 128 0 265 8 pmappl 232 5441 0 5409 3 1 2 2 0 8 0 extentpl 40 58 0 40 1 0 1 1 0 8 0 phpool 112 395 0 58 11 1 10 10 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:398 witness_checkorder(fffffd807b075808,9,0) at witness_checkorder+0x108b rw_enter(fffffd807b0757f8,1) at rw_enter+0xd4 rrw_enter(fffffd807b0757f8,1) at rrw_enter+0x88 sys/kern/kern_rwlock.c:461 VOP_LOCK(fffffd807014b9b8,2001) at VOP_LOCK+0x87 sys/kern/vfs_vops.c:614 vn_lock(fffffd807014b9b8,2001) at vn_lock+0x84 sys/kern/vfs_vnops.c:579 vget(fffffd807014b9b8,2001) at vget+0x1f7 sys/kern/vfs_subr.c:676 ktrwriteraw(ffff8000212687e0,fffffd807014b9b8,fffffd807f7d89c0,ffff8000212ad000,ffff8000212acfe0) at ktrwriteraw+0x138 sys/kern/kern_ktrace.c:659 ktrstruct(ffff8000212687e0,ffffffff823c1b4a,ffff8000212ad0e8,8) at ktrstruct+0x169 ktrwrite2 sys/kern/kern_ktrace.c:627 [inline] ktrstruct(ffff8000212687e0,ffffffff823c1b4a,ffff8000212ad0e8,8) at ktrstruct+0x169 sys/kern/kern_ktrace.c:311 sys_socketpair(ffff8000212687e0,ffff8000212ad158,ffff8000212ad1a0) at sys_socketpair+0x3ed sys/kern/uipc_syscalls.c:470 syscall(ffff8000212ad220) at syscall+0x5bf mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff8000212ad220) at syscall+0x5bf sys/arch/amd64/amd64/trap.c:585 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0xa596fd23710, count: -12 ddb{0}> machine ddbcpu 1 Stopped at x86_ipi_db+0x1a: addq $0x8,%rsp ddb{1}> trace x86_ipi_db(ffff800020d58ff0) 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(ffffffff82826a98) at __mp_lock+0x122 __mp_lock_spin sys/kern/kern_lock.c:116 [inline] __mp_lock(ffffffff82826a98) at __mp_lock+0x122 sys/kern/kern_lock.c:147 ktrstruct(ffff800021268000,ffffffff823c9baf,ffff800022ce5758,10) at ktrstruct+0xee sys_clock_gettime(ffff800021268000,ffff800022ce57c0,ffff800022ce5810) at sys_clock_gettime+0xfb sys/kern/kern_time.c:171 syscall(ffff800022ce5890) at syscall+0x5bf mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff800022ce5890) at syscall+0x5bf sys/arch/amd64/amd64/trap.c:585 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x7f7ffffcf3f0, count: -8