FreeBSD/src 940142dlib/libc/tests/gen fts_set_test.c Makefile

lib/libc/tests/gen: add fts_set() tests

Add ATF test cases for fts_set():

fts_set:
- invalid instruction returns non-zero with EINVAL
- FTS_AGAIN revisits the current node
- FTS_AGAIN consecutive visits node three times
- FTS_FOLLOW on symlink to file yields FTS_F
- FTS_FOLLOW on symlink to directory causes descent
- FTS_FOLLOW on dead symlink yields FTS_SLNONE
- FTS_SKIP prevents descent into directory
- fts_set_clientptr/fts_get_clientptr round-trip
- fts_get_stream returns parent FTS* from FTSENT*

Sponsored by:   Google LLC (GSoC 2026)
Reviewed by:    asomers
MFC after:      2 weeks
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2242
DeltaFile
+361-0lib/libc/tests/gen/fts_set_test.c
+1-0lib/libc/tests/gen/Makefile
+362-02 files

FreeBSD/src 94cba36tests/sys/acl tools-posix.test run

tests: Fix reliability issues in POSIX ACL tests

The ACL tests use UIDs and GIDs 41 through 49 and expect them to be
unassigned.  Since GID 43 is now assigned to the audio group, some
tests have begun to fail.

While here, also fix a benign Perl syntax issue in the test runner.

MFC after:      1 week
Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D57297

(cherry picked from commit 05039fda7ee12f3b857e55a461607b5af7b6c91f)
DeltaFile
+7-7tests/sys/acl/tools-posix.test
+1-1tests/sys/acl/run
+8-82 files

FreeBSD/src 2ca3e46usr.bin/cap_mkdb cap_mkdb.c

cap_mkdb: Fix memory leak

This is not a big deal since it only iterates once before exiting, but
that's no reason to set a bad example.

PR:             195128
MFC after:      1 week
Reviewed by:    ngie
Differential Revision:  https://reviews.freebsd.org/D57251

(cherry picked from commit 6880405bf97df03ffce227d34c2faa99b602a49d)
DeltaFile
+2-1usr.bin/cap_mkdb/cap_mkdb.c
+2-11 files

FreeBSD/src 5fd0698contrib/libarchive/libarchive archive_string.c

libarchive: Force GNU iconv compatibility on FreeBSD

When libarchive is compiled with FreeBSD's native iconv instead of
libiconv, as happens with libarchive in the base system, we need to
configure iconv(3) to handle invalid sequences by returning -1, as
iconv_strncat_in_locale() assumes GNU iconv semantics.

This corresponds to upstream PR 3056.

PR:             294577
MFC after:      1 week

(cherry picked from commit bd15d6ef126ee4c0eac931117f6bbbf6f9a3fc72)
DeltaFile
+11-1contrib/libarchive/libarchive/archive_string.c
+11-11 files

FreeBSD/src 6892063usr.sbin/ctld kernel.cc

ctld: More consistent error messages

The error messages ctld emits when it finds a port or LUN it did not
create were inconsistent with each other as well as with ctld's other
error messages.

MFC after:      1 week
Sponsored by:   Klara, Inc.
Sponsored by:   NetApp, Inc.
Reviewed by:    jhb
Differential Revision:  https://reviews.freebsd.org/D57270

(cherry picked from commit 95fc64cc29fb4cddc7cad093cfa32587a623f560)
DeltaFile
+5-5usr.sbin/ctld/kernel.cc
+5-51 files

FreeBSD/src b243eadusr.sbin/certctl certctl.c

certctl: Style nits

MFC after:      1 week
Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D57298

(cherry picked from commit 39f23af2ba4b845eb7f4ec7ae4079a67557eb63d)
DeltaFile
+3-2usr.sbin/certctl/certctl.c
+3-21 files

FreeBSD/src 885a35ctests/sys/acl tools-posix.test run

tests: Fix reliability issues in POSIX ACL tests

The ACL tests use UIDs and GIDs 41 through 49 and expect them to be
unassigned.  Since GID 43 is now assigned to the audio group, some
tests have begun to fail.

While here, also fix a benign Perl syntax issue in the test runner.

MFC after:      1 week
Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D57297

(cherry picked from commit 05039fda7ee12f3b857e55a461607b5af7b6c91f)
DeltaFile
+7-7tests/sys/acl/tools-posix.test
+1-1tests/sys/acl/run
+8-82 files

FreeBSD/src e6470edcontrib/libarchive/libarchive archive_string.c

libarchive: Force GNU iconv compatibility on FreeBSD

When libarchive is compiled with FreeBSD's native iconv instead of
libiconv, as happens with libarchive in the base system, we need to
configure iconv(3) to handle invalid sequences by returning -1, as
iconv_strncat_in_locale() assumes GNU iconv semantics.

This corresponds to upstream PR 3056.

PR:             294577
MFC after:      1 week

(cherry picked from commit bd15d6ef126ee4c0eac931117f6bbbf6f9a3fc72)
DeltaFile
+11-1contrib/libarchive/libarchive/archive_string.c
+11-11 files

FreeBSD/src 7028772sys/dev/uart uart_dev_ns8250.c uart_dev_pl011.c

uart: Tidy the compat tables

No functional change intended.

MFC after:      1 week
Sponsored by:   Klara, Inc.
Sponsored by:   NetApp, Inc.
Reviewed by:    royger
Differential Revision:  https://reviews.freebsd.org/D57269

(cherry picked from commit 40c846dc07943df7cdebf091de09d5680a3f3606)
DeltaFile
+22-22sys/dev/uart/uart_dev_ns8250.c
+15-15sys/dev/uart/uart_dev_pl011.c
+37-372 files

FreeBSD/src 39381fcusr.bin/cap_mkdb cap_mkdb.c

cap_mkdb: Fix memory leak

This is not a big deal since it only iterates once before exiting, but
that's no reason to set a bad example.

PR:             195128
MFC after:      1 week
Reviewed by:    ngie
Differential Revision:  https://reviews.freebsd.org/D57251

(cherry picked from commit 6880405bf97df03ffce227d34c2faa99b602a49d)
DeltaFile
+2-1usr.bin/cap_mkdb/cap_mkdb.c
+2-11 files

FreeBSD/src 5d36fcclib/libsys open.2

open.2: document O_PATH behavior for bindat/connectat

Reviewed by:    markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D57370
DeltaFile
+6-0lib/libsys/open.2
+6-01 files

FreeBSD/src 12c590asys/kern uipc_usrreq.c

bindat(2)/connectat(2): allow implicit EMPTYPATH for unix domain sockets

path specification.

Reviewed by:    markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D57370
DeltaFile
+4-3sys/kern/uipc_usrreq.c
+4-31 files

FreeBSD/src 4f7092eusr.sbin/virtual_oss/virtual_oss_cmd command.c

virtual_oss_cmd(8): Improve error messages

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
DeltaFile
+4-13usr.sbin/virtual_oss/virtual_oss_cmd/command.c
+4-131 files

FreeBSD/src eb5aa5cusr.sbin/bsdinstall/scripts services

bsdinstall: Add virtual_oss service option

Since virtual_oss is now part of base, there is no reason not to provide
an installer option to enable it, and make it more visible to new users,
who might also benefit from the devd rules in /etc/devd/snd.conf, which
use virtual_oss, as well as 8532b4a43636 ("rc: virtual_oss: Create a
loopback device in the default configuration").

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Reviewed by:    ivy
Pull-Request:   https://ron-dev.freebsd.org/FreeBSD/src/pulls/31
DeltaFile
+5-0usr.sbin/bsdinstall/scripts/services
+5-01 files

FreeBSD/src 5dbbd76sys/compat/linux linux_signal.c

linux: Fix missing break in lsiginfo_to_siginfo()

Prevent LINUX_SI_TKILL from inadvertently falling through to
LINUX_SI_QUEUE, which incorrectly overwrote si_code with SI_QUEUE
instead of SI_LWP.
DeltaFile
+1-0sys/compat/linux/linux_signal.c
+1-01 files

FreeBSD/src ea4888esys/netpfil/ipfw/nat64 nat64lsn.c

nat64lsn: Fix type confusion panic when using wrong NAT64 instance type

When an ipfw rule references a NAT64 instance by name using
'nat64lsn', the kernel looks up the instance in the shared
srvstate[] array without verifying the instance type.
If the named instance is actually a nat64clat or nat64stl
instance (created with 'nat64clat' or 'nat64stl'), the code
incorrectly casts the instance to nat64lsn_instance and
dereferences the ->cfg pointer, which causes a kernel panic.

The root cause is that all NAT64 instance types share the same
srvstate[] array but have different struct layouts.
For nat64lsn_instance, the field after 'no' is a pointer to nat64lsn_cfg.
For nat64clat_cfg, the same offset contains an embedded nat64_config struct.

Fix by adding a type check after NAT64_LOOKUP() to verify that the
instance's etlv matches IPFW_TLV_NAT64LSN_NAME before proceeding.
If the type doesn't match, return IP_FW_DENY to reject the packet
safely rather than crashing.

    [6 lines not shown]
DeltaFile
+2-1sys/netpfil/ipfw/nat64/nat64lsn.c
+2-11 files

FreeBSD/src a13800esys/dev/sound/pci/hda hdaa_patches.c hdac.h

snd_hda: Patch Dell WYSE 7040

https://forums.freebsd.org/threads/dell-wyse-7040-thin-client-intel-i5-6500te-built-in-sound-alc255-mini-how-to.102656/

Reported by:    razif (on the forum)
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week

(cherry picked from commit c6cefcbbbb3fd5bbe9e0c36c8c553364d444e2d8)
DeltaFile
+9-0sys/dev/sound/pci/hda/hdaa_patches.c
+1-0sys/dev/sound/pci/hda/hdac.h
+10-02 files

FreeBSD/src 1cef7e9. ObsoleteFiles.inc

ObsoleteFiles: Add some ancient locale symlinks

These were dropped in 2021 but were never listed in ObsoleteFiles.inc,
so systems that have been upgraded from source since before that date
(or from 13.x) may still have them.

PR:             295668
MFC after:      1 week
Fixes:          0a36787e4c1f ("locales: separate unicode from other locales")
Reviewed by:    bapt
Differential Revision:  https://reviews.freebsd.org/D57331
DeltaFile
+7-0ObsoleteFiles.inc
+7-01 files

FreeBSD/src c515e60sys/compat/linux linux_ptrace.c

linux: Implement PTRACE_GETREGSET NT_PRFPREG and NT_X86_XSTATE

Implement NT_PRFPREG and NT_X86_XSTATE for PTRACE_GETREGSET on amd64.
Chrome's crashpad handler uses these to collect floating-point and
extended CPU register state for crash dumps.

Other architectures retain the previous EINVAL stub behavior.

Signed-off-by:  Ricardo Branco <rbranco at suse.de>
PR:             289285
Reviewed by:    kib
Pull-Request:   https://github.com/freebsd/freebsd-src/pull/2165
DeltaFile
+85-6sys/compat/linux/linux_ptrace.c
+85-61 files

FreeBSD/src b84d31esys/amd64/linux linux_machdep.c linux.h

linux: Add linux_pt_fpregset and bsd_to_linux_fpregset() for amd64

Add struct linux_pt_fpregset, the amd64 Linux NT_PRFPREG payload,
corresponding to user_i387_struct in Linux. The struct describes
the 512-byte FXSAVE area as exposed by PTRACE_GETREGSET.

Add bsd_to_linux_fpregset() to translate from FreeBSD's struct fpreg
to struct linux_pt_fpregset. Fields are extracted from the fpr_env[]
array which stores the FXSAVE environment packed as four 64-bit words.
The FP and XMM register banks are bulk-copied as opaque byte arrays.

Signed-off-by:  Ricardo Branco <rbranco at suse.de>
Reviewed by:    kib
Pull-Request:   https://github.com/freebsd/freebsd-src/pull/2165
DeltaFile
+20-0sys/amd64/linux/linux_machdep.c
+18-0sys/amd64/linux/linux.h
+38-02 files

FreeBSD/src 7b26353sys/x86/cpufreq hwpstate_intel.c

hwpstate_intel: Disable package control on hybrid CPU

In package control mode, the performance of all cores depends on the
most recent value written to the request field. If the last write comes
from an E-core, all cores are forced to align with the E-core
performance level, resulting in significant performance degradation.
Therefore, package control is disabled on hybrid-core systems.

Reviewed by:    olce
MFC after:      2 weeks
Sponsored by:   The FreeBSD Foundation
Sponsored by:   Framework Computer Inc
Differential Revision: https://reviews.freebsd.org/D57377
DeltaFile
+21-0sys/x86/cpufreq/hwpstate_intel.c
+21-01 files

FreeBSD/src 553ef18lib/libufs inode.c, sbin/fsck_ffs inode.c

Avoid incorrect UFS1 timestamp corrections when system clock fails at boot.

Git 1111a44301da - main - Defer the January 19, 2038 date limit in
UFS1 file systems to February 7, 2106 - did so by changing the UFS1
32-bit signed timestamps to unsigned. With this change, time stamps
from before January 1, 1970 went from being negative numbers to
large positive numbers implying times in the future. When such a
time stamp is encountered when an inode is read into memory or when
it is encountered by fsck, its timestamp is replaced with the
kernel's current time.

Andre Albsmeier reported that he had a machine reboot after a power
failure and the battery that maintained its real-time clock had
died. The result was that the system booted with the time set to
five years earlier (absent a real-time clock value, the boot ROM
used the time that the boot ROM had last been updated). The net
result was that fsck reset the time stamps of all files newer than
five years old to the five year old time.


    [29 lines not shown]
DeltaFile
+9-8lib/libufs/inode.c
+4-3sys/ufs/ffs/ffs_vfsops.c
+2-1sbin/fsck_ffs/inode.c
+15-123 files

FreeBSD/src c485a0blib/msun/man math.3

man/math.3: mention fmaximum_mag_num, fminimum_mag_num

PR:             294719
MFC after:      1 month

(cherry picked from commit 9f98195ff615417f7af875b65cdaf220239206db)
DeltaFile
+5-3lib/msun/man/math.3
+5-31 files

FreeBSD/src f8a72f4lib/msun/src s_fminimum_num.c s_fminimum_numf.c

lib/msun: Replaced pattern to force exception in _num families

Replaced the old pattern of using a ternary to force addition
(raising exceptions for sNaN's) with a new one using a volatile
variable. The _mag_num family was already implemented with this pattern

PR:             294719
Reviewed by:    fuz, kargl
MFC after:      1 month

(cherry picked from commit 7c20e15592a07ea457cacb0d6706948815c8420e)
DeltaFile
+10-4lib/msun/src/s_fminimum_num.c
+10-4lib/msun/src/s_fminimum_numf.c
+10-4lib/msun/src/s_fminimum_numl.c
+10-4lib/msun/src/s_fmaximum_num.c
+10-4lib/msun/src/s_fmaximum_numf.c
+10-4lib/msun/src/s_fmaximum_numl.c
+60-246 files

FreeBSD/src 9bba4a2lib/msun/man fmaximum_mag_num.3, lib/msun/src s_fminimum_mag_num.c s_fmaximum_mag_num.c

lib/msun: fmaximum_mag_num family. Tests and man page

Added the fmaximum_mag_num{,f,l} and fminimum_mag_num{,f,l} functions.

PR:             294719
Reviewed by:    fuz, kargl
MFC after:      1 month

(cherry picked from commit f62d826a6f5b9022b0cedfe22a698998ad9cb7f4)
DeltaFile
+109-0lib/msun/man/fmaximum_mag_num.3
+90-0lib/msun/src/s_fminimum_mag_num.c
+88-0lib/msun/src/s_fmaximum_mag_num.c
+85-0lib/msun/src/s_fminimum_mag_numf.c
+84-0lib/msun/src/s_fmaximum_mag_numf.c
+79-0lib/msun/src/s_fminimum_mag_numl.c
+535-06 files not shown
+677-1912 files

FreeBSD/src f77d37csys/compat/linux linux_file.c

linuxulator: Return EINVAL for invalid inotify flags

We implement all of the currently-defined Linux inotify mask bits and
flags, with the same values as Linux.  Return EINVAL for unknown bits,
as Linux does.

This also moves the translation inline into linux_inotify_add_watch.

Reviewed by:    markj
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57387
DeltaFile
+6-12sys/compat/linux/linux_file.c
+6-121 files

FreeBSD/src 68004e5sys/net if.c if_private.h

net: Fix handling of unmapped user pages in if_getgroup()

We cannot call copyout() while in a net epoch section, unless the user
memory is wired.  Use the global ifnet lock to synchronize the accesses
instead.

Reported by:    emaste
Reviewed by:    zlei
MFC after:      2 weeks
Differential Revision:  https://reviews.freebsd.org/D57154
DeltaFile
+23-33sys/net/if.c
+1-1sys/net/if_private.h
+24-342 files

FreeBSD/src 49d90d9sys/net if_lagg.c

lagg: Handle a port count of zero

The sc_count check in lagg_transmit_ethernet() and
lagg_transmit_infiniband() is racy, as the lagg protocol handlers are
only synchronized by net_epoch.  Handle a count of 0 in each protocol
handler where it's needed, namely in the RR and LB handlers.

Reported by:    Yuxiang Yang, Yizhou Zhao, Xuewei Feng, Qi Li, and Ke Xu from Tsinghua University using GLM5.1 from Z.ai
Reviewed by:    pouria, zlei
MFC after:      2 weeks
Differential Revision:  https://reviews.freebsd.org/D56942
DeltaFile
+23-17sys/net/if_lagg.c
+23-171 files

FreeBSD/src 369207ausr.sbin/virtual_oss/virtual_oss virtual_oss.c

virtual_oss(8): Fix buffer overflow in voss_compressor() call

This particular calls swaps the samples and maxchan arguments, which can
cause a buffer overflow in p_ch_chain if maxchan exceeds its bounds
(VMAX_CHAN).

Reported by:    Yuxiang Yang, Yizhou Zhao, Ao Wang, Xuewei Feng, Qi Li, and Ke Xu from Tsinghua University using GLM-5.1 from Z.ai
Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
Reviewed by:    emaste

(cherry picked from commit 453de99b386d40754a038cc4b804f4c7a3b04624)
DeltaFile
+2-2usr.sbin/virtual_oss/virtual_oss/virtual_oss.c
+2-21 files

FreeBSD/src 8632639contrib/llvm-project/clang/lib/Serialization ASTReaderDecl.cpp

Merge commit 63c29df8eceb from llvm git (by Dmitry Polukhin):

  [Serialization] Fix assertion on re-deserialized friend template spec… (#200566)

  …ialization in PCH (#198133)

  A friend function-template specialization declared inside a class
  template is serialized into a PCH. When the class template is later
  instantiated while loading the PCH, the friend specialization can be
  deserialized re-entrantly (VisitFriendDecl -> VisitFunctionDecl -> ...
  -> VisitFunctionDecl for the same specialization) at the same time as
  the canonical copy, producing two redeclarations of the same
  specialization in the template's specialization set.

  ASTDeclReader::VisitFunctionDecl asserted that this collision could only
  happen when merging declarations from different modules. Since
  38b3d87bd384, friend functions defined inside dependent class templates
  are loaded eagerly, so the collision can now also occur within a single
  PCH/AST file (non-modules build), tripping the assertion:

    [16 lines not shown]
DeltaFile
+0-2contrib/llvm-project/clang/lib/Serialization/ASTReaderDecl.cpp
+0-21 files