witness: lock order reversal: 1st 0xfffffd807c362638 fdlock (&newfdp->fd_fd.fd_lock) 2nd 0xfffffd807e3b6d60 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(fffffd807e3b6d60,9,0) at witness_checkorder+0x108b rw_enter(fffffd807e3b6d50,1) at rw_enter+0xd4 rrw_enter(fffffd807e3b6d50,1) at rrw_enter+0x88 sys/kern/kern_rwlock.c:461 VOP_LOCK(fffffd807c038598,2001) at VOP_LOCK+0x87 sys/kern/vfs_vops.c:614 vn_lock(fffffd807c038598,2001) at vn_lock+0x84 sys/kern/vfs_vnops.c:579 vget(fffffd807c038598,2001) at vget+0x1f7 sys/kern/vfs_subr.c:676 ktrwriteraw(ffff800021271500,fffffd807c038598,fffffd807f7d8840,ffff800021287a40,ffff800021287a20) at ktrwriteraw+0x138 sys/kern/kern_ktrace.c:659 ktrstruct(ffff800021271500,ffffffff823b7133,ffff800021287b28,8) at ktrstruct+0x169 ktrwrite2 sys/kern/kern_ktrace.c:627 [inline] ktrstruct(ffff800021271500,ffffffff823b7133,ffff800021287b28,8) at ktrstruct+0x169 sys/kern/kern_ktrace.c:311 sys_socketpair(ffff800021271500,ffff800021287b98,ffff800021287be0) at sys_socketpair+0x3ed sys/kern/uipc_syscalls.c:470 syscall(ffff800021287c60) at syscall+0x5bf mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff800021287c60) at syscall+0x5bf sys/arch/amd64/amd64/trap.c:590 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0xd66e17bd0, count: -12 ddb{0}> show registers rdi 0xffff8000220bc000 rsi 0xcde6 __ALIGN_SIZE+0xbde6 rbp 0xffff800021287650 rbx 0x3 rdx 0xffff8000220bc000 rcx 0xcde5 __ALIGN_SIZE+0xbde5 rax 0xffffffff818b1127 db_enter+0x17 r8 0xffffffff81dbb831 witness_checkorder+0x1061 r9 0x5 r10 0x1bcc6567bd1774d1 r11 0xc94e9e5a30095919 r12 0 r13 0xfffffd807e3b6d60 r14 0 r15 0xfffffd8002cf96c0 rip 0xffffffff818b1128 db_enter+0x18 cs 0x8 rflags 0x246 rsp 0xffff800021287640 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb{0}> show proc PROC (syz-executor.0) pid=354255 stat=onproc flags process=0 proc=4000001 pri=32, usrpri=80, nice=20 forw=0xffffffffffffffff, list=0xffff800021270a80,0xffff800021271270 process=0xffff800021224448 user=0xffff800021282000, vmspace=0xfffffd80084d6b80 estcpu=36, cpticks=0, pctcpu=0.0 user=0, sys=0, intr=0 ddb{0}> ps PID TID PPID UID S FLAGS WAIT COMMAND 99788 502826 31233 0 2 0 syz-executor.1 99788 23290 31233 0 2 0x4000000 syz-executor.1 58932 471643 71376 0 7 0 syz-executor.0 *58932 354255 71376 0 7 0x4000001 syz-executor.0 58932 425252 71376 0 3 0x4000080 fsleep syz-executor.0 71376 498457 77073 0 3 0x82 nanoslp syz-executor.0 11557 515003 0 0 3 0x14200 bored sosplice 31233 305744 77073 0 3 0x82 nanoslp syz-executor.1 77073 141379 67790 0 3 0x82 thrsleep syz-fuzzer 77073 482914 67790 0 3 0x4000082 thrsleep syz-fuzzer 77073 148726 67790 0 3 0x4000082 thrsleep syz-fuzzer 77073 248844 67790 0 3 0x4000082 thrsleep syz-fuzzer 77073 415715 67790 0 3 0x4000082 thrsleep syz-fuzzer 77073 215595 67790 0 3 0x4000082 thrsleep syz-fuzzer 77073 262415 67790 0 3 0x4000082 thrsleep syz-fuzzer 77073 136078 67790 0 3 0x4000082 kqread syz-fuzzer 67790 134832 59811 0 3 0x10008a sigsusp ksh 59811 341016 88135 0 3 0x92 select sshd 63631 107689 1 0 3 0x100083 ttyin getty 88135 252622 1 0 3 0x80 select sshd 19089 212267 76641 74 3 0x100092 bpf pflogd 76641 351383 1 0 3 0x80 netio pflogd 13163 66057 65387 73 3 0x100090 kqread syslogd 65387 76439 1 0 3 0x100082 netio syslogd 61458 452614 1 77 3 0x100090 poll dhclient 2707 455494 1 0 3 0x80 poll dhclient 15601 324628 0 0 3 0x14200 bored smr 73877 58015 0 0 2 0x14200 zerothread 26132 197082 0 0 3 0x14200 aiodoned aiodoned 26889 268378 0 0 3 0x14200 syncer update 1813 370316 0 0 3 0x14200 cleaner cleaner 6633 338343 0 0 3 0x14200 reaper reaper 62955 52642 0 0 3 0x14200 pgdaemon pagedaemon 94198 414083 0 0 3 0x14200 bored crynlk 67975 150148 0 0 3 0x14200 bored crypto 44357 216450 0 0 3 0x14200 bored viomb 90156 414725 0 0 3 0x40014200 acpi0 acpi0 69907 413200 0 0 3 0x40014200 idle1 12407 254554 0 0 3 0x14200 bored softnet 60514 133187 0 0 3 0x14200 bored systqmp 8992 105010 0 0 3 0x14200 bored systq 79227 112519 0 0 3 0x40014200 bored softclock 59762 352626 0 0 3 0x40014200 idle0 1 466192 0 0 3 0x82 wait init 0 0 -1 0 3 0x10200 scheduler swapper ddb{0}> show all locks Process 58932 (syz-executor.0) thread 0xffff800021271500 (354255) exclusive kernel_lock &kernel_lock r = 0 (0xffffffff828025a8) #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:590 #4 Xsyscall+0x128 exclusive rwlock fdlock r = 0 (0xfffffd807c362638) #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:590 #3 Xsyscall+0x128 ddb{0}> show malloc Type InUse MemUse HighUse Limit Requests Type Lim devbuf 10131 6486K 7191K 78643K 13772 0 pcb 13 8K 8K 78643K 129 0 rtable 108 3K 4K 78643K 583 0 ifaddr 49 11K 11K 78643K 72 0 counters 44 34K 34K 78643K 50 0 ioctlops 0 0K 4K 78643K 1536 0 iov 0 0K 2K 78643K 24 0 mount 1 1K 1K 78643K 1 0 log 0 0K 0K 78643K 1 0 vnodes 1225 77K 77K 78643K 2081 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 11 1K 1K 78643K 17 0 dirhash 12 2K 2K 78643K 12 0 ACPI 1697 195K 286K 78643K 12598 0 file desc 6 17K 25K 78643K 1986 0 proc 62 63K 95K 78643K 700 0 subproc 32 2K 2K 78643K 85 0 NFS srvsock 1 0K 0K 78643K 1 0 NFS daemon 1 16K 16K 78643K 1 0 ip_moptions 0 0K 0K 78643K 52 0 in_multi 33 2K 2K 78643K 83 0 ether_multi 1 0K 0K 78643K 9 0 mrt 0 0K 0K 78643K 112 0 ISOFS mount 1 32K 32K 78643K 1 0 MSDOSFS mount 1 16K 16K 78643K 1 0 ttys 49 228K 228K 78643K 49 0 exec 0 0K 2K 78643K 539 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 205 27K 28K 78643K 24800 0 UVM aobj 3 2K 2K 78643K 3 0 memdesc 1 4K 4K 78643K 1 0 crypto data 1 1K 1K 78643K 1 0 ip6_options 0 0K 0K 78643K 81 0 NDP 7 0K 0K 78643K 20 0 temp 111 3981K 4045K 78643K 20155 0 kqueue 3 4K 9K 78643K 46 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 111 0 109 1 0 1 1 0 8 0 rtentry 112 135 0 91 2 0 2 2 0 8 0 unpcb 120 255 0 241 1 0 1 1 0 8 0 syncache 296 37 0 37 3 3 0 1 0 8 0 tcpqe 32 16 0 16 2 2 0 1 0 8 0 tcpcb 736 282 0 278 4 3 1 3 0 8 0 arp 120 13 0 7 1 0 1 1 0 8 0 inpcb 304 769 0 763 2 1 1 2 0 8 0 rttmr 72 56 0 56 2 2 0 1 0 8 0 nd6 48 15 0 9 1 0 1 1 0 8 0 pkpcb 40 15 0 15 2 1 1 1 0 8 1 kcovpl 48 5 0 3 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 49 0 19 1 0 1 1 0 8 0 pfstkey 112 49 0 19 2 0 2 2 0 8 0 pfstate 320 49 0 19 4 0 4 4 0 8 0 pfrule 1360 38 0 32 2 1 1 2 0 8 0 art_heap8 4096 1 0 0 1 0 1 1 0 8 0 art_heap4 256 322 0 133 12 0 12 12 0 8 0 art_table 32 323 0 133 2 0 2 2 0 8 0 art_node 16 134 0 94 1 0 1 1 0 8 0 sysvmsgpl 40 38 0 20 1 0 1 1 0 8 0 semupl 112 5 0 5 1 1 0 1 0 8 0 semapl 112 9 0 0 1 0 1 1 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino2pl 256 3743 0 2334 90 1 89 89 0 8 0 ffsino 272 3743 0 2334 95 0 95 95 0 8 0 nchpl 144 6214 0 4625 60 0 60 60 0 8 0 uvmvnodes 72 4493 0 0 82 0 82 82 0 8 0 vnodes 224 4493 0 0 265 0 265 265 0 8 0 namei 1024 16081 0 16081 1 0 1 1 0 8 1 percpumem 16 36 0 3 1 0 1 1 0 8 0 vmpool 560 4 0 4 1 1 0 1 0 8 0 scxspl 216 17876 0 17876 9 8 1 8 0 8 1 plimitpl 152 22 0 14 1 0 1 1 0 8 0 sigapl 424 2193 0 2159 4 0 4 4 0 8 0 futexpl 56 13757 0 13756 1 0 1 1 0 8 0 knotepl 112 160 0 140 1 0 1 1 0 8 0 kqueuepl 168 836 0 834 1 0 1 1 0 8 0 pipepl 336 104 0 93 3 2 1 2 0 8 0 fdescpl 496 2176 0 2159 3 0 3 3 0 8 0 filepl 152 7361 0 7256 5 0 5 5 0 8 0 lockfpl 104 61 0 60 1 0 1 1 0 8 0 lockfspl 48 19 0 18 1 0 1 1 0 8 0 sessionpl 144 21 0 10 1 0 1 1 0 8 0 pgrppl 48 37 0 26 1 0 1 1 0 8 0 ucredpl 96 1033 0 1024 1 0 1 1 0 8 0 zombiepl 144 2159 0 2159 1 0 1 1 0 8 1 processpl 1080 2193 0 2159 3 0 3 3 0 8 0 procpl 672 4514 0 4470 4 0 4 4 0 8 0 sosppl 168 44 0 44 2 1 1 1 0 8 1 sockpl 432 1150 0 1128 3 0 3 3 0 8 0 mcl64k 65536 7 0 0 1 0 1 1 0 8 0 mcl16k 16384 6 0 0 1 0 1 1 0 8 0 mcl9k 9216 3 0 0 1 0 1 1 0 8 0 mcl8k 8192 3 0 0 1 0 1 1 0 8 0 mcl4k 4096 17 0 0 3 0 3 3 0 8 0 mcl2k2 2112 2 0 0 1 0 1 1 0 8 0 mcl2k 2048 172 0 0 16 0 16 16 0 8 0 mtagpl 96 103 0 0 3 0 3 3 0 8 0 mbufpl 256 498 0 0 30 0 30 30 0 8 0 bufpl 280 5689 0 154 396 0 396 396 0 8 0 anonpl 24 534841 0 527710 46 0 46 46 0 186 0 amapchunkpl 152 59190 0 58768 21 4 17 19 0 158 0 amappl16 200 3639 0 3472 10 1 9 9 0 8 0 amappl15 192 397 0 391 1 0 1 1 0 8 0 amappl14 184 380 0 378 1 0 1 1 0 8 0 amappl13 176 57 0 55 1 0 1 1 0 8 0 amappl12 168 36 0 30 1 0 1 1 0 8 0 amappl11 160 49 0 36 1 0 1 1 0 8 0 amappl10 152 15 0 10 1 0 1 1 0 8 0 amappl9 144 297 0 294 1 0 1 1 0 8 0 amappl8 136 2652 0 2597 2 0 2 2 0 8 0 amappl7 128 69 0 58 1 0 1 1 0 8 0 amappl6 120 126 0 110 1 0 1 1 0 8 0 amappl5 112 2029 0 2017 1 0 1 1 0 8 0 amappl4 104 586 0 561 1 0 1 1 0 8 0 amappl3 96 50 0 44 1 0 1 1 0 8 0 amappl2 88 861 0 813 2 0 2 2 0 8 0 amappl1 80 39508 0 39076 12 2 10 12 0 8 0 amappl 88 24424 0 24287 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 2 0 0 1 0 1 1 0 8 0 uaddrrnd 24 2180 0 2163 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 2180 0 2163 1 0 1 1 0 8 0 vmmpekpl 168 16242 0 16218 2 0 2 2 0 8 0 vmmpepl 168 237710 0 236197 69 2 67 67 0 357 0 vmsppl 368 2179 0 2163 2 0 2 2 0 8 0 rwobjpl 56 43110 0 42243 15 2 13 13 0 8 0 pdppl 4096 4367 0 4326 59 18 41 45 0 8 0 pvpl 32 1182383 0 1171850 139 48 91 128 0 265 4 pmappl 232 2179 0 2163 3 2 1 2 0 8 0 extentpl 40 58 0 40 1 0 1 1 0 8 0 phpool 112 327 0 27 9 0 9 9 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(fffffd807e3b6d60,9,0) at witness_checkorder+0x108b rw_enter(fffffd807e3b6d50,1) at rw_enter+0xd4 rrw_enter(fffffd807e3b6d50,1) at rrw_enter+0x88 sys/kern/kern_rwlock.c:461 VOP_LOCK(fffffd807c038598,2001) at VOP_LOCK+0x87 sys/kern/vfs_vops.c:614 vn_lock(fffffd807c038598,2001) at vn_lock+0x84 sys/kern/vfs_vnops.c:579 vget(fffffd807c038598,2001) at vget+0x1f7 sys/kern/vfs_subr.c:676 ktrwriteraw(ffff800021271500,fffffd807c038598,fffffd807f7d8840,ffff800021287a40,ffff800021287a20) at ktrwriteraw+0x138 sys/kern/kern_ktrace.c:659 ktrstruct(ffff800021271500,ffffffff823b7133,ffff800021287b28,8) at ktrstruct+0x169 ktrwrite2 sys/kern/kern_ktrace.c:627 [inline] ktrstruct(ffff800021271500,ffffffff823b7133,ffff800021287b28,8) at ktrstruct+0x169 sys/kern/kern_ktrace.c:311 sys_socketpair(ffff800021271500,ffff800021287b98,ffff800021287be0) at sys_socketpair+0x3ed sys/kern/uipc_syscalls.c:470 syscall(ffff800021287c60) at syscall+0x5bf mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff800021287c60) at syscall+0x5bf sys/arch/amd64/amd64/trap.c:590 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0xd66e17bd0, 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(ffffffff828023a0) at __mp_lock+0x122 __mp_lock_spin sys/kern/kern_lock.c:116 [inline] __mp_lock(ffffffff828023a0) at __mp_lock+0x122 sys/kern/kern_lock.c:147 syscall(ffff800021ccdc30) at syscall+0x37b mi_syscall sys/sys/syscall_mi.h:75 [inline] syscall(ffff800021ccdc30) at syscall+0x37b sys/arch/amd64/amd64/trap.c:590 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x7f7ffffbe880, count: -6