witness: lock order reversal: 1st 0xfffffd806ec25a18 fdlock (&newfdp->fd_fd.fd_lock) 2nd 0xfffffd806e30c3c8 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(fffffd806e30c3c8,9,0) at witness_checkorder+0x108b rw_enter(fffffd806e30c3b8,1) at rw_enter+0xd4 rrw_enter(fffffd806e30c3b8,1) at rrw_enter+0x88 sys/kern/kern_rwlock.c:461 VOP_LOCK(fffffd806697e5c8,2001) at VOP_LOCK+0x87 sys/kern/vfs_vops.c:614 vn_lock(fffffd806697e5c8,2001) at vn_lock+0x84 sys/kern/vfs_vnops.c:579 vget(fffffd806697e5c8,2001) at vget+0x1f7 sys/kern/vfs_subr.c:676 ktrwriteraw(ffff800021271500,fffffd806697e5c8,fffffd807f7d8900,ffff8000232fcef0,ffff8000232fced0) at ktrwriteraw+0x138 sys/kern/kern_ktrace.c:659 ktrstruct(ffff800021271500,ffffffff823b9c49,ffff8000232fcfd8,8) at ktrstruct+0x169 ktrwrite2 sys/kern/kern_ktrace.c:627 [inline] ktrstruct(ffff800021271500,ffffffff823b9c49,ffff8000232fcfd8,8) at ktrstruct+0x169 sys/kern/kern_ktrace.c:311 sys_socketpair(ffff800021271500,ffff8000232fd048,ffff8000232fd090) at sys_socketpair+0x3ed sys/kern/uipc_syscalls.c:470 syscall(ffff8000232fd110) at syscall+0x5bf mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff8000232fd110) at syscall+0x5bf sys/arch/amd64/amd64/trap.c:590 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x8ed7c3445b0, count: -12 ddb{0}> show registers rdi 0xffff8000230f8000 rsi 0x1cc1f acpi_pdirpa+0x8a87 rbp 0xffff8000232fcb00 rbx 0x3 rdx 0xffff8000230f8000 rcx 0x1cc1e acpi_pdirpa+0x8a86 rax 0xffffffff816490c7 db_enter+0x17 r8 0xffffffff81010761 witness_checkorder+0x1061 r9 0x5 r10 0xd410a2e8f60b6d88 r11 0xdb50b4cb7a52cf66 r12 0 r13 0xfffffd806e30c3c8 r14 0 r15 0xfffffd8002cf36c0 rip 0xffffffff816490c8 db_enter+0x18 cs 0x8 rflags 0x246 rsp 0xffff8000232fcaf0 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb{0}> show proc PROC (syz-executor.1) pid=51086 stat=onproc flags process=0 proc=4000001 pri=32, usrpri=79, nice=20 forw=0xffffffffffffffff, list=0xffff800021271a40,0xffffffff829144f0 process=0xffff800021225528 user=0xffff8000232f8000, vmspace=0xfffffd807f009730 estcpu=36, cpticks=0, pctcpu=0.0 user=0, sys=0, intr=0 ddb{0}> ps PID TID PPID UID S FLAGS WAIT COMMAND 52556 255380 26936 0 2 0 syz-executor.1 *52556 51086 26936 0 7 0x4000001 syz-executor.1 26936 234133 54394 0 3 0x82 nanoslp syz-executor.1 44687 388227 54394 0 2 0x2 syz-executor.0 96390 255001 0 0 3 0x14200 bored sosplice 54394 25271 12011 0 3 0x82 thrsleep syz-fuzzer 54394 340072 12011 0 3 0x4000082 nanoslp syz-fuzzer 54394 367218 12011 0 3 0x4000082 kqread syz-fuzzer 54394 158542 12011 0 3 0x4000082 thrsleep syz-fuzzer 54394 154799 12011 0 3 0x4000082 thrsleep syz-fuzzer 54394 189315 12011 0 3 0x4000082 thrsleep syz-fuzzer 54394 252260 12011 0 3 0x4000082 thrsleep syz-fuzzer 54394 185899 12011 0 3 0x4000082 thrsleep syz-fuzzer 12011 288970 35448 0 3 0x10008a sigsusp ksh 35448 348961 47292 0 3 0x92 select sshd 58766 505007 1 0 3 0x100083 ttyin getty 47292 187183 1 0 3 0x80 select sshd 33151 278364 30492 74 3 0x100092 bpf pflogd 30492 312443 1 0 3 0x80 netio pflogd 3437 103662 10690 73 3 0x100090 kqread syslogd 10690 410970 1 0 3 0x100082 netio syslogd 18052 374911 1 77 3 0x100090 poll dhclient 3224 162779 1 0 3 0x80 poll dhclient 32735 111784 0 0 3 0x14200 bored smr 90687 201499 0 0 2 0x14200 zerothread 4311 28876 0 0 3 0x14200 aiodoned aiodoned 35531 202892 0 0 3 0x14200 syncer update 14277 430941 0 0 3 0x14200 cleaner cleaner 59316 36232 0 0 3 0x14200 reaper reaper 90146 273179 0 0 3 0x14200 pgdaemon pagedaemon 22819 205847 0 0 3 0x14200 bored crynlk 31829 284574 0 0 3 0x14200 bored crypto 14076 132034 0 0 3 0x14200 bored viomb 36154 129144 0 0 3 0x40014200 acpi0 acpi0 90107 299480 0 0 7 0x40014200 idle1 32518 174795 0 0 3 0x14200 bored softnet 41860 179581 0 0 3 0x14200 bored systqmp 65401 380718 0 0 3 0x14200 bored systq 98293 452806 0 0 3 0x40014200 bored softclock 96620 351077 0 0 3 0x40014200 idle0 1 92082 0 0 3 0x82 wait init 0 0 -1 0 3 0x10200 scheduler swapper ddb{0}> show all locks Process 52556 (syz-executor.1) thread 0xffff800021271500 (51086) exclusive kernel_lock &kernel_lock r = 0 (0xffffffff82874eb0) #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 (0xfffffd806ec25a18) #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 10149 6515K 7225K 78643K 14168 0 pcb 13 8K 8K 78643K 115 0 rtable 108 3K 4K 78643K 630 0 ifaddr 57 12K 13K 78643K 220 0 sysctl 2 0K 0K 78643K 2 0 counters 44 34K 34K 78643K 106 0 ioctlops 0 0K 4K 78643K 1534 0 iov 0 0K 12K 78643K 37 0 mount 1 1K 1K 78643K 1 0 log 0 0K 0K 78643K 1 0 vnodes 1241 78K 78K 78643K 2393 0 UFS quota 1 32K 32K 78643K 1 0 UFS mount 5 36K 36K 78643K 5 0 shm 2 1K 9K 78643K 31 0 VM map 2 1K 1K 78643K 2 0 sem 12 1K 1K 78643K 20 0 dirhash 12 2K 2K 78643K 12 0 ACPI 1697 195K 286K 78643K 12598 0 file desc 5 13K 25K 78643K 3167 0 proc 62 63K 95K 78643K 745 0 subproc 32 2K 3K 78643K 119 0 NFS srvsock 1 0K 0K 78643K 1 0 NFS daemon 1 16K 16K 78643K 1 0 ip_moptions 0 0K 0K 78643K 184 0 in_multi 33 2K 2K 78643K 180 0 ether_multi 1 0K 0K 78643K 32 0 mrt 0 0K 0K 78643K 8 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 588 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 195 28K 35K 78643K 38151 0 UVM aobj 35 7K 7K 78643K 35 0 memdesc 1 4K 4K 78643K 1 0 crypto data 1 1K 1K 78643K 1 0 ip6_options 0 0K 0K 78643K 144 0 NDP 9 0K 0K 78643K 64 0 temp 118 3982K 4046K 78643K 37089 0 kqueue 3 4K 8K 78643K 89 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 134 0 132 1 0 1 1 0 8 0 rtentry 112 106 0 62 2 0 2 2 0 8 0 unpcb 120 530 0 516 1 0 1 1 0 8 0 syncache 296 36 0 36 4 4 0 1 0 8 0 tcpqe 32 315 0 315 4 4 0 1 0 8 0 tcpcb 736 453 0 443 9 7 2 4 0 8 1 arp 120 12 0 6 1 0 1 1 0 8 0 inpcb 304 1111 0 1104 4 2 2 2 0 8 1 nd6 48 29 0 23 1 0 1 1 0 8 0 pkpcb 40 40 0 40 5 4 1 1 0 8 1 kcovpl 48 7 0 5 1 0 1 1 0 8 0 ppxss 1128 7 0 7 1 1 0 1 0 8 0 pffrag 232 11 0 11 1 1 0 1 0 482 0 pffrnode 88 11 0 11 1 1 0 1 0 8 0 pffrent 40 505 0 505 3 2 1 1 0 8 1 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 38 0 31 1 0 1 1 0 8 0 pfstkey 112 38 0 31 1 0 1 1 0 8 0 pfstate 320 38 0 31 2 0 2 2 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 327 0 132 13 0 13 13 0 8 0 art_table 32 328 0 132 2 0 2 2 0 8 0 art_node 16 100 0 60 1 0 1 1 0 8 0 sysvmsgpl 40 31 0 31 2 2 0 1 0 8 0 semapl 112 14 0 4 1 0 1 1 0 8 0 shmpl 112 32 0 0 1 0 1 1 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino2pl 256 5434 0 4023 89 0 89 89 0 8 0 ffsino 272 5434 0 4023 95 0 95 95 0 8 0 nchpl 144 9162 0 7566 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 22066 0 22066 1 0 1 1 0 8 1 percpumem 16 64 0 31 1 0 1 1 0 8 0 scxspl 216 27580 0 27580 9 8 1 8 0 8 1 plimitpl 152 55 0 47 1 0 1 1 0 8 0 sigapl 424 3368 0 3335 5 1 4 5 0 8 0 futexpl 56 22383 0 22383 1 0 1 1 0 8 1 knotepl 112 206 0 186 1 0 1 1 0 8 0 kqueuepl 168 1340 0 1328 1 0 1 1 0 8 0 pipepl 336 204 0 193 3 1 2 2 0 8 0 fdescpl 496 3351 0 3335 3 0 3 3 0 8 0 filepl 152 9951 0 9845 5 0 5 5 0 8 0 lockfpl 104 192 0 191 1 0 1 1 0 8 0 lockfspl 48 80 0 79 1 0 1 1 0 8 0 sessionpl 144 23 0 12 1 0 1 1 0 8 0 pgrppl 48 23 0 12 1 0 1 1 0 8 0 ucredpl 96 894 0 885 1 0 1 1 0 8 0 zombiepl 144 3335 0 3335 1 0 1 1 0 8 1 processpl 1080 3368 0 3335 3 0 3 3 0 8 0 procpl 672 6714 0 6673 5 1 4 5 0 8 0 sosppl 168 50 0 50 3 3 0 1 0 8 0 sockpl 480 1832 0 1809 7 3 4 4 0 8 1 mcl64k 65536 10 0 0 2 0 2 2 0 8 0 mcl12k 12288 2 0 0 1 0 1 1 0 8 0 mcl9k 9216 4 0 0 1 0 1 1 0 8 0 mcl8k 8192 8 0 0 1 0 1 1 0 8 0 mcl4k 4096 9 0 0 2 0 2 2 0 8 0 mcl2k2 2112 2 0 0 1 0 1 1 0 8 0 mcl2k 2048 259 0 0 25 0 25 25 0 8 0 mtagpl 96 154 0 0 4 0 4 4 0 8 0 mbufpl 256 533 0 0 29 1 28 28 0 8 0 bufpl 280 7822 0 1556 448 0 448 448 0 8 0 anonpl 24 868657 0 861491 113 67 46 86 0 186 0 amapchunkpl 152 90478 0 90100 19 3 16 18 0 158 0 amappl16 200 9141 0 8953 50 39 11 33 0 8 1 amappl15 192 1032 0 1026 1 0 1 1 0 8 0 amappl14 184 9 0 8 1 0 1 1 0 8 0 amappl13 176 58 0 57 1 0 1 1 0 8 0 amappl12 168 1911 0 1901 1 0 1 1 0 8 0 amappl11 160 48 0 36 1 0 1 1 0 8 0 amappl10 152 44 0 35 1 0 1 1 0 8 0 amappl9 144 553 0 553 2 2 0 1 0 8 0 amappl8 136 416 0 360 2 0 2 2 0 8 0 amappl7 128 340 0 329 1 0 1 1 0 8 0 amappl6 120 126 0 112 1 0 1 1 0 8 0 amappl5 112 1913 0 1901 1 0 1 1 0 8 0 amappl4 104 2461 0 2428 1 0 1 1 0 8 0 amappl3 96 103 0 98 1 0 1 1 0 8 0 amappl2 88 1835 0 1786 2 0 2 2 0 8 0 amappl1 80 58173 0 57756 13 3 10 12 0 8 0 amappl 88 37737 0 37618 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 34 0 0 1 0 1 1 0 8 0 uaddrrnd 24 3351 0 3335 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 3351 0 3335 1 0 1 1 0 8 0 vmmpekpl 168 19381 0 19356 2 0 2 2 0 8 0 vmmpepl 168 372004 0 370565 113 45 68 84 0 357 0 vmsppl 368 3350 0 3335 2 0 2 2 0 8 0 rwobjpl 56 66329 0 65451 25 12 13 19 0 8 0 pdppl 4096 6709 0 6670 63 22 41 45 0 8 2 pvpl 32 1844190 0 1833794 193 100 93 150 0 265 5 pmappl 232 3350 0 3335 4 3 1 2 0 8 0 extentpl 40 58 0 40 1 0 1 1 0 8 0 phpool 112 343 0 34 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(fffffd806e30c3c8,9,0) at witness_checkorder+0x108b rw_enter(fffffd806e30c3b8,1) at rw_enter+0xd4 rrw_enter(fffffd806e30c3b8,1) at rrw_enter+0x88 sys/kern/kern_rwlock.c:461 VOP_LOCK(fffffd806697e5c8,2001) at VOP_LOCK+0x87 sys/kern/vfs_vops.c:614 vn_lock(fffffd806697e5c8,2001) at vn_lock+0x84 sys/kern/vfs_vnops.c:579 vget(fffffd806697e5c8,2001) at vget+0x1f7 sys/kern/vfs_subr.c:676 ktrwriteraw(ffff800021271500,fffffd806697e5c8,fffffd807f7d8900,ffff8000232fcef0,ffff8000232fced0) at ktrwriteraw+0x138 sys/kern/kern_ktrace.c:659 ktrstruct(ffff800021271500,ffffffff823b9c49,ffff8000232fcfd8,8) at ktrstruct+0x169 ktrwrite2 sys/kern/kern_ktrace.c:627 [inline] ktrstruct(ffff800021271500,ffffffff823b9c49,ffff8000232fcfd8,8) at ktrstruct+0x169 sys/kern/kern_ktrace.c:311 sys_socketpair(ffff800021271500,ffff8000232fd048,ffff8000232fd090) at sys_socketpair+0x3ed sys/kern/uipc_syscalls.c:470 syscall(ffff8000232fd110) at syscall+0x5bf mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff8000232fd110) at syscall+0x5bf sys/arch/amd64/amd64/trap.c:590 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x8ed7c3445b0, 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 acpicpu_idle() at acpicpu_idle+0x2eb sys/dev/acpi/acpicpu.c:1206 sched_idle(ffff800020d58ff0) at sched_idle+0x417 sys/kern/kern_sched.c:178 end trace frame: 0x0, count: -5