login: witness: lock order reversal: 1st 0xfffffd807b03edf8 fdlock (&newfdp->fd_fd.fd_lock) 2nd 0xfffffd806ac2ea28 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(fffffd806ac2ea28,9,0) at witness_checkorder+0x108b rw_enter(fffffd806ac2ea18,1) at rw_enter+0xd4 rrw_enter(fffffd806ac2ea18,1) at rrw_enter+0x88 sys/kern/kern_rwlock.c:461 VOP_LOCK(fffffd8067e59e98,2001) at VOP_LOCK+0x87 sys/kern/vfs_vops.c:614 vn_lock(fffffd8067e59e98,2001) at vn_lock+0x84 sys/kern/vfs_vnops.c:579 vget(fffffd8067e59e98,2001) at vget+0x1f7 sys/kern/vfs_subr.c:676 ktrwriteraw(ffff800021263260,fffffd8067e59e98,fffffd807f7d8840,ffff8000222c5410,ffff8000222c53f0) at ktrwriteraw+0x138 sys/kern/kern_ktrace.c:659 ktrstruct(ffff800021263260,ffffffff823bc3dc,ffff8000222c54f8,8) at ktrstruct+0x169 ktrwrite2 sys/kern/kern_ktrace.c:627 [inline] ktrstruct(ffff800021263260,ffffffff823bc3dc,ffff8000222c54f8,8) at ktrstruct+0x169 sys/kern/kern_ktrace.c:311 sys_socketpair(ffff800021263260,ffff8000222c5568,ffff8000222c55b0) at sys_socketpair+0x3ed sys/kern/uipc_syscalls.c:470 syscall(ffff8000222c5630) at syscall+0x5bf mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff8000222c5630) at syscall+0x5bf sys/arch/amd64/amd64/trap.c:585 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x72912a34020, count: -12 ddb{0}> show registers rdi 0xffff8000234ba000 rsi 0xfd79 __ALIGN_SIZE+0xed79 rbp 0xffff8000222c5020 rbx 0x3 rdx 0xffff8000234ba000 rcx 0xfd78 __ALIGN_SIZE+0xed78 rax 0xffffffff815b7917 db_enter+0x17 r8 0xffffffff811906c1 witness_checkorder+0x1061 r9 0x5 r10 0x8cd56ebe1f6e3207 r11 0xab1212b89ee1dae7 r12 0 r13 0xfffffd806ac2ea28 r14 0 r15 0xfffffd8002cfc740 rip 0xffffffff815b7918 db_enter+0x18 cs 0x8 rflags 0x246 rsp 0xffff8000222c5010 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb{0}> show proc PROC (syz-executor.1) pid=225851 stat=onproc flags process=0 proc=4000001 pri=32, usrpri=86, nice=20 forw=0xffffffffffffffff, list=0xffff800021262000,0xffff800021262550 process=0xffff800021225d98 user=0xffff8000222c0000, vmspace=0xfffffd80084da5c0 estcpu=36, cpticks=0, pctcpu=0.0 user=0, sys=0, intr=0 ddb{0}> ps PID TID PPID UID S FLAGS WAIT COMMAND 59731 138319 45202 0 2 0 syz-executor.1 *59731 225851 45202 0 7 0x4000001 syz-executor.1 2347 134444 84330 0 7 0 syz-executor.0 2347 492590 84330 0 3 0x4000080 fifor syz-executor.0 2347 314513 84330 0 2 0x4000000 syz-executor.0 1978 332223 1 0 3 0x100083 ttyin getty 63189 188329 0 0 3 0x14200 bored sosplice 45202 129466 23119 0 3 0x82 nanoslp syz-executor.1 84330 496339 23119 0 3 0x82 nanoslp syz-executor.0 23119 91813 80919 0 3 0x82 thrsleep syz-fuzzer 23119 390406 80919 0 3 0x4000082 nanoslp syz-fuzzer 23119 36724 80919 0 3 0x4000082 thrsleep syz-fuzzer 23119 311579 80919 0 3 0x4000082 thrsleep syz-fuzzer 23119 457733 80919 0 3 0x4000082 thrsleep syz-fuzzer 23119 286146 80919 0 3 0x4000082 thrsleep syz-fuzzer 23119 304642 80919 0 3 0x4000082 kqread syz-fuzzer 23119 233594 80919 0 3 0x4000082 thrsleep syz-fuzzer 80919 344603 89660 0 3 0x10008a sigsusp ksh 89660 80911 2593 0 3 0x92 select sshd 2593 363631 1 0 3 0x80 select sshd 13474 19153 83758 74 3 0x100092 bpf pflogd 83758 496874 1 0 3 0x80 netio pflogd 80986 493627 55682 73 3 0x100090 kqread syslogd 55682 57628 1 0 3 0x100082 netio syslogd 33912 7280 1 77 3 0x100090 poll dhclient 51769 249682 1 0 3 0x80 poll dhclient 55014 387405 0 0 3 0x14200 bored smr 94061 335914 0 0 2 0x14200 zerothread 59240 10538 0 0 3 0x14200 aiodoned aiodoned 84696 205163 0 0 3 0x14200 syncer update 68736 124450 0 0 3 0x14200 cleaner cleaner 55895 94720 0 0 3 0x14200 reaper reaper 50923 70450 0 0 3 0x14200 pgdaemon pagedaemon 62835 410099 0 0 3 0x14200 bored crynlk 59265 402916 0 0 3 0x14200 bored crypto 87120 311791 0 0 3 0x14200 bored viomb 96646 209300 0 0 3 0x40014200 acpi0 acpi0 10262 206047 0 0 3 0x40014200 idle1 58171 389509 0 0 3 0x14200 bored softnet 85405 304737 0 0 3 0x14200 bored systqmp 70872 478707 0 0 3 0x14200 bored systq 99559 2780 0 0 3 0x40014200 bored softclock 73707 495134 0 0 3 0x40014200 idle0 1 484565 0 0 3 0x82 wait init 0 0 -1 0 3 0x10200 scheduler swapper ddb{0}> show all locks Process 59731 (syz-executor.1) thread 0xffff800021263260 (225851) exclusive kernel_lock &kernel_lock r = 0 (0xffffffff828bbff8) #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 (0xfffffd807b03edf8) #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 10151 6493K 6935K 78643K 12474 0 pcb 13 8K 8K 78643K 153 0 rtable 109 3K 3K 78643K 373 0 ifaddr 62 13K 13K 78643K 121 0 counters 44 34K 34K 78643K 72 0 ioctlops 0 0K 4K 78643K 1484 0 iov 0 0K 8K 78643K 48 0 mount 1 1K 1K 78643K 1 0 log 0 0K 0K 78643K 1 0 vnodes 1223 77K 77K 78643K 1659 0 UFS quota 1 32K 32K 78643K 1 0 UFS mount 5 36K 36K 78643K 5 0 shm 2 1K 5K 78643K 6 0 VM map 2 1K 1K 78643K 2 0 sem 12 0K 0K 78643K 181 0 dirhash 12 2K 2K 78643K 12 0 ACPI 1697 195K 286K 78643K 12598 0 file desc 6 17K 25K 78643K 1616 0 sigio 0 0K 0K 78643K 48 0 proc 62 63K 95K 78643K 578 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 38 0 in_multi 33 2K 2K 78643K 63 0 ether_multi 1 0K 0K 78643K 8 0 mrt 0 0K 0K 78643K 13 0 ISOFS mount 1 32K 32K 78643K 1 0 MSDOSFS mount 1 16K 16K 78643K 1 0 ttys 37 175K 175K 78643K 37 0 exec 0 0K 2K 78643K 368 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 181 25K 32K 78643K 20602 0 UVM aobj 6 2K 2K 78643K 10 0 memdesc 1 4K 4K 78643K 1 0 crypto data 1 1K 1K 78643K 1 0 ip6_options 0 0K 0K 78643K 103 0 NDP 10 0K 0K 78643K 28 0 temp 117 3980K 4044K 78643K 7097 0 kqueue 3 4K 8K 78643K 81 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 118 0 116 1 0 1 1 0 8 0 rtentry 112 47 0 1 2 0 2 2 0 8 0 unpcb 120 505 0 475 1 0 1 1 0 8 0 syncache 296 4 0 4 1 1 0 1 0 8 0 tcpqe 32 80 0 80 2 2 0 1 0 8 0 tcpcb 736 255 0 251 9 4 5 5 0 8 4 arp 120 6 0 0 1 0 1 1 0 8 0 inpcb 304 666 0 660 3 2 1 2 0 8 0 nd6 48 6 0 0 1 0 1 1 0 8 0 pkpcb 40 10 0 10 1 1 0 1 0 8 0 kcovpl 48 2 0 0 1 0 1 1 0 8 0 ppxss 1128 7 0 7 1 1 0 1 0 8 0 pffrag 232 9 0 8 1 0 1 1 0 482 0 pffrnode 88 9 0 8 1 0 1 1 0 8 0 pffrent 40 365 0 364 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 22 0 12 1 0 1 1 0 8 0 pfstkey 112 22 0 12 1 0 1 1 0 8 0 pfstate 320 22 0 12 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 194 0 0 13 0 13 13 0 8 0 art_table 32 195 0 0 2 0 2 2 0 8 0 art_node 16 46 0 4 1 0 1 1 0 8 0 sysvmsgpl 40 16 0 0 1 0 1 1 0 8 0 semupl 112 8 0 8 1 1 0 1 0 8 0 semapl 112 179 0 169 1 0 1 1 0 8 0 shmpl 112 7 0 4 1 0 1 1 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino2pl 256 3538 0 2132 90 2 88 89 0 8 0 ffsino 272 3538 0 2132 94 0 94 94 0 8 0 nchpl 144 5661 0 4048 60 0 60 60 0 8 0 uvmvnodes 72 3843 0 0 70 0 70 70 0 8 0 vnodes 224 3843 0 0 227 0 227 227 0 8 0 namei 1024 13234 0 13234 1 0 1 1 0 8 1 percpumem 16 47 0 14 1 0 1 1 0 8 0 scxspl 216 16169 0 16169 8 7 1 7 0 8 1 plimitpl 152 32 0 24 1 0 1 1 0 8 0 sigapl 424 1833 0 1799 4 0 4 4 0 8 0 futexpl 56 10933 0 10933 1 0 1 1 0 8 1 knotepl 112 147 0 127 1 0 1 1 0 8 0 kqueuepl 168 655 0 653 1 0 1 1 0 8 0 pipepl 336 205 0 194 4 2 2 3 0 8 1 fdescpl 496 1816 0 1799 3 0 3 3 0 8 0 filepl 152 5863 0 5758 8 3 5 7 0 8 0 lockfpl 104 132 0 131 1 0 1 1 0 8 0 lockfspl 48 63 0 62 1 0 1 1 0 8 0 sessionpl 144 19 0 8 1 0 1 1 0 8 0 pgrppl 48 19 0 8 1 0 1 1 0 8 0 ucredpl 96 461 0 452 1 0 1 1 0 8 0 zombiepl 144 1799 0 1799 1 0 1 1 0 8 1 processpl 1080 1833 0 1799 3 0 3 3 0 8 0 procpl 672 3687 0 3643 4 0 4 4 0 8 0 sosppl 168 31 0 31 2 1 1 1 0 8 1 sockpl 480 1304 0 1266 10 4 6 7 0 8 1 mcl64k 65536 6 0 0 1 0 1 1 0 8 0 mcl16k 16384 6 0 0 1 0 1 1 0 8 0 mcl12k 12288 13 0 0 2 0 2 2 0 8 0 mcl9k 9216 6 0 0 1 0 1 1 0 8 0 mcl8k 8192 2 0 0 1 0 1 1 0 8 0 mcl4k 4096 9 0 0 2 0 2 2 0 8 0 mcl2k2 2112 3 0 0 1 0 1 1 0 8 0 mcl2k 2048 196 0 0 18 0 18 18 0 8 0 mtagpl 96 94 0 0 3 0 3 3 0 8 0 mbufpl 256 488 0 0 29 0 29 29 0 8 0 bufpl 280 5188 0 154 360 0 360 360 0 8 0 anonpl 24 450893 0 444265 48 6 42 44 0 186 1 amapchunkpl 152 48878 0 48490 21 5 16 18 0 158 1 amappl16 200 4032 0 3863 12 3 9 10 0 8 0 amappl15 192 62 0 56 1 0 1 1 0 8 0 amappl14 184 5 0 2 1 0 1 1 0 8 0 amappl13 176 33 0 32 1 0 1 1 0 8 0 amappl12 168 842 0 833 1 0 1 1 0 8 0 amappl11 160 54 0 41 1 0 1 1 0 8 0 amappl10 152 25 0 16 1 0 1 1 0 8 0 amappl9 144 290 0 290 1 1 0 1 0 8 0 amappl8 136 321 0 287 2 0 2 2 0 8 0 amappl7 128 54 0 45 1 0 1 1 0 8 0 amappl6 120 108 0 94 1 0 1 1 0 8 0 amappl5 112 1712 0 1697 1 0 1 1 0 8 0 amappl4 104 1348 0 1322 1 0 1 1 0 8 0 amappl3 96 112 0 107 1 0 1 1 0 8 0 amappl2 88 434 0 387 2 0 2 2 0 8 0 amappl1 80 32714 0 32279 13 3 10 12 0 8 0 amappl 88 20274 0 20150 3 0 3 3 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 9 0 4 1 0 1 1 0 8 0 uaddrrnd 24 1816 0 1799 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 1816 0 1799 1 0 1 1 0 8 0 vmmpekpl 168 12448 0 12424 2 0 2 2 0 8 0 vmmpepl 168 196903 0 195412 67 1 66 66 0 357 1 vmsppl 368 1815 0 1799 2 0 2 2 0 8 0 rwobjpl 56 36102 0 35254 15 2 13 13 0 8 1 pdppl 4096 3639 0 3598 57 16 41 45 0 8 0 pvpl 32 1011198 0 1001181 134 48 86 128 0 265 2 pmappl 232 1815 0 1799 2 1 1 2 0 8 0 extentpl 40 58 0 40 1 0 1 1 0 8 0 phpool 112 331 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(fffffd806ac2ea28,9,0) at witness_checkorder+0x108b rw_enter(fffffd806ac2ea18,1) at rw_enter+0xd4 rrw_enter(fffffd806ac2ea18,1) at rrw_enter+0x88 sys/kern/kern_rwlock.c:461 VOP_LOCK(fffffd8067e59e98,2001) at VOP_LOCK+0x87 sys/kern/vfs_vops.c:614 vn_lock(fffffd8067e59e98,2001) at vn_lock+0x84 sys/kern/vfs_vnops.c:579 vget(fffffd8067e59e98,2001) at vget+0x1f7 sys/kern/vfs_subr.c:676 ktrwriteraw(ffff800021263260,fffffd8067e59e98,fffffd807f7d8840,ffff8000222c5410,ffff8000222c53f0) at ktrwriteraw+0x138 sys/kern/kern_ktrace.c:659 ktrstruct(ffff800021263260,ffffffff823bc3dc,ffff8000222c54f8,8) at ktrstruct+0x169 ktrwrite2 sys/kern/kern_ktrace.c:627 [inline] ktrstruct(ffff800021263260,ffffffff823bc3dc,ffff8000222c54f8,8) at ktrstruct+0x169 sys/kern/kern_ktrace.c:311 sys_socketpair(ffff800021263260,ffff8000222c5568,ffff8000222c55b0) at sys_socketpair+0x3ed sys/kern/uipc_syscalls.c:470 syscall(ffff8000222c5630) at syscall+0x5bf mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff8000222c5630) at syscall+0x5bf sys/arch/amd64/amd64/trap.c:585 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x72912a34020, 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 Xsyscall() at Xsyscall+0x111 end of kernel end trace frame: 0x7f7ffffe79c0, count: -4