FreeBSD/src 331f2c1lib/libarchive/tests Makefile

libarchive: fix duplicate entry in tests Makefile

Reported by:    des
MFC after:      2 weeks (together with 2e113ef82)
DeltaFile
+0-1lib/libarchive/tests/Makefile
+0-11 files

FreeBSD/src 89bb17esys/arm64/arm64 ptrauth.c

arm64: Mask out the PAC ID fields when disabled

When we disable PAC we need to mask out the ID registers for userspace.
Call update_special_reg to mask them out so userspace gets a correct
view of the registers and hwcaps.

Sponsored by:   Arm Ltd
Differential Revision:  https://reviews.freebsd.org/D50573
DeltaFile
+9-3sys/arm64/arm64/ptrauth.c
+9-31 files

FreeBSD/src 2aeac25sys/arm64/arm64 identcpu.c, sys/arm64/include cpu.h

arm64: Add a function to restrict the ID registers

This will be used when we need to restrict the register values, e.g.
when an erratum is present that means we need to disable a feature we
will need to remove some fields from these registers.

Sponsored by:   Arm Ltd
Differential Revision:  https://reviews.freebsd.org/D50572
DeltaFile
+91-36sys/arm64/arm64/identcpu.c
+1-0sys/arm64/include/cpu.h
+92-362 files

FreeBSD/src 38fd088sys/arm64/arm64 identcpu.c machdep.c

arm64: Move users of sanitised ID registers later

To allow for masking of ID registers in the presence of errata move
the late ifunc resolvers and CPU identification functions until after
the errata detection has run.

Sponsored by:   Arm Ltd
Differential Revision:  https://reviews.freebsd.org/D50571
DeltaFile
+6-1sys/arm64/arm64/identcpu.c
+3-1sys/arm64/arm64/machdep.c
+9-22 files

FreeBSD/src 4d7c31blib/libc/tests/gen glob2_test.c glob_blocks_test.c

glob2_test: Add tests for error callback functions and blocks

This change adds tests that check basic callback functionality for
blocks and function pointers. The tests also make sure that GLOB_ERR
overrides the callback's return value.

Sponsored by:   Klara, Inc.
Differential Revision:  https://reviews.freebsd.org/D50486
DeltaFile
+59-1lib/libc/tests/gen/glob2_test.c
+49-0lib/libc/tests/gen/glob_blocks_test.c
+4-1lib/libc/tests/gen/Makefile
+112-23 files

FreeBSD/src 1e0743finclude glob.h, lib/libc/gen glob.c glob.3

glob: Add blocks support

This change introduces the `glob_b` function which takes a block instead
of a function pointer.

Relnotes:       yes
Sponsored by:   Klara, Inc.
Inspired by:  https://github.com/apple-oss-distributions/Libc
Differential Revision:  https://reviews.freebsd.org/D50485
DeltaFile
+55-15lib/libc/gen/glob.c
+57-9lib/libc/gen/glob.3
+14-2include/glob.h
+1-0lib/libc/gen/Symbol.map
+1-0lib/libc/gen/Makefile.inc
+128-265 files

FreeBSD/src 61d77e6stand/common commands.c

loader: allow for exceptions to restricted settings.

We restrict what an unverified loader.conf etc can set,
and the same restrictions are applied to interactive input.
We need to allow for exceptions (eg boot_verbose).
It is best if any allowed settings match up to '='.

If we do not allow it to be set, do not allow it to be unset

Reviewed by:    stevek
Sponsored by:   Juniper Networks, Inc.
DeltaFile
+73-22stand/common/commands.c
+73-221 files

FreeBSD/src f989020stand/common install.c

install: must set netproto for tftp://

tftp_open requires netproto is NET_TFTP

Reviewed by:    stevek
DeltaFile
+1-0stand/common/install.c
+1-01 files

FreeBSD/src 2e113efcontrib/libarchive/libarchive archive_parse_date.c archive_getdate.c, contrib/libarchive/libarchive/test test_read_format_7zip_sfx_elf.elf.uu test_read_format_7zip_sfx_pe.exe.uu

libarchive: merge from vendor branch

libarchive 3.8.1

New features:
 #2088 7-zip reader: improve self-extracting archive detection
 #2137 zip writer: added XZ, LZMA, ZSTD and BZIP2 support
 #2403 zip writer: added LZMA + RISCV BCJ filter
 #2601 bsdtar: support --mtime and --clamp-mtime
 #2602 libarchive: mbedtls 3.x compatibility

Security fixes:
 #2422 tar reader: Handle truncation in the middle of a GNU long linkname
       CVE-2024-57970
 #2532 tar reader: fix unchecked return value in list_item_verbose()
       CVE-2025-25724
 #2532 unzip: fix null pointer dereference
       CVE-2025-1632
 #2568 warc: prevent signed integer overflow

    [28 lines not shown]
DeltaFile
+9,442-0contrib/libarchive/libarchive/test/test_read_format_7zip_sfx_elf.elf.uu
+4,751-0contrib/libarchive/libarchive/test/test_read_format_7zip_sfx_pe.exe.uu
+2,107-0contrib/libarchive/libarchive/test/test_write_format_mtree_preset_digests.c
+1,147-0contrib/libarchive/libarchive/archive_parse_date.c
+0-1,100contrib/libarchive/libarchive/archive_getdate.c
+879-105contrib/libarchive/libarchive/archive_write_set_format_zip.c
+18,326-1,205179 files not shown
+26,875-3,633185 files

FreeBSD/src 76141d3libarchive archive_read_support_format_tar.c archive_util.c, libarchive/test test_read_format_tar_mac_metadata_1.tar.uu test_read_format_tar_mac_metadata.c

Update vendor/libarchive to 3.8.1

Notable bugfixes:
 #2634 tar: Support negative time values with pax
 #2637 tar: Keep block alignment after pax error
 #2642 libarchive: fix FILE_skip regression
 #2643 tar: Handle extra bytes after sparse entries
 #2649 compress: Prevent call stack overflow
 #2651 iso9660: always check archive_string_ensure return value

Obtained from:  libarchive
Vendor commit:  9525f90ca4bd14c7b335e2f8c84a4607b0af6bdf
DeltaFile
+231-0libarchive/test/test_read_format_tar_mac_metadata_1.tar.uu
+84-60libarchive/archive_read_support_format_tar.c
+85-0libarchive/test/test_read_format_tar_mac_metadata.c
+16-60libarchive/archive_util.c
+68-0libarchive/test/test_read_format_tar_pax_negative_time.c
+65-0libarchive/test/test_read_pax_empty_val_no_nl.c
+549-12032 files not shown
+933-29338 files

FreeBSD/src cbcfc2bsys/amd64/conf GENERIC-KASAN GENERIC-KCSAN, sys/arm64/conf GENERIC-KASAN

conf: Make sanitizer configs include the debug config

This is a direct commit to stable/14.
DeltaFile
+1-1sys/amd64/conf/GENERIC-KASAN
+1-1sys/amd64/conf/GENERIC-KCSAN
+1-1sys/amd64/conf/GENERIC-KMSAN
+1-1sys/arm64/conf/GENERIC-KASAN
+4-44 files

FreeBSD/src f7d9af3usr.bin/du/tests du_test.sh

du: Add regression tests

Reviewed by:    markj
MFC after:      1 month
Pull Request:   https://github.com/freebsd/freebsd-src/pull/1648

(cherry picked from commit 3e5550d25c6d614f422506373f7068c6c366fa85)
DeltaFile
+129-1usr.bin/du/tests/du_test.sh
+129-11 files

FreeBSD/src 226076asys/netinet6 icmp6.c ip6_forward.c

netinet6: Do not forward or send ICMPv6 messages to the unspec address

As in f7174eb2b4c4 ("netinet: Do not forward or ICMP response to
INADDR_ANY"), the IPv6 stack should avoid sending packets to the
unspecified address.  In particular:
- Make sure that we do not forward received packets to the unspecified
  address; the check in ip6_input() catches this in the common case, but
  after commit 40faf87894ff it's possible for a pfil hook to bypass this
  check and pass the packet to ip6_forward() using the
  PACKET_TAG_IPFORWARD tag.
- Make sure that we do not reflect packets back to the unspecified
  address; RFC 4443 section 2.4 states that we must not generate error
  messages in response to packets from the unspecified address.

Reviewed by:    zlei, glebius
Reported by:    Franco Fichtner <franco at opnsense.org>
MFC after:      1 month
Sponsored by:   Klara, Inc.
Sponsored by:   OPNsense

    [3 lines not shown]
DeltaFile
+6-0sys/netinet6/icmp6.c
+2-1sys/netinet6/ip6_forward.c
+8-12 files

FreeBSD/src 1a03846sys/kern vfs_cache.c

vfs cache: Simplify cache_enter_time() a bit

The condition `flag == NFC_ISDOTDOT && vp != NULL && vp->v_type != VDIR`
is never true at this point in the function.  This is asserted slightly
earlier.  So, remove some dead code and simplify control flow.

N.B. we set v_cache_dd for all vnode types, not just VDIR.  This seems
to be intentional, see commit ce575cd0e2f9069.  For regular files it
appears to effectively represent the most recently entered cache entry
for the vnode.

No functional change intended.

Reviewed by:    olce, kib
MFC after:      2 weeks
Sponsored by:   Klara, Inc.
Differential Revision:  https://reviews.freebsd.org/D50107

(cherry picked from commit 01435e28211220f985c66569f60939e440f0887f)
DeltaFile
+13-21sys/kern/vfs_cache.c
+13-211 files

FreeBSD/src ea8b5e7etc/mtree BSD.tests.dist, usr.sbin/sysrc Makefile

sysrc: Add some regressions tests

Reviewed by:    markj
MFC after:      1 month
Pull Request:   https://github.com/freebsd/freebsd-src/pull/1664

(cherry picked from commit eeb2d4ffe95b4332811c14b56cfdf5fc6ea821b0)
DeltaFile
+351-0usr.sbin/sysrc/tests/sysrc_test.sh
+4-0usr.sbin/sysrc/Makefile
+3-0usr.sbin/sysrc/tests/Makefile
+2-0etc/mtree/BSD.tests.dist
+360-04 files

FreeBSD/src 8ba7ac5usr.sbin/makefs/ffs mkfs.c

makefs: Ensure that FFS superblocks are reproducible

The superblock structure has space reserved for a pointer to an
in-memory structure that gets created at mount time.  makefs populates
it since that simplifies code elsewhere.  However, the pointer value
ends up in the output file, which breaks reproducibility.

Zero the field when writing the superblock instead, as its on-disk value
is ignored.

Reviewed by:    emaste
MFC after:      2 weeks
Sponsored by:   Klara, Inc.
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D50196

(cherry picked from commit 764ccf410c3c5453c4656113d75cd81fcf01828d)
DeltaFile
+10-2usr.sbin/makefs/ffs/mkfs.c
+10-21 files

FreeBSD/src cdf6e2dsys/kgssapi/krb5 kcrypto_aes.c

krb5: Fix handling of transient crypto request failures

- Instead of using CRYPTO_F_DONE to decide whether a request has
  completed, use a custom protocol of setting crp_opaque = NULL in the
  callback and checking that instead.  CRYPTO_F_DONE is set independent
  of whether an error occurred, but for transient errors signaled by
  EAGAIN, we want to simply retry the request.
- Clear CRYPTO_F_DONE before retrying the request.
- Panic if the request truly failed, as we currently have no way to
  pass hard errors back up.

Reviewed by:    jhb
MFC after:      2 weeks
Differential Revision:  https://reviews.freebsd.org/D50238

(cherry picked from commit 04421fda140b92eb0d22bc4c0f81b6de05f21225)
DeltaFile
+19-11sys/kgssapi/krb5/kcrypto_aes.c
+19-111 files

FreeBSD/src 001fc46sys/kern kern_descrip.c

file: Simplify an INVARIANTS check in _fdrop()

No functional change intended.

MFC after:      1 week
Sponsored by:   Klara, Inc.

(cherry picked from commit a2e22ed3420d92d9d98a1e9681b5c9b1fbe40fca)
DeltaFile
+3-6sys/kern/kern_descrip.c
+3-61 files

FreeBSD/src 5ea5220usr.bin/du du.c

du: Fix threshold on non-directory files

PR:             265200
Reviewed by:    markj
MFC after:      1 month
Pull Request:   https://github.com/freebsd/freebsd-src/pull/1648

(cherry picked from commit 0ae2b9e866d3aea1e9141841488561f12603f879)
DeltaFile
+3-1usr.bin/du/du.c
+3-11 files

FreeBSD/src f00a7fausr.sbin/sysrc sysrc

sysrc: Fix check flag logic for append and subtract

When using sysrc with the check flag (-c), the append (+=) and subtract
(-=) operations result in incorrect return values because on the check
path the necessary union/difference calculation logic is not performed.

However, the correct union/difference calculation is already performed
when running without the check flag. We fix the issue on the check path
by using the results from the existing union/difference calculation in
the check logic to get the correct return values.

PR:             279200
Reviewed by:    markj
MFC after:      1 month
Pull Request:   https://github.com/freebsd/freebsd-src/pull/1664

(cherry picked from commit c97460c4d97db1bd46dab9f2bdbc90cd1ed7757f)
DeltaFile
+25-27usr.sbin/sysrc/sysrc
+25-271 files

FreeBSD/src 12effd9sys/kern vfs_cache.c, sys/sys vnode.h

vfs cache: Move hash row lookup loops into a subroutine

No functional change intended.

Reviewed by:    olce, kib
MFC after:      2 weeks
Sponsored by:   Klara, Inc.
Differential Revision:  https://reviews.freebsd.org/D50106

(cherry picked from commit cc25864d4568079cadef46291ddf7d501c81d60a)
DeltaFile
+64-65sys/kern/vfs_cache.c
+1-0sys/sys/vnode.h
+65-652 files

FreeBSD/src b080a04sys/kern vfs_cache.c

vfs cache: Add a predicate for testing cache entries

No functional change intended.

Reviewed by:    olce, kib
MFC after:      2 weeks
Sponsored by:   Klara, Inc.
Differential Revision:  https://reviews.freebsd.org/D50105

(cherry picked from commit 029ed5f574f61443fd12e0e70c7ab4dc296b81e5)
DeltaFile
+20-20sys/kern/vfs_cache.c
+20-201 files

FreeBSD/src ad5eecbsys/net if.c

ifnet: Integrate if_unroute() into if_down()

if_unroute() is static since 2004 and is not used anywhere except for
if_down().

This also makes it easier to grep by the pattern `if_flags &= ~IFF_UP`.

No functional change intended.

Reviewed by:    glebius
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D49356

(cherry picked from commit 0693c3f7cb3d9e5389863a0c131ddef799c77091)
DeltaFile
+8-21sys/net/if.c
+8-211 files

FreeBSD/src c20e7ebsys/net if.c

ifnet: Fix a typo in a source code comment

- s/possiable/possible

MFC after:      3 days

(cherry picked from commit ad2d7e594f6d519be6e9674c8048a406a453fef9)
DeltaFile
+1-1sys/net/if.c
+1-11 files

FreeBSD/src 4bf049bsys/compat/linuxkpi/common/src linux_80211.c, sys/net80211 ieee80211_ht.c ieee80211.h

net80211: fix VHT160 and VHT80P80 selection and enable in LinuxKPI 802.11

Between 802.11ac-2013 and 802.11-2020 some fields were deprecated and the
way VHT160 and VHT80P80 are selected has changed.
In order to get onto VHT160 with modern APs adopt and support both the
deprecated as well as the new logic.

For simplicity of blocks we pull out the non-HT40 handling early on,
followed by the "use HT", followed by the deprectaed options and then
the 80Mhz channel width.

In all cases keep checking (a) what is locally supported, (b) what the
user has locally allowed (FVHT flags, [-]vht160 [-]vht80p80 [-]vht80
[-]vht40), as well as (c) what is announced.  Provide possible fallbacks
to lower channel widths in all cases (but VHT20, which means VHT is
disabled).

With this enable VHT160 and VHT80P80 in the LinuxKPI 802.11 driver
compat code as well.

    [5 lines not shown]
DeltaFile
+122-56sys/net80211/ieee80211_ht.c
+1-8sys/compat/linuxkpi/common/src/linux_80211.c
+6-3sys/net80211/ieee80211.h
+129-673 files

FreeBSD/src 517eb20sys/net if_fwsubr.c

if_firewire: Make firewire_broadcastaddr static const

This global variable is used only in this file. While here, constify it
since it is only used to read.

No functional change intended.

MFC after:      1 week
DeltaFile
+2-2sys/net/if_fwsubr.c
+2-21 files

FreeBSD/src 9de72afusr.sbin/bsdinstall/scripts jail auto

bsdinstall: restore the environment when restarting

It is possible to restart the installation process upon errors, when
installing normally through the `auto` script, or when installing a jail
with the `jail` script. However, some values obtained interactively from
the user or guessed by some scripts were kept in the environment when
restarting the process; this made it impossible to re-run some steps as
expected after the restart.

For instance, if a bad choice of mirror was made in the `mirrorselect`
phase, restarting the installer remembered the choice made, and would
never prompt for a different one again. Rebooting was then the only easy
way out of this situation.

This change restores a pre-defined list of environment variables when
restarting the installation process.

PR:             266987
Reviewed by:    emaste

    [3 lines not shown]
DeltaFile
+46-4usr.sbin/bsdinstall/scripts/jail
+33-0usr.sbin/bsdinstall/scripts/auto
+79-42 files

FreeBSD/src cf624ffsbin/ifconfig af_inet6.c, sbin/ifconfig/tests inet6.sh Makefile

ifconfig: reject netmask and broadcast for inet6

We don't support setting netmask or broadcast address for INET6
addresses, and trying to do crashes ifconfig.  Handle this the
same way as af_link, by rejecting attempts to configure these
parameters.

PR:     286910
Reported by:    Hayzam Sherif <hayzam at alchemilla.io>
MFC after:      3 days
Reviewed by:    zlei, kevans, des, cy
Approved by:    kevans (mentor)
Differential Revision:  https://reviews.freebsd.org/D50413

(cherry picked from commit 59ee9260e6bbcc3b5654126eed6e9490315c81f1)

ifconfig tests: remove incorrect #!

Fixes: 59ee9260e6bb ("ifconfig: reject netmask and broadcast for inet6")

    [5 lines not shown]
DeltaFile
+83-0sbin/ifconfig/tests/inet6.sh
+4-2sbin/ifconfig/tests/Makefile
+5-0sbin/ifconfig/af_inet6.c
+92-23 files

FreeBSD/src 59f18f8sys/net if_bridge.c

bridge: check allow_llz_overlap before member_ifaddrs

When adding a new interface to a bridge and allow_llz_overlap=0, which
is the default value, if_bridge checks if the interface has IPv6 link
local addresses assigned, and if it does, it calls in6_ifdetach() to
remove all IPv6 addresses from the interface.

This means it was possible to do this:

        % ifconfig bridge1 create inet6 -ifdisabled auto_linklocal up
        % ifconfig epair20 create inet6 -ifdisabled auto_linklocal up
        % ifconfig bridge1 addm epair20a

... with the result that the link-local address on epair20a would be
removed, then the interface would be added to the bridge.

If member_ifaddrs=0, which is also the default value, this no longer
works:


    [17 lines not shown]
DeltaFile
+20-19sys/net/if_bridge.c
+20-191 files

FreeBSD/src 7d88b0elibexec/rc rc.subr

rc.subr: remove the dependency on bsdconfig

rc.subr uses sysrc(8) for the 'enable' and 'disable' commands, which
means the entire rc(8) stack depends on bsdconfig.  Instead, provide a
minimal amount of rc.conf-editing functionality in rc.subr and use it to
implement these commands.

Reviewed by:    des, bapt
Approved by:    des (mentor)
Differential Revision:  https://reviews.freebsd.org/D50325

(cherry picked from commit f6328f052518d56c01f10e14cd9ef1f2675c01a4)
DeltaFile
+86-16libexec/rc/rc.subr
+86-161 files