FreeBSD/src 5f4c87etools/tools/git git-mfc

git-mfc: Allow merging merge commits

In order to merge merge commits (such as vendor imports), we need to
tell git cherry-pick which of the two branches referenced in the commit
is the mainline.  In our case, it is always the first.

Approved by:    markj
DeltaFile
+1-1tools/tools/git/git-mfc
+1-11 files

FreeBSD/src f01c509lib/libsysdecode mktables, sys/netpfil/pf pf_nl.h

pf: revert netlink commands back to enum

Revert pf_nl.h part of 017690e50913 and use new libsysdecode build glue
that parses enums.

Reviewed by:    kp, glebius
Differential Revision:  https://reviews.freebsd.org/D57866
DeltaFile
+52-51sys/netpfil/pf/pf_nl.h
+1-1lib/libsysdecode/mktables
+53-522 files

FreeBSD/src 8b19780lib/libsysdecode mktables

libsysdecode: Teach mktables to handle enums

While here, clean up and simplify the existing code.

MFC after:      1 week
Reviewed by:    glebius, jhb
Differential Revision:  https://reviews.freebsd.org/D57993
DeltaFile
+40-21lib/libsysdecode/mktables
+40-211 files

FreeBSD/src 6a6d6d7cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting tst.sid.ksh tst.uid.ksh

dtrace tests: Fix finding multiple process results

When looking up self process we can use `ps -p $$` directly rather
than grep which may find other processes ending in the expected PID.

Sponsored by:   Dell Inc.
Reviewed by:    markj, vangyzen
Differential Revision: https://reviews.freebsd.org/D58019
DeltaFile
+1-1cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.sid.ksh
+1-1cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.uid.ksh
+1-1cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.euid.ksh
+1-1cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.egid.ksh
+1-1cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.gid.ksh
+5-55 files

FreeBSD/src d7d7134lib/libc/posix1e acl_from_text.c

acl_from_text.c: Allow negative uid/gid numbers to be handled

getfacl / acl_to_text() incorrectly prints uid/gid numbers as signed integers.
This causes uid / gid numbers larger than 2G (2147483648) to print as
negative numbers.
The libc acl_from_text() function does not handle negative numbers.
This diff adds a backwards compatiblity fix to allow negative numbers...

Reviewed by:    rmacklem
MFC after:      2 weeks
Differential Revision:  https://reviews.freebsd.org/D57180
DeltaFile
+32-9lib/libc/posix1e/acl_from_text.c
+32-91 files

FreeBSD/src bf142easys/net if_ovpn.c

if_ovpn: Fix memory leak in VNET during unload

Unloading if_ovpn while it's in use by other vnets causes
memory leaks and panics.
Fix this by reverting VNET_SYSUNINIT and adjusting the SI_SUB
initialization order.

Reviewed by:    markj
MFC after:      1 week
Differential Revision: https://reviews.freebsd.org/D54175
DeltaFile
+12-8sys/net/if_ovpn.c
+12-81 files

FreeBSD/src 3838aee. libcrux_internal.h libcrux_mlkem768_sha3.h, regress/unittests/crypto/testdata nistkats-44.json

Vendor import of OpenSSH 10.4p1

Sponsored by:   The FreeBSD Foundation
DeltaFile
+27,332-0libcrux_internal.h
+0-11,752libcrux_mlkem768_sha3.h
+1,869-1,349ChangeLog
+1,435-509servconf.c
+539-585moduli
+802-0regress/unittests/crypto/testdata/nistkats-44.json
+31,977-14,195171 files not shown
+37,630-15,689177 files

FreeBSD/src 7a0b9e3lib/clang/libllvmminimal Makefile

libllvmminimal: Fix building with LLVM < 21 on riscv64

On most architectures we end up not needing ABIBreak.cpp as, although
some of the sources here do reference EnableABIBreakingChecks (or, if
assertions are disabled, DisableABIBreakingChecks) at a source level, we
compile with -ffunction-sections and -fdata-sections, and link with
--gc-sections, and it happens to be the case that all references can be
GC'ed. However, prior to LLVM 21, the RISC-V backend did not apply
-fdata-sections to .sdata, where references to these symbols end up, and
for some files we're building with such references we end up not being
able to GC .sdata due to the other unrelated data in it, meaning that we
do in fact need to build ABIBreak.cpp.

Whilst we could make this conditional on the architecture, it's a tiny
file, and it's a bit fragile to rely on GC behaviour, so just include it
unconditionally.

Reviewed by:    dim, emaste
Fixes:          770cf0a5f02d ("Fixups after llvm-project main llvmorg-21-init-19288-gface93e724f4 merge")

    [2 lines not shown]
DeltaFile
+1-1lib/clang/libllvmminimal/Makefile
+1-11 files

FreeBSD/src 58c7372sys/kern vfs_syscalls.c

vfs: Fix resource leaks in kern_symlinkat()

Fixes:          2ec2ba7e232d ("vfs: Add VFS/syscall support for Solaris style extended attributes")
Reported by:    Yuxiang Yang, Yizhou Zhao, Ao Wang, Xuewei Feng, Qi Li,
                and Ke Xu from Tsinghua University using GLM-5.2 from Z.ai
Reviewed by:    rmacklem, kib
MFC after:      1 week
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D58053
DeltaFile
+1-3sys/kern/vfs_syscalls.c
+1-31 files

FreeBSD/src 3516403sys/arm64/vmm vmm_hyp.c vmm_arm64.c, sys/arm64/vmm/io vgic_v3.c vtimer.c

arm64/vmm: Make remaining registers use hypctx_*_sys_reg

Move vgic, timer and trapframe registers into sys_regs to handle them
in the same way as all the other registers.

Signed-off-by:  Kajetan Puchalski <kajetan.puchalski at arm.com>
Reviewed by:    andrew
Sponsored by:   Arm Ltd
Differential Revision:  https://reviews.freebsd.org/D56556
DeltaFile
+74-61sys/arm64/vmm/vmm_hyp.c
+63-47sys/arm64/vmm/vmm_arm64.c
+33-32sys/arm64/vmm/vmm_hyp_exception.S
+42-4sys/arm64/vmm/arm64.h
+24-22sys/arm64/vmm/io/vgic_v3.c
+18-18sys/arm64/vmm/io/vtimer.c
+254-1846 files not shown
+301-22212 files

FreeBSD/src e3cd6d1sys/arm64/vmm vmm_hyp.c arm64.h

arm64/vmm: Refactor vmm_hyp.c

Refactor vmm_hyp.c to split register reload logic by type of register,
streamline the implementation and improve readability.

Signed-off-by:  Kajetan Puchalski <kajetan.puchalski at arm.com>
Reviewed by:    andrew
Sponsored by:   Arm Ltd
Differential Revision:  https://reviews.freebsd.org/D56553
DeltaFile
+229-179sys/arm64/vmm/vmm_hyp.c
+6-0sys/arm64/vmm/arm64.h
+235-1792 files

FreeBSD/src f4c3458sys/arm64/vmm vmm_hyp.c arm64.h, sys/arm64/vmm/io vtimer.c vtimer.h

arm64/vmm: Move vttbr_el2 & vtimer into struct hypctx

Move vttbr_el2 & vtimer from struct hyp into struct hypctx to streamline
the logic and handle them in the same way as other *_el2 registers are
already being handled.

Signed-off-by:  Kajetan Puchalski <kajetan.puchalski at arm.com>
Reviewed by:    andrew
Sponsored by:   Arm Ltd
Differential Revision:  https://reviews.freebsd.org/D56554
DeltaFile
+41-58sys/arm64/vmm/io/vtimer.c
+9-12sys/arm64/vmm/vmm_hyp.c
+4-2sys/arm64/vmm/arm64.h
+2-2sys/arm64/vmm/vmm_arm64.c
+0-1sys/arm64/vmm/io/vtimer.h
+56-755 files

FreeBSD/src ee26426sys/arm64/vmm vmm_reset.c vmm_hyp.c, sys/arm64/vmm/io vgic_v3.c

arm64/vmm: Move host-side EL2 regs into sys_regs

Move EL2 host registers that are not visible to the guest into
hypctx->sys_regs. Prefix them with HOST_ to distinguish from EL2
registers which are part of the guest's own state (e.g. in VNCR).

Signed-off-by:  Kajetan Puchalski <kajetan.puchalski at arm.com>
Reviewed by:    andrew
Sponsored by:   Arm Ltd
Differential Revision:  https://reviews.freebsd.org/D56555
DeltaFile
+313-269sys/arm64/vmm/vmm_reset.c
+49-33sys/arm64/vmm/vmm_hyp.c
+32-38sys/arm64/vmm/arm64.h
+13-13sys/arm64/vmm/vmm_arm64.c
+3-3sys/arm64/vmm/io/vgic_v3.c
+410-3565 files

FreeBSD/src d2e3e76sys/arm64/vmm vmm_hyp.c arm64.h

arm64/vmm: Store non-VNCR registers in an array

Move non-VNCR EL0 and EL1 registers into a dedicated array inside of
hypctx. This enables uniform accesses to both VNCR and non-VNCR guest
register state through hypctx_[read|write]_sys_reg().

The accessors are _not_ used for non-VNCR EL2 registers in order to
create a clear separation between guest-visible and guest-invisible
register state.

Signed-off-by:  Kajetan Puchalski <kajetan.puchalski at arm.com>
Reviewed by:    andrew
Sponsored by:   Arm Ltd
Differential Revision:  https://reviews.freebsd.org/D56552
DeltaFile
+109-88sys/arm64/vmm/vmm_hyp.c
+67-32sys/arm64/vmm/arm64.h
+4-28sys/arm64/vmm/vmm_reset.c
+180-1483 files

FreeBSD/src dd08cb0sys/arm64/include hypervisor.h, sys/arm64/vmm arm64.h vmm_hyp.c

arm64/vmm: Use the VNCR_EL2 memory page to store guest registers

Wherever possible, move the storage space for guest register values from
the hypctx struct into a preallocated memory page matching the layout of
the page pointed to by VNCR_EL2.
This will streamline implementing support for nested virtualization, but
the implementation itself is not reliant on the presence of nested
virtualization architecture features.

Signed-off-by:  Kajetan Puchalski <kajetan.puchalski at arm.com>
Reviewed by:    andrew
Sponsored by:   Arm Ltd
Differential Revision:  https://reviews.freebsd.org/D56551
DeltaFile
+147-21sys/arm64/vmm/arm64.h
+72-39sys/arm64/vmm/vmm_hyp.c
+50-28sys/arm64/vmm/vmm_arm64.c
+3-19sys/arm64/vmm/vmm_reset.c
+3-0sys/arm64/vmm/vmm_nvhe.c
+2-0sys/arm64/include/hypervisor.h
+277-1076 files

FreeBSD/src 5c73153sys/arm64/include hypervisor.h

arm64/vmm: Add FEAT_NV2 definitions

Add the definitions for the VNCR_EL2 register and all of the offsets
to registers in memory relative to the page stored in VNCR_EL2.

Signed-off-by:  Kajetan Puchalski <kajetan.puchalski at arm.com>
Reviewed by:    andrew
Sponsored by:   Arm Ltd
Differential Revision:  https://reviews.freebsd.org/D56550
DeltaFile
+101-0sys/arm64/include/hypervisor.h
+101-01 files

FreeBSD/src 302d3a2sys/sys cpu.h

cpu: cpu_get_pcpuid(): Fix typo in herald comment

Fixes:          c3c8f4d9e662 ("cpu: New cpu_get_pcpuid(), retrieves internal CPU ID")
Sponsored by:   The FreeBSD Foundation
DeltaFile
+1-1sys/sys/cpu.h
+1-11 files

FreeBSD/src 7f5fa76sys/cddl/contrib/opensolaris/uts/common/dtrace dtrace.c

dtrace: Fix DOF section-specific validation

The entry size of the probe section is assumed to be at least
sizeof(dof_probe_t) by the loop further below.

enoff_sec->dofs_entsize was not being validated at all.

When multiplying an index by a table entry size, make sure the
multiplication can't overflow.

Fix an off-by-one when validating the translated probe argument array.

Make sure that the probe argument argvs are valid string offsets
even if the argument count is zero.

Reviewed by:    christos
MFC after:      2 weeks
Sponsored by:   CHERI Research Centre
Differential Revision:  https://reviews.freebsd.org/D57979
DeltaFile
+23-7sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c
+23-71 files

FreeBSD/src b56b601sys/cddl/contrib/opensolaris/uts/common/dtrace dtrace.c

dtrace: Improve DOF string table validation

The check for a nul terminator implicitly assumes that the section size
is positive.  Make the assumption explicit.

Reviewed by:    christos
MFC after:      2 weeks
Sponsored by:   CHERI Research Centre
Differential Revision:  https://reviews.freebsd.org/D57977
DeltaFile
+3-2sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c
+3-21 files

FreeBSD/src 8dc98f4sys/cddl/contrib/opensolaris/uts/common/dtrace dtrace.c

dtrace: Fix DOF section bounds validation

We must ensure that each DOF section does not overlap with the DOF
header or section table.  Otherwise the relocations processed in the
second pass over sections can manipulate DOF metadata, leading to OOB
writes.

Reviewed by:    christos
MFC after:      2 weeks
Sponsored by:   CHERI Research Centre
Differential Revision:  https://reviews.freebsd.org/D57976
DeltaFile
+12-0sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c
+12-01 files

FreeBSD/src c1b6ebcsys/cddl/contrib/opensolaris/uts/common/dtrace dtrace.c

dtrace: Improve DOF section size validation

The loop which validates each DOF section assumes that the section
header is present, so the section size must be at least as large as the
header, otherwise a small OOB access is possible.

Reviewed by:    christos
MFC after:      2 weeks
Sponsored by:   CHERI Research Centre
Differential Revision:  https://reviews.freebsd.org/D57975
DeltaFile
+2-2sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c
+2-21 files

FreeBSD/src a8f5e24contrib/ee ee.c

ee: Handle EINTR when waiting for a character

Otherwise one can't easily attach gdb to ee.

Reviewed by:    bapt
MFC after:      2 weeks
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D57997
DeltaFile
+4-0contrib/ee/ee.c
+4-01 files

FreeBSD/src 705a88acontrib/ee ee.c

ee: Improve handling of malformed UTF-8 characters

In delete(), when copying the deleted character to the d_char buffer,
don't assume that it fits.  utf8_prev() may return a sequence of more
than 5 bytes.

In insert_utf8(), fix the copy-up of the line.  We extended the line by
"len" bytes, so "temp" has to be repositioned accordingly.  Compare with
plain insert().

Use sizeof when copying to buffers instead of hard-coding buffer sizes.

Don't dynamically allocate d_char, there is no need.

Fixes:          62fba0054d9e ("ee: add unicode support")
Reported by:    Sayono Hiragi (overflow in delete())
Reviewed by:    bapt
MFC after:      2 weeks
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D57996
DeltaFile
+16-15contrib/ee/ee.c
+16-151 files

FreeBSD/src 38dd686sys/kern kern_jaildesc.c

jaildesc: Publish the new fd only after the jaildesc is initialized

jaildesc_alloc() finishes initializing the file structure only after it
is made visible from the file descriptor table via finit().  In that
window, other threads could try to perform operations on the descriptor
and thus access an incompletely initialized jaildesc.

Defer the finit() call until locks are initialized.  While here,
simplify the error path for falloc_caps().

Reported by:    Yuxiang Yang, Yizhou Zhao, Ao Wang, Xuewei Feng, Qi Li,
                and Ke Xu from Tsinghua University using GLM-5.2 from Z.ai
Reviewed by:    jamie
MFC after:      1 week
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D58049
DeltaFile
+4-6sys/kern/kern_jaildesc.c
+4-61 files

FreeBSD/src 92dfe30lib/libsys inotify.2

inotify.2: Fix formatting and lint

MFC after:      1 week
DeltaFile
+8-8lib/libsys/inotify.2
+8-81 files

FreeBSD/src b70997csys/kern vfs_inotify.c, tests/sys/kern inotify_test.c

inotify: Unconditionally generate IN_IGNORED events for files/dirs

The implementation previously only generated an IN_IGNORED event for a
deleted watched file if the watch explicitly requested IN_DELETE_SELF.
This is not correct, IN_IGNORED should always be raised when the watched
subject is deleted.  Adjust the implementation of inotify_log_one()
accordingly.

This also fixes a problem where a deleted watched file's watch
would not be removed if IN_DELETE_SELF was not in the watch's event
mask, in which case the unlinked vnode would linger until the inotify
descriptor itself is closed.

Add a regression test.

Reported by:    jrtc27
Reviewed by:    jrtc27
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D58050
DeltaFile
+23-12sys/kern/vfs_inotify.c
+24-0tests/sys/kern/inotify_test.c
+47-122 files

FreeBSD/src 4805b88lib/libc/resolv res_init.c

libc/resolv: Dead code and style cleanup

Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D57928
DeltaFile
+17-42lib/libc/resolv/res_init.c
+17-421 files

FreeBSD/src 3f15998include resolv.h

resolv.h: Remove unused parts

Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D57927
DeltaFile
+0-49include/resolv.h
+0-491 files

FreeBSD/src 60827d7lib/libc/resolv res_init.c, share/man/man5 resolver.5

libc/resolv: Add no-debug and no-rotate options

These are simply the reverse of the debug and rotate options.

Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D57926
DeltaFile
+12-0share/man/man5/resolver.5
+4-0lib/libc/resolv/res_init.c
+16-02 files

FreeBSD/src fbe0257lib/libc/resolv res_init.c Makefile.inc, share/man/man5 resolver.5

libc/resolv: Reimplement the sortlist parser

When we switched from the BIND4 resolver to the BIND9 resolver, the
sortlist parser was inadvertently disabled due to a missing #define, and
nobody seemed to notice.  The sorting code remained enabled in the
resolver, but there was no way to set a sort order.

Reimplement the sortlist parser, but correctly, and update the manual
accordingly.  The new parser accepts IPv4 and IPv6 addresses with or
without a mask or prefix length, just like the old one, except IPv6
support was a bit wonky in the original code.

Fixes:          5342d17f09a8 ("Update the resolver in libc to BIND9's one.")
Relnotes:       yes
Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D57925
DeltaFile
+136-110lib/libc/resolv/res_init.c
+23-13share/man/man5/resolver.5
+1-0lib/libc/resolv/Makefile.inc
+160-1233 files