FreeBSD/src 2ddefc8libexec/rtld-elf rtld.c

rtld: fix processing of preloaded z_initfirst objects

(cherry picked from commit 9b844b495e8e63439ffe523757ac7444a16317af)
DeltaFile
+5-0libexec/rtld-elf/rtld.c
+5-01 files

FreeBSD/src f3ca689usr.bin/kdump kdump.c Makefile

kdump: tweaks for the extended errors decoding

(cherry picked from commit 5c89d661a023c83a2001cf5b354b09c7d3ac91d8)
DeltaFile
+20-3usr.bin/kdump/kdump.c
+1-0usr.bin/kdump/Makefile
+21-32 files

FreeBSD/src 75ae51busr.bin/kdump kdump.c

kdump(1): add sys/ prefix for exterror source file name

(cherry picked from commit 4d062dbc20dce5a94da8dca1253ac9337b951c51)
DeltaFile
+1-1usr.bin/kdump/kdump.c
+1-11 files

FreeBSD/src 0b6f465libexec/rtld-elf rtld.c

rtld: fix processing of preloaded z_initfirst objects

(cherry picked from commit 9b844b495e8e63439ffe523757ac7444a16317af)
DeltaFile
+5-0libexec/rtld-elf/rtld.c
+5-01 files

FreeBSD/src c72edc2sys/dev/ahci ahci_pci.c

ahci(4): Add another device ID for Marvell 9128 SATA controller: 0x91a3

This was encountered on a Gigabyte GA-P55A-UD4 motherboard identifying itself
as:
ahci0 at pci0:2:0:0:       class=0x01018f rev=0x11 hdr=0x00 vendor=0x1b4b device=0x91a3 subvendor=0x1458 subdevice=0xb000
    vendor     = 'Marvell Technology Group Ltd.'
    class      = mass storage
    subclass   = ATA

The physical chip has "88SE9128-NAA2" printed on it.

Similar code has been in Linux for a long time:
https://github.com/torvalds/linux/commit/50be5e3657cd2851a297dc0b3fd459f25829d29b

Co-authored-by: Michael Osipov <michaelo at FreeBSD.org>
PR:             288526
Reviewed by:    jhb
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D56464
DeltaFile
+2-0sys/dev/ahci/ahci_pci.c
+2-01 files

FreeBSD/src f4418cfsys/compat/linuxkpi/common/include/linux seq_file.h, sys/compat/linuxkpi/common/src linux_seq_file.c

LinuxKPI: Update seq_file to properly implement the iterator interface

The seq_file.rst documentation in the Linux kernel documents the
iterator interface for the seq_file structure.  In particular, the
ppos passed to seq_read is a logical offset into a seq_file managed by
the iterator interface, not an offset into the generated data.  For
example, if a seq_file outputs state for each node in a linked-list or
array, *ppos might be used as the index of the node to output, not a
byte offset.

Rewrite seq_read to honor this contract which fixes a few bugs:

- Treat *ppos as a logical iterator offset that is only updated by the
  next callback after outputting a single item via the show method.

- Use a loop to permit outputting descriptions of multiple items if
  the user buffer is large enough.

- Always invoke the stop method after terminating the loop to cleanup

    [9 lines not shown]
DeltaFile
+57-7sys/compat/linuxkpi/common/src/linux_seq_file.c
+2-0sys/compat/linuxkpi/common/include/linux/seq_file.h
+59-72 files

FreeBSD/src 9b95cabcontrib/tzdata northamerica NEWS

contrib/tzdata: import tzdata 2026b

Changes: https://github.com/eggert/tz/blob/2026b/NEWS

MFC after:      3 days
DeltaFile
+55-1contrib/tzdata/northamerica
+45-8contrib/tzdata/NEWS
+3-0contrib/tzdata/zonenow.tab
+1-1contrib/tzdata/zone1970.tab
+1-1contrib/tzdata/version
+1-1contrib/tzdata/zone.tab
+106-126 files

FreeBSD/src 44e4f45sys/arm64/arm64 pmap.c, sys/arm64/include hypervisor.h pmap.h

arm64/vmm: Enable 16-bit VMIDs when in use by pmap

pmap_init always uses 16-bit VMIDs when supported, but we never enable
them in VTCR_EL2 (for ASIDs, locore enables them in TCR_EL1 and
pmap_init keys off whether they've been enabled, but the order in which
pmap_init and vmmops_modinit run is reversed). As a result, although the
full 16-bit value can be stored to VTTBR_EL2 and read back, the upper 8
bits are treated as 0, and so VMIDs that our VMID allocation believes
are distinct end up aliasing.

In future this interface may change such that vmm decides on the VMID
width and tells the pmap to use that, with appropriate support for
unloading and reloading vmm, but that can come as a follow-up change, as
this is a more minimal bug fix.

Reviewed by:    markj
Obtained from:  CheriBSD
Fixes:          47e073941f4e ("Import the kernel parts of bhyve/arm64")
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D55860
DeltaFile
+11-0sys/arm64/arm64/pmap.c
+2-0sys/arm64/include/hypervisor.h
+2-0sys/arm64/vmm/vmm_arm64.c
+1-0sys/arm64/include/pmap.h
+16-04 files

FreeBSD/src 5cfcccfcontrib/tzcode NEWS version, contrib/tzdata northamerica zonenow.tab

Revert "Import tzdata 2026b"

This reverts commit 5417f0bbde91c148b3c3982eb2ab23a675b5e8d1.
DeltaFile
+1-55contrib/tzdata/northamerica
+8-45contrib/tzcode/NEWS
+0-3contrib/tzdata/zonenow.tab
+1-1contrib/tzcode/version
+1-1contrib/tzdata/zone.tab
+1-1contrib/tzdata/zone1970.tab
+12-1066 files

FreeBSD/src 5417f0bcontrib/tzcode NEWS version, contrib/tzdata northamerica zonenow.tab

Import tzdata 2026b
DeltaFile
+55-1contrib/tzdata/northamerica
+45-8contrib/tzcode/NEWS
+3-0contrib/tzdata/zonenow.tab
+1-1contrib/tzdata/zone1970.tab
+1-1contrib/tzdata/zone.tab
+1-1contrib/tzcode/version
+106-126 files

FreeBSD/src def146f. northamerica NEWS

Import tzdata 2026b
DeltaFile
+55-1northamerica
+45-8NEWS
+3-0zonenow.tab
+1-1zone1970.tab
+1-1zone.tab
+1-1version
+106-126 files

FreeBSD/src ff11ae1sys/amd64/amd64 mp_machdep.c

amd64: fix INVLPGB range invalidation

AMD64 Architecture Programmer's Manual Volume 3 says the following:

> ECX[15:0] contains a count of the number of sequential pages to
> invalidate in addition to the original virtual address, starting from
> the virtual address specified in rAX. A count of 0 invalidates a
> single page. ECX[31]=0 indicates to increment the virtual address at
> the 4K boundary. ECX[31]=1 indicates to increment the virtual address
> at the 2M boundary. The maximum count supported is reported in
> CPUID function 8000_0008h, EDX[15:0].

ECX[31] being what we call INVLPGB_2M_CNT, signaling to increment the
VA by 2M.

> This instruction invalidates the TLB entry or entries, regardless of
> the page size (4 Kbytes, 2 Mbytes, 4 Mbytes, or 1 Gbyte). [...]

Combined with this, my interpretation of the current code is: if

    [21 lines not shown]
DeltaFile
+6-19sys/amd64/amd64/mp_machdep.c
+6-191 files

FreeBSD/src 280cfe2sys/amd64/amd64 mp_machdep.c

amd64: fix INVLPGB range invalidation

AMD64 Architecture Programmer's Manual Volume 3 says the following:

> ECX[15:0] contains a count of the number of sequential pages to
> invalidate in addition to the original virtual address, starting from
> the virtual address specified in rAX. A count of 0 invalidates a
> single page. ECX[31]=0 indicates to increment the virtual address at
> the 4K boundary. ECX[31]=1 indicates to increment the virtual address
> at the 2M boundary. The maximum count supported is reported in
> CPUID function 8000_0008h, EDX[15:0].

ECX[31] being what we call INVLPGB_2M_CNT, signaling to increment the
VA by 2M.

> This instruction invalidates the TLB entry or entries, regardless of
> the page size (4 Kbytes, 2 Mbytes, 4 Mbytes, or 1 Gbyte). [...]

Combined with this, my interpretation of the current code is: if

    [21 lines not shown]
DeltaFile
+6-19sys/amd64/amd64/mp_machdep.c
+6-191 files

FreeBSD/src 09fe5cctests/sys/kqueue kqueue_fork.c

tests: kqueue: improve diagnostics for our CPONFORK test

Notably, confirm in the child that our close-on-fork fd is actually
closed, and break RECV_ALL out into a table and check each bit
individually to provide a better message when the test fails.

While we're here, just switch to waitid() rather than trying to identify
the point where we have to make the switch.  This reduces maintenance
slightly, as keeping our assertion static would require still adding to
a _RECV_ALL mask *just* for that purpose.

Reviewed by:    kib, markj (both slightly earlier version)

(cherry picked from commit 51d2c38010824b90d7462711896a88165db9d015)
DeltaFile
+60-11tests/sys/kqueue/kqueue_fork.c
+60-111 files

FreeBSD/src 5cbb1e0usr.bin/find function.c find.1, usr.bin/find/tests find_test.sh

find: add -xattr and -xttrname

We use -xattr in our openrsync tests for convenience, and it seems like
a good addition to FreeBSD.  -xattr and -xattrname will both consult all
available namespaces by default, but -xattrname allows filtering by
namespace using a "user:" or "system:" prefix.

Inspired by:    https://github.com/apple-oss-distributions/shell_cmds
Reviewed by:    kib, rmacklem
Sponsored by:   Klara, Inc.

(cherry picked from commit 22fba3a9d64140d80a9e2093cfc02c9c503b2e19)
DeltaFile
+94-0usr.bin/find/function.c
+80-0usr.bin/find/tests/find_test.sh
+21-2usr.bin/find/find.1
+2-0usr.bin/find/option.c
+2-0usr.bin/find/extern.h
+199-25 files

FreeBSD/src ca19c92sys/sys extattr.h

<sys/extattr.h>: use designated initializers for EXTATTR_NAMESPACE_NAMES

This is not a functional change, but it makes it more clear upon
inspection of the definition that the mapping property described is
preserved.  Maybe more importantly, if one ends up getting an index
wrong or punching a hole in the name array unexpectedly, then it'll
hopefully manifest more clearly as a (null) or nullptr deref rather than
potentially just emitting the wrong namespace name.

It's noted that this almost certainly invalidates its use in C++, but
there aren't really any known C++ consumers of it- let's just cross
that bridge if we get there.

Reviewed by:    kib, mckusick, rmacklem
Sponsored by:   Klara, Inc.

(cherry picked from commit 84ce651836e0d037f611cd33a5c65e1d57049432)
DeltaFile
+3-3sys/sys/extattr.h
+3-31 files

FreeBSD/src cee4e16lib/libutil trimdomain.c trimdomain.3

libutil: take a size_t in trimdomain()

INT_MAX is already larger than a reasonable hostname might be, but
size_t makes some of this easier to reason about as we do arithmetic
with it.  This would maybe not be worth it if we had to bump the
soversion because of it, but libutil does symbol versioning now so we
can provide a compat shim.

While we're here, fix some inconsistencies in argument names in the
manpage.

Reviewed by:    des
Obtained from:  https://github.com/apple-oss-distributions/libutil
Sponsored by:   Klara, Inc.

(cherry picked from commit 7e70589b1bee4853cb11e3d8eb963079b18ff534)
DeltaFile
+17-1lib/libutil/trimdomain.c
+4-4lib/libutil/trimdomain.3
+4-1lib/libutil/Symbol.map
+1-1lib/libutil/libutil.h
+26-74 files

FreeBSD/src f3c488flib/libutil trimdomain.c, lib/libutil/tests trimdomain_test.c

libutil: avoid an out-of-bounds read in trimdomain(3)

memchr(3) will happily believe we've passed in a valid object, but
hostsize could easily exceed the bounds of fullhost.  Clamp it down to
the string size to be safe and avoid UB.  This plugs a potential
overread noted in the compat shim that was just added.

Reviewed by:    des
Sponsored by:   Klara, Inc.

(cherry picked from commit f268f95955f5f0f91f4d39e13bcd69a24e0d8ce4)
DeltaFile
+6-0lib/libutil/trimdomain.c
+3-1lib/libutil/tests/trimdomain_test.c
+9-12 files

FreeBSD/src 60000d9tests/sys/netpfil/pf nat.sh

tests/pf/nat: endpoint_independent: wait for tcpdump to start

This matches pflog.sh tests and fixes flaky tests found in CI[0].

[0] https://ci.freebsd.org/job/FreeBSD-main-amd64-test/28126/testReport/junit/sys.netpfil.pf/nat/endpoint_independent_exhaust/

PR:     289628
Reviewed by:    glebius
Approved by:    lwhsu (mentor)
Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
Differential Revision:  https://reviews.freebsd.org/D56145
DeltaFile
+28-16tests/sys/netpfil/pf/nat.sh
+28-161 files

FreeBSD/src aba2523sys/dev/sound/pcm ac97.c

sound: Do not check for NULL before deleting ac97_info->methods

It is allocated with M_WAITOK in ac97_create().

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Pull Request:   https://ron-dev.freebsd.org/FreeBSD/src/pulls/17
DeltaFile
+1-2sys/dev/sound/pcm/ac97.c
+1-21 files

FreeBSD/src 200b48ccontrib/libarchive/test_utils test_main.c

libarchive: Staticize some variables

This code was not being built due to errors in our libarchive
configuration.  Now that those have been addressed, staticize some
variables that trip a “no previous extern declaration” error.  This
is a subset of upstream PR 2962.

MFC after:      1 week
Reviewed by:    mm
Differential Revision:  https://reviews.freebsd.org/D56471

(cherry picked from commit 7e9d974bc023755161742f66c8c77546bab88586)
DeltaFile
+3-3contrib/libarchive/test_utils/test_main.c
+3-31 files

FreeBSD/src 170f7d2lib/libarchive config_freebsd.h

libarchive: Update configuration

PR:             294577
MFC after:      1 week
Reviewed by:    mm
Differential Revision:  https://reviews.freebsd.org/D56468

(cherry picked from commit 05bbe5e3883492dd2afa52039da1fac45c5059a0)
DeltaFile
+89-35lib/libarchive/config_freebsd.h
+89-351 files

FreeBSD/src 184dafbcontrib/libarchive/cpio cpio.c, contrib/libarchive/libarchive/test test_read_format_iso_zisofs_overflow.iso.uu test_read_format_rar5_loop_bug.rar.uu

libarchive: merge from vendor branch

libarchive 3.8.7

Important bugfixes:
 #2871 libarchive: fix handling of option failures
 #2897 iso9660: fix undefined behavior
 #2898 RAR: fix LZSS window size mismatch after PPMd block
 #2900 CAB: fix NULL pointer dereference during skip
 #2911 libarchive: do not continue with truncated numbers
 #2919 CAB: Fix Heap OOB Write in CAB LZX decoder
 #2934 iso9660: fix posibble heap buffer overflow on 32-bit systems
 #2939 cpio: Fix -R memory leak
 #2947 libarchive: lzop and grzip filter support

Important bugfixes between 3.8.5 and 3.8.6:
 #2860 bsdunzip: fix ISO week year and Gregorian year confusion
 #2864 7zip: ix SEGV in check_7zip_header_in_sfx via ELF offset validation
 #2875 7zip: fix out-of-bounds access on ELF 64-bit header

    [14 lines not shown]
DeltaFile
+1,096-0contrib/libarchive/libarchive/test/test_read_format_iso_zisofs_overflow.iso.uu
+189-0contrib/libarchive/libarchive/test/test_read_format_rar5_loop_bug.rar.uu
+135-0contrib/libarchive/libarchive/test/test_archive_string_conversion.c
+67-56contrib/libarchive/cpio/cpio.c
+104-0contrib/libarchive/libarchive/test/test_read_format_iso_zisofs_overflow.c
+95-0contrib/libarchive/libarchive/test/test_read_format_cab_skip_malformed.cab.uu
+1,686-5691 files not shown
+3,107-46097 files

FreeBSD/src 2e83ec4contrib/libarchive/test_utils test_main.c

libarchive: Staticize some variables

This code was not being built due to errors in our libarchive
configuration.  Now that those have been addressed, staticize some
variables that trip a “no previous extern declaration” error.  This
is a subset of upstream PR 2962.

MFC after:      1 week
Reviewed by:    mm
Differential Revision:  https://reviews.freebsd.org/D56471

(cherry picked from commit 7e9d974bc023755161742f66c8c77546bab88586)
DeltaFile
+3-3contrib/libarchive/test_utils/test_main.c
+3-31 files

FreeBSD/src d763fcelib/libarchive config_freebsd.h

libarchive: Update configuration

PR:             294577
MFC after:      1 week
Reviewed by:    mm
Differential Revision:  https://reviews.freebsd.org/D56468

(cherry picked from commit 05bbe5e3883492dd2afa52039da1fac45c5059a0)
DeltaFile
+89-37lib/libarchive/config_freebsd.h
+89-371 files

FreeBSD/src 2dddbb6contrib/libarchive/cpio cpio.c, contrib/libarchive/libarchive/test test_read_format_iso_zisofs_overflow.iso.uu test_read_format_rar5_loop_bug.rar.uu

libarchive: merge from vendor branch

libarchive 3.8.7

Important bugfixes:
 #2871 libarchive: fix handling of option failures
 #2897 iso9660: fix undefined behavior
 #2898 RAR: fix LZSS window size mismatch after PPMd block
 #2900 CAB: fix NULL pointer dereference during skip
 #2911 libarchive: do not continue with truncated numbers
 #2919 CAB: Fix Heap OOB Write in CAB LZX decoder
 #2934 iso9660: fix posibble heap buffer overflow on 32-bit systems
 #2939 cpio: Fix -R memory leak
 #2947 libarchive: lzop and grzip filter support

Important bugfixes between 3.8.5 and 3.8.6:
 #2860 bsdunzip: fix ISO week year and Gregorian year confusion
 #2864 7zip: ix SEGV in check_7zip_header_in_sfx via ELF offset validation
 #2875 7zip: fix out-of-bounds access on ELF 64-bit header

    [14 lines not shown]
DeltaFile
+1,096-0contrib/libarchive/libarchive/test/test_read_format_iso_zisofs_overflow.iso.uu
+189-0contrib/libarchive/libarchive/test/test_read_format_rar5_loop_bug.rar.uu
+135-0contrib/libarchive/libarchive/test/test_archive_string_conversion.c
+67-56contrib/libarchive/cpio/cpio.c
+104-0contrib/libarchive/libarchive/test/test_read_format_iso_zisofs_overflow.c
+95-0contrib/libarchive/libarchive/test/test_read_format_cab_skip_malformed.cab.uu
+1,686-5691 files not shown
+3,107-46097 files

FreeBSD/src fb83835sys/netpfil/pf pf_ioctl.c, tests/sys/netpfil/pf pass_block.sh

pf: fix duplicate rule detection for automatic tables

We should look at the table name for automatic tables as well. These
are different tables, so the rules using them are (or can be) different
as well.

MFC after:      3 days
Reported by:    Michael Sinatra <michael at burnttofu.net>
Sponsored by:   Rubicon Communications, LLC ("Netgate")
DeltaFile
+42-0tests/sys/netpfil/pf/pass_block.sh
+1-3sys/netpfil/pf/pf_ioctl.c
+43-32 files

FreeBSD/src f89909elibexec/rc/rc.d virtual_oss, sbin/devd snd.conf

virtual_oss: Introduce virtual_oss_default_control_device rc variable

The -t option gives the user the ability to create a control device for
a given virtual_oss(8) instance, so that the instance's configuration
can be manipulated during runtime with virtual_oss_cmd(8). As is
expected, the control device's name is not known, since it is specified
by the user.

This patch introduces a virtual_oss_default_control_device rc variable,
which defaults to "vdsp.ctl". The goal of this is that third-party
programs and scripts can access the control device of the default
virtual_oss(8) configuration without guessing. This is especially useful
for sbin/devd/snd.conf which deals with hot-swapping sound devices using
virtual_oss(8).

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D55670

    [2 lines not shown]
DeltaFile
+6-8sbin/devd/snd.conf
+5-1libexec/rc/rc.d/virtual_oss
+11-92 files

FreeBSD/src c93b813share/man/man5 rc.conf.5

rc.conf.5: Document virtual_oss(8)

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D56225

(cherry picked from commit a3094f522fec70f9e5cf3f12dc6e7a9b5f706459)
DeltaFile
+56-1share/man/man5/rc.conf.5
+56-11 files

FreeBSD/src 3103d39sys/netlink netlink_generic.c

netlink: fix LINT-NOVIMAGE build

Include the required header for securelevel_ge()

Fixes:          9933bdcb1264 ("pf: only allow a subset of netlink calls when securelevel is set")
Sponsored by:   Rubicon Communications, LLC ("Netgate")
DeltaFile
+1-0sys/netlink/netlink_generic.c
+1-01 files