login: witness: lock order reversal: 1st 0xfffffd807a104c08 fdlock (&newfdp->fd_fd.fd_lock) 2nd 0xfffffd807af82920 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(fffffd807af82920,9,0) at witness_checkorder+0x108b rw_enter(fffffd807af82910,1) at rw_enter+0xd4 rrw_enter(fffffd807af82910,1) at rrw_enter+0x88 sys/kern/kern_rwlock.c:461 VOP_LOCK(fffffd806d9eb9f0,2001) at VOP_LOCK+0x87 sys/kern/vfs_vops.c:614 vn_lock(fffffd806d9eb9f0,2001) at vn_lock+0x84 sys/kern/vfs_vnops.c:579 vget(fffffd806d9eb9f0,2001) at vget+0x1f7 sys/kern/vfs_subr.c:676 ktrwriteraw(ffff8000212aefd0,fffffd806d9eb9f0,fffffd807f7d8840,ffff800022d4aef0,ffff800022d4aed0) at ktrwriteraw+0x138 sys/kern/kern_ktrace.c:659 ktrstruct(ffff8000212aefd0,ffffffff823bb89d,ffff800022d4afd8,8) at ktrstruct+0x169 ktrwrite2 sys/kern/kern_ktrace.c:627 [inline] ktrstruct(ffff8000212aefd0,ffffffff823bb89d,ffff800022d4afd8,8) at ktrstruct+0x169 sys/kern/kern_ktrace.c:311 sys_socketpair(ffff8000212aefd0,ffff800022d4b048,ffff800022d4b090) at sys_socketpair+0x3ed sys/kern/uipc_syscalls.c:470 syscall(ffff800022d4b110) at syscall+0x5bf mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff800022d4b110) at syscall+0x5bf sys/arch/amd64/amd64/trap.c:585 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0xc98c1af4a20, count: -12 ddb{0}> show registers rdi 0xffff8000212c4000 rsi 0x139de mp_pdirpa+0x29d8 rbp 0xffff800022d4ab00 rbx 0x3 rdx 0xffff8000212c4000 rcx 0x139dd mp_pdirpa+0x29d7 rax 0xffffffff820a9a87 db_enter+0x17 r8 0xffffffff81e64181 witness_checkorder+0x1061 r9 0x5 r10 0x57d4f9ae2b377101 r11 0x6aab4346bece2817 r12 0 r13 0xfffffd807af82920 r14 0 r15 0xfffffd8002cf7740 rip 0xffffffff820a9a88 db_enter+0x18 cs 0x8 rflags 0x246 rsp 0xffff800022d4aaf0 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb{0}> show proc PROC (syz-executor.1) pid=406340 stat=onproc flags process=0 proc=4000001 pri=32, usrpri=86, nice=20 forw=0xffffffffffffffff, list=0xffff8000212ae7f0,0xffff8000212afd00 process=0xffff800022d18450 user=0xffff800022d46000, vmspace=0xfffffd807f009170 estcpu=36, cpticks=0, pctcpu=0.0 user=0, sys=0, intr=0 ddb{0}> ps PID TID PPID UID S FLAGS WAIT COMMAND 89404 112623 32741 0 2 0 syz-executor.0 89404 474824 32741 0 2 0x4000000 syz-executor.0 88869 98751 97327 0 7 0 syz-executor.1 *88869 406340 97327 0 7 0x4000001 syz-executor.1 75514 489360 0 0 3 0x14280 nfsidl nfsio 30610 181282 0 0 3 0x14280 nfsidl nfsio 7808 223314 0 0 3 0x14280 nfsidl nfsio 36363 355419 0 0 3 0x14280 nfsidl nfsio 41436 329964 0 0 3 0x14280 nfsidl nfsio 96081 287314 0 0 3 0x14280 nfsidl nfsio 48881 151432 0 0 3 0x14280 nfsidl nfsio 88883 295935 0 0 3 0x14280 nfsidl nfsio 72496 118994 0 0 3 0x14280 nfsidl nfsio 51547 303669 0 0 3 0x14280 nfsidl nfsio 78010 303260 0 0 3 0x14280 nfsidl nfsio 55164 447284 0 0 3 0x14280 nfsidl nfsio 24922 455369 0 0 3 0x14280 nfsidl nfsio 69188 502475 0 0 3 0x14280 nfsidl nfsio 76699 112223 0 0 3 0x14280 nfsidl nfsio 85324 401137 0 0 3 0x14280 nfsidl nfsio 63238 326368 0 0 3 0x14280 nfsidl nfsio 57127 452439 0 0 3 0x14280 nfsidl nfsio 27049 474864 0 0 3 0x14280 nfsidl nfsio 6712 19122 0 0 3 0x14280 nfsidl nfsio 21619 231573 1 0 3 0x100083 ttyin getty 97327 320910 13761 0 3 0x82 nanoslp syz-executor.1 32741 19834 13761 0 3 0x82 nanoslp syz-executor.0 13761 74478 16952 0 3 0x82 thrsleep syz-fuzzer 13761 393860 16952 0 3 0x4000082 thrsleep syz-fuzzer 13761 267191 16952 0 3 0x4000082 thrsleep syz-fuzzer 13761 315199 16952 0 3 0x4000082 thrsleep syz-fuzzer 13761 396421 16952 0 3 0x4000082 thrsleep syz-fuzzer 13761 482899 16952 0 3 0x4000082 thrsleep syz-fuzzer 13761 266507 16952 0 3 0x4000082 thrsleep syz-fuzzer 13761 369669 16952 0 3 0x4000082 kqread syz-fuzzer 16952 161411 28336 0 3 0x10008a sigsusp ksh 28336 282143 84866 0 3 0x92 select sshd 84866 365906 1 0 3 0x80 select sshd 73153 85515 15989 74 3 0x100092 bpf pflogd 15989 17123 1 0 3 0x80 netio pflogd 312 82225 4213 73 3 0x100090 kqread syslogd 4213 94478 1 0 3 0x100082 netio syslogd 506 229798 1 77 3 0x100090 poll dhclient 90493 382756 1 0 3 0x80 poll dhclient 5847 317942 0 0 3 0x14200 bored smr 34833 388815 0 0 2 0x14200 zerothread 55971 188083 0 0 3 0x14200 aiodoned aiodoned 27080 38147 0 0 3 0x14200 syncer update 59021 62033 0 0 3 0x14200 cleaner cleaner 85150 122747 0 0 3 0x14200 reaper reaper 898 470127 0 0 3 0x14200 pgdaemon pagedaemon 16619 45557 0 0 3 0x14200 bored crynlk 51429 432783 0 0 3 0x14200 bored crypto 52464 254449 0 0 3 0x14200 bored viomb 85326 500834 0 0 3 0x40014200 acpi0 acpi0 90365 522504 0 0 3 0x40014200 idle1 83760 268735 0 0 3 0x14200 bored softnet 75694 389880 0 0 3 0x14200 bored systqmp 10345 274744 0 0 3 0x14200 bored systq 56479 306724 0 0 3 0x40014200 bored softclock 63232 175095 0 0 3 0x40014200 idle0 1 128231 0 0 3 0x82 wait init 0 0 -1 0 3 0x10200 scheduler swapper ddb{0}> show all locks Process 88869 (syz-executor.1) thread 0xffff8000212aefd0 (406340) exclusive kernel_lock &kernel_lock r = 0 (0xffffffff8287a8e8) #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 (0xfffffd807a104c08) #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 10150 6555K 6932K 78643K 12274 0 pcb 13 8K 8K 78643K 138 0 rtable 108 3K 5K 78643K 431 0 ifaddr 57 12K 12K 78643K 64 0 sysctl 2 0K 0K 78643K 2 0 counters 44 34K 34K 78643K 44 0 ioctlops 0 0K 4K 78643K 1552 0 iov 0 0K 12K 78643K 58 0 mount 1 1K 1K 78643K 1 0 log 0 0K 0K 78643K 1 0 vnodes 1220 77K 77K 78643K 1597 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 12 0K 0K 78643K 213 0 dirhash 12 2K 2K 78643K 12 0 ACPI 1697 195K 286K 78643K 12598 0 file desc 6 17K 25K 78643K 1672 0 sigio 0 0K 0K 78643K 42 0 proc 61 63K 95K 78643K 508 0 subproc 32 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 120 0 in_multi 33 2K 2K 78643K 82 0 ether_multi 1 0K 0K 78643K 13 0 mrt 0 0K 0K 78643K 120 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 373 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 203 90K 90K 78643K 21454 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 60 0 NDP 9 0K 0K 78643K 13 0 temp 93 3975K 4039K 78643K 5796 0 kqueue 3 4K 9K 78643K 37 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 112 0 110 1 0 1 1 0 8 0 rtentry 112 106 0 61 2 0 2 2 0 8 0 unpcb 120 268 0 256 1 0 1 1 0 8 0 syncache 296 4 0 4 1 1 0 1 0 8 0 tcpqe 32 24 0 24 4 4 0 1 0 8 0 tcpcb 736 225 0 221 5 3 2 3 0 8 1 arp 120 6 0 0 1 0 1 1 0 8 0 inpcb 304 815 0 809 4 3 1 2 0 8 0 rttmr 72 60 0 60 2 2 0 1 0 8 0 nd6 48 7 0 0 1 0 1 1 0 8 0 pkpcb 40 81 0 81 3 3 0 1 0 8 0 kcovpl 48 2 0 0 1 0 1 1 0 8 0 pffrag 232 1 0 0 1 0 1 1 0 482 0 pffrnode 88 1 0 0 1 0 1 1 0 8 0 pffrent 40 10 0 9 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 pfrktable 1344 15 0 15 1 1 0 1 0 8 0 pfstitem 24 24 0 12 1 0 1 1 0 8 0 pfstkey 112 24 0 12 1 0 1 1 0 8 0 pfstate 320 24 0 12 2 0 2 2 0 8 0 pfrule 1360 31 0 26 2 1 1 2 0 8 0 art_heap8 4096 1 0 0 1 0 1 1 0 8 0 art_heap4 256 203 0 0 13 0 13 13 0 8 0 art_table 32 204 0 0 2 0 2 2 0 8 0 art_node 16 105 0 64 1 0 1 1 0 8 0 semapl 112 211 0 201 1 0 1 1 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino2pl 256 3434 0 2023 90 1 89 89 0 8 0 ffsino 272 3434 0 2023 95 0 95 95 0 8 0 nchpl 144 5528 0 3919 60 0 60 60 0 8 0 uvmvnodes 72 3717 0 0 68 0 68 68 0 8 0 vnodes 224 3717 0 0 219 0 219 219 0 8 0 namei 1024 13404 0 13404 2 1 1 1 0 8 1 percpumem 16 33 0 0 1 0 1 1 0 8 0 vcpupl 1984 5 0 0 1 0 1 1 0 8 0 vmpool 560 5 0 0 1 0 1 1 0 8 0 pfiaddrpl 120 5 0 5 1 1 0 1 0 8 0 scxspl 216 16419 0 16419 9 8 1 8 0 8 1 plimitpl 152 77 0 69 1 0 1 1 0 8 0 sigapl 424 1908 0 1855 6 0 6 6 0 8 0 futexpl 56 12095 0 12095 2 1 1 1 0 8 1 knotepl 112 106 0 86 1 0 1 1 0 8 0 kqueuepl 168 652 0 650 1 0 1 1 0 8 0 pipepl 336 154 0 143 4 3 1 2 0 8 0 fdescpl 496 1872 0 1855 3 0 3 3 0 8 0 filepl 152 6103 0 6000 6 1 5 5 0 8 1 lockfpl 104 211 0 210 1 0 1 1 0 8 0 lockfspl 48 73 0 72 1 0 1 1 0 8 0 sessionpl 144 19 0 8 1 0 1 1 0 8 0 pgrppl 48 51 0 40 1 0 1 1 0 8 0 ucredpl 96 588 0 579 1 0 1 1 0 8 0 zombiepl 144 1855 0 1855 2 1 1 1 0 8 1 processpl 1080 1908 0 1855 4 0 4 4 0 8 0 procpl 672 3894 0 3832 6 0 6 6 0 8 0 sockpl 480 1277 0 1257 7 4 3 4 0 8 0 mcl64k 65536 4 0 0 1 0 1 1 0 8 0 mcl12k 12288 4 0 0 1 0 1 1 0 8 0 mcl9k 9216 5 0 0 1 0 1 1 0 8 0 mcl8k 8192 14 0 0 2 0 2 2 0 8 0 mcl4k 4096 4 0 0 1 0 1 1 0 8 0 mcl2k2 2112 7 0 0 1 0 1 1 0 8 0 mcl2k 2048 149 0 0 14 0 14 14 0 8 0 mtagpl 96 49 0 0 2 0 2 2 0 8 0 mbufpl 256 499 0 0 29 0 29 29 0 8 0 bufpl 280 5571 0 155 387 0 387 387 0 8 0 anonpl 24 469508 0 463357 75 35 40 61 0 186 1 amapchunkpl 152 50847 0 50475 31 15 16 25 0 158 1 amappl16 200 3148 0 2985 10 1 9 9 0 8 0 amappl15 192 895 0 887 1 0 1 1 0 8 0 amappl14 184 3 0 1 1 0 1 1 0 8 0 amappl13 176 26 0 24 1 0 1 1 0 8 0 amappl12 168 32 0 24 1 0 1 1 0 8 0 amappl11 160 49 0 37 1 0 1 1 0 8 0 amappl10 152 830 0 819 1 0 1 1 0 8 0 amappl9 144 51 0 50 1 0 1 1 0 8 0 amappl8 136 344 0 302 2 0 2 2 0 8 0 amappl7 128 57 0 45 1 0 1 1 0 8 0 amappl6 120 920 0 906 1 0 1 1 0 8 0 amappl5 112 2248 0 2235 1 0 1 1 0 8 0 amappl4 104 516 0 485 1 0 1 1 0 8 0 amappl3 96 84 0 78 1 0 1 1 0 8 0 amappl2 88 512 0 467 2 0 2 2 0 8 0 amappl1 80 34613 0 34183 13 3 10 12 0 8 0 amappl 88 21029 0 20901 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 1877 0 1855 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 1877 0 1855 1 0 1 1 0 8 0 vmmpekpl 168 13587 0 13560 2 0 2 2 0 8 0 vmmpepl 168 205993 0 204487 73 6 67 68 0 357 1 vmsppl 368 1876 0 1855 2 0 2 2 0 8 0 rwobjpl 56 37433 0 36580 15 2 13 13 0 8 0 pdppl 4096 3761 0 3715 64 18 46 46 0 8 0 pvpl 32 1085982 0 1076394 159 78 81 128 0 265 0 pmappl 232 1876 0 1855 3 1 2 2 0 8 0 extentpl 40 58 0 40 1 0 1 1 0 8 0 phpool 112 331 0 29 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(fffffd807af82920,9,0) at witness_checkorder+0x108b rw_enter(fffffd807af82910,1) at rw_enter+0xd4 rrw_enter(fffffd807af82910,1) at rrw_enter+0x88 sys/kern/kern_rwlock.c:461 VOP_LOCK(fffffd806d9eb9f0,2001) at VOP_LOCK+0x87 sys/kern/vfs_vops.c:614 vn_lock(fffffd806d9eb9f0,2001) at vn_lock+0x84 sys/kern/vfs_vnops.c:579 vget(fffffd806d9eb9f0,2001) at vget+0x1f7 sys/kern/vfs_subr.c:676 ktrwriteraw(ffff8000212aefd0,fffffd806d9eb9f0,fffffd807f7d8840,ffff800022d4aef0,ffff800022d4aed0) at ktrwriteraw+0x138 sys/kern/kern_ktrace.c:659 ktrstruct(ffff8000212aefd0,ffffffff823bb89d,ffff800022d4afd8,8) at ktrstruct+0x169 ktrwrite2 sys/kern/kern_ktrace.c:627 [inline] ktrstruct(ffff8000212aefd0,ffffffff823bb89d,ffff800022d4afd8,8) at ktrstruct+0x169 sys/kern/kern_ktrace.c:311 sys_socketpair(ffff8000212aefd0,ffff800022d4b048,ffff800022d4b090) at sys_socketpair+0x3ed sys/kern/uipc_syscalls.c:470 syscall(ffff800022d4b110) at syscall+0x5bf mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff800022d4b110) at syscall+0x5bf sys/arch/amd64/amd64/trap.c:585 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0xc98c1af4a20, 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 end of kernel end trace frame: 0x7f7fffff4020, count: -3