FreeBSD/src 72e3910lib/libsys stat.2

stat(2): Document st_bsdflags and SFBSD_NAMEDATTR

Those are FreeBSD-specific member and flag still better to be
documented.

Reviewed by:    kib
Sponsored by:   Sippy Software, Inc.
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D59915
DeltaFile
+19-2lib/libsys/stat.2
+19-21 files

FreeBSD/src 7fab248release/tools vmimage.subr

vmimage.subr: Include dangling symlinks in images

When creating VM images, we filter the METALOG file created by pkg(8)
when installing non-base packages, rejecting any lines which correspond
to files which don't exist; this solves a problem which arose when a
package was installed and then deinstalled (or upgraded) later in the
image-building process.

Unfortunately [ -e ... ] follows symlinks and is not basedir-aware, so
an absolute symlink which is valid *inside* the image is omitted from
the image if it points to something which isn't present in the build
host system.

Replace [ -e ... ] with [ -e ... ] || [ -L ... ] so that symlinks are
included even if dangling.

While I'm here, add quoting in case future paths become problematic.

Sponsored by:   Amazon

    [3 lines not shown]
DeltaFile
+2-1release/tools/vmimage.subr
+2-11 files

FreeBSD/src fb039d4release/tools ec2_setpass

ec2-desktop: Fix shell expansion in ec2_setpass

Using a backtick inside a backtick-expansion isn't a good idea; switch
instead to using $( ... ).

Fixes:  a9710349513f ("EC2: Add desktop flavour")
Sponsored by:   Amazon

(cherry picked from commit 28cad382a2bb5fc398bd11f8e7b3637ad6c03334)
DeltaFile
+1-1release/tools/ec2_setpass
+1-11 files

FreeBSD/src 73aca6brelease/tools ec2-desktop.conf

ec2-desktop: Don't enable firstboot_pkgs

We don't have any packages to install by default when the instance
first boots, so (as with the "small" flavour) don't enable the
firstboot_pkgs script.  If someone wants to launch a desktop with
packages autoinstalled at first boot, they can enable the script at
the same time as they provide the list of packages.

Sponsored by:   Amazon

(cherry picked from commit eca31490322f181a415c14c6bf03e656e81fb4aa)
DeltaFile
+1-1release/tools/ec2-desktop.conf
+1-11 files

FreeBSD/src 80c5a04release Makefile.vm, release/tools ec2_setpass ec2_desktop_extras

EC2: Add desktop flavour

Desktop AMIs have xrdp enabled and boot to a KDE desktop; they are
as compatible as possible with EC2 Windows AMIs, setting a random
password and printing it to the console in encrypted format to be
retrieved using the EC2 GetPasswordData API.

Two rc.d scripts are included in this commit which will not exist
in the long term: ec2_addpass will become part of the ec2-scripts
package, and ec2_desktop_extras will go away once its functionality
is included elsewhere.

MFC After:      1 month
Relnotes:       yes
Sponsored by:   Amazon

(cherry picked from commit a9710349513f4c6ccb8bcff34fa9ea186fae6114)
DeltaFile
+73-0release/tools/ec2-desktop.conf
+60-0release/tools/ec2_desktop_extras
+58-0release/tools/ec2_setpass
+2-1release/Makefile.vm
+193-14 files

FreeBSD/src 2449fa9lib/libpmc pmclog.h, lib/libpmcstat libpmcstat_image.c

hwpmc: hwpmc: record page size to fix analysis in some case

This fixes a bug where a binary linked using max-page-size=0x200000
can result in a bogus relocation offset when running on a system
with a smaller page size.  This causes samples  to fall outside
the image mapping or be translated to the wrong address (resulting
in symbol resolution, or incorrect symbol resolution).  We noticed
this at Netflix because we run a patchset enabling 16k pages on
amd64 and have been compiling userspace with a 2MB page size.
Since we started doing this profiling userspace binaries has been
wonky.

Reviewed by: ali_mashtizadeh.com
Differential Revision: https://reviews.freebsd.org/D59771
Sponsored by: Netflix
DeltaFile
+17-2lib/libpmcstat/libpmcstat_image.c
+11-6usr.sbin/pmc/view.cc
+7-1sys/sys/pmclog.h
+7-0lib/libpmc/pmclog.h
+5-1sys/dev/hwpmc/hwpmc_logging.c
+2-1usr.sbin/pmc/view.hh
+49-113 files not shown
+52-129 files

FreeBSD/src ac9c07asys/compat/linuxkpi/common/src linux_pci.c

linuxkpi: Fix double-cleanup in linux_pci_attach_device() error path

put_device() already triggers lkpi_pci_dev_release(), which removes
pdev from pci_devices, frees pdev->bus, destroys pcie_cap_lock, and
uninits the DMA private data.

Reported by:    gallatin
Fixes:          66b25ddf9125 ("LinuxKPI: pci detach: implement a proper detach (release) path")
Reviewed by:    kib, gallatin, bz
Sponsored by:   NVidia networking
MFC after:      1 week
Differential Revision: https://reviews.freebsd.org/D59913
DeltaFile
+7-12sys/compat/linuxkpi/common/src/linux_pci.c
+7-121 files

FreeBSD/src 34f131fsys/dev/nvme nvme_ctrlr.c

nvme: bound the AER error log byte-swap by the fetched length

The Get Log Page request for the error log is clamped to
NVME_MAX_AER_LOG_SIZE, but the byte-swap loop iterated ELPE + 1
entries. A controller reporting more than 63 entries makes the loop
overrun the 4 KiB log page buffer.

Reviewed by:    ngie, imp, adrian
Differential Revision:  https://reviews.freebsd.org/D59626
DeltaFile
+1-1sys/dev/nvme/nvme_ctrlr.c
+1-11 files

FreeBSD/src ad57f21sys/dev/nvme nvme_private.h nvme_pci.c

nvme: do not touch INTMS/INTMC when configured for MSI-X

The single-vector MSI-X fallback installs the shared interrupt
handler, which masks interrupts through INTMS/INTMC around the
completion poll.
INTx and MSI are unaffected. Only MSI-X track the interrupt mode
and skip un/masking

Reviewed by:    ngie, imp, adrian
Differential Revision:  https://reviews.freebsd.org/D59637
DeltaFile
+5-2sys/dev/nvme/nvme_ctrlr.c
+1-0sys/dev/nvme/nvme_private.h
+1-0sys/dev/nvme/nvme_pci.c
+7-23 files

FreeBSD/src ba974fasys/kern uipc_shm.c

posixshm: Fix a double unlock in shm_partial_page_invalidate()

For some reason, shm_partial_page_invalidate() unlocks the object upon
an error, but its callers don't expect this.  Don't do any special error
handling.  Keep the subroutine anyway since the name is a bit clearer
than vm_page_grab_zero_partial().

While here, normalize the object pointer used for locking in
shm_deallocate().

Reviewed by:    kib
Fixes:          454bc887f250 ("uipc_shm: Implements fspacectl(2) support")
MFC after:      1 week
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D59877
DeltaFile
+2-7sys/kern/uipc_shm.c
+2-71 files

FreeBSD/src 7c5e457sys/kern uipc_ktls.c, tests/sys/kern ktls_test.c

ktls: Fix an off-by-one bug in tls13_find_record_type()

If the entire plaintext is zero-filled, the backwards walk in
tls13_find_record_type() would return the offset of the last byte of the
TLS header.  This causes an underflow when decrypting, resulting in a
null pointer dereference.

Fix the bug and add a regression test.

Reviewed by:    gallatin, jhb
MFC after:      1 week
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D59767
DeltaFile
+66-5tests/sys/kern/ktls_test.c
+2-2sys/kern/uipc_ktls.c
+68-72 files

FreeBSD/src 14c7492usr.bin/sdiff sdiff.c sdiff.1

sdiff.1: Document exit status and --help

MFC after:      3 days
Approved by:    bnovkov (mentor)
Sponsored by:   fme AG
Differential Revision:  https://reviews.freebsd.org/D59927
DeltaFile
+22-1usr.bin/sdiff/sdiff.1
+1-0usr.bin/sdiff/sdiff.c
+23-12 files

FreeBSD/src 30ed27fsys/powerpc/powerpc elf64_machdep.c

sys/powerpc/powerpc/elf64_machdep.c: enable ASLR on ELFv2

Turns out that ever since introducing ELFv2 support, it was missing
ASLR, it was only used for ELFv1 processes.

Reviewed by:    jhibbits (via IRC #powerpc64)
MFC after:      1 week
DeltaFile
+1-1sys/powerpc/powerpc/elf64_machdep.c
+1-11 files

FreeBSD/src 044cae0tests/sys/netpfil/ipfw Makefile unmapped.sh

ipfw tests: cover layer-2 filtering of unmapped mbufs

Test that ipfw's layer-2 hook copes with unmapped mbufs, on the pass
and on the deny path.

Reviewed by:    glebius
Assisted-by:    Claude Code (Fable 5, Opus 5)
Differential Revision:  https://reviews.freebsd.org/D59390
DeltaFile
+189-0tests/sys/netpfil/ipfw/unmapped.sh
+2-1tests/sys/netpfil/ipfw/Makefile
+191-12 files

FreeBSD/src 3897678sys/kern vfs_init.c

vfs_register: prevent kernel crash

vfs_register hashes the filesystem name and uses it for sysctl oids.
A filesystem name which hashes to 0 crashes in sysctl_register_oid().

Map 0 to 1 to prevent the kernel crash.

This can be tested with "udf2" as the filesystem name.

MFC after:      1 month
MFC to:         stable/15 stable/14
Reviewed by:    kib
Differential Revision: https://reviews.freebsd.org/D59839
DeltaFile
+2-0sys/kern/vfs_init.c
+2-01 files

FreeBSD/src 7399be2. UPDATING, sbin/nvmecontrol nvmecontrol.8

misc: Avoid use of Unicode closing single quote

The Unicode closing single quotation mark is classified as a homoglyph
and can trip automated code quality checks in downstream CI pipelines or
cause code review UIs to refuse to display a file.  If used as an
apostrophe, use the ASCII single quote instead.  If used as a closing
single quote, replace with double quotes or no quotes at all.

Sponsored by:   Klara, Inc.
Sponsored by:   NetApp, Inc.
Reviewed by:    ziaee, obiwac, olce
Differential Revision:  https://reviews.freebsd.org/D59911
DeltaFile
+7-7sys/net/sff8472.h
+3-3sys/x86/x86/mp_x86.c
+2-2sys/dev/oce/oce_hw.h
+2-2sbin/nvmecontrol/nvmecontrol.8
+1-1usr.sbin/moused/moused/moused.conf.5
+1-1UPDATING
+16-1610 files not shown
+26-2616 files

FreeBSD/src 72bb9ebbin/pwd pwd.c

pwd(1): De-obfuscate, style(9)

In getcwd_logical(), test for a '.' or '..' component in one of the most
straightforward and intelligible ways possible.

In particular, this removes a superfluous re-test of the the component's
first character being '.' when the first one did not pass and, more
importantly, prevents the second test from relying on a side-effect in
the first.

While here, for better clarity, replace the loop that searches for '/'
with a simple call to strchrnul().

Add high-level comments about what is going on.

While here, test explicitly that pointed 'char' values are not 0 ('\0')
(style(9)).

While here, separate the successive steps of getcwd_logical() with blank

    [9 lines not shown]
DeltaFile
+14-7bin/pwd/pwd.c
+14-71 files

FreeBSD/src 9d08596sys/powerpc/aim mmu_radix.c

powerpc/radix: fix double page offset in mmu_radix_sync_icache()

mmu_radix_sync_icache() adds the offset of va within its page to the
physical address it gets from mmu_radix_extract_locked().  That address
already includes the offset - the extract routines return the physical
address of the byte, not of the frame - so the offset is counted twice
and __syncicache() is handed frame + 2 * offset.

The hash MMU counterpart, moea64_sync_icache(), has to add the offset
because PVO_PADDR() yields only the frame.  Here the addition is wrong.

Fixes:  6f0b2a235a13 ("powerpc/pmap: Add pmap_sync_icache() for radix pmap")
Reviewed by:    jhibbits
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D59870
DeltaFile
+1-3sys/powerpc/aim/mmu_radix.c
+1-31 files

FreeBSD/src 26e90d2sys/compat/linuxkpi/common/include/linux xarray.h

Fix statement with no effect in linuxkpi's xarray.h

When compiling the kernel with gcc 14, errors similar to the following
are emitted:

  sys/dev/cxgbe/iw_cxgbe/ev.c: In function 'c4iw_ev_handler':
  sys/compat/linuxkpi/common/include/linux/xarray.h:132:23: error: statement with no effect [-Werror=unused-value]
    132 |                 flags == 0; \
  sys/dev/cxgbe/iw_cxgbe/ev.c:274:17: note: in expansion of macro 'xa_unlock_irqrestore'
    274 |                 xa_unlock_irqrestore(&dev->cqs, flag);
        |                 ^~~~~~~~~~~~~~~~~~~~
  sys/compat/linuxkpi/common/include/linux/xarray.h:132:23: error: statement with no effect [-Werror=unused-value]
    132 |                 flags == 0; \
  sys/dev/cxgbe/iw_cxgbe/ev.c:283:17: note: in expansion of macro 'xa_unlock_irqrestore'
    283 |                 xa_unlock_irqrestore(&dev->cqs, flag);
        |                 ^~~~~~~~~~~~~~~~~~~~

It looks like the intent of the "flags == 0" statement was to make the
'flags' macro argument not unused, but it still results in a warning.

    [7 lines not shown]
DeltaFile
+1-1sys/compat/linuxkpi/common/include/linux/xarray.h
+1-11 files

FreeBSD/src 82d6bd1sys/compat/linuxkpi/common/include/linux xarray.h

Fix statement with no effect in linuxkpi's xarray.h

When compiling the kernel with gcc 14, errors similar to the following
are emitted:

  sys/dev/cxgbe/iw_cxgbe/ev.c: In function 'c4iw_ev_handler':
  sys/compat/linuxkpi/common/include/linux/xarray.h:132:23: error: statement with no effect [-Werror=unused-value]
    132 |                 flags == 0; \
  sys/dev/cxgbe/iw_cxgbe/ev.c:274:17: note: in expansion of macro 'xa_unlock_irqrestore'
    274 |                 xa_unlock_irqrestore(&dev->cqs, flag);
        |                 ^~~~~~~~~~~~~~~~~~~~
  sys/compat/linuxkpi/common/include/linux/xarray.h:132:23: error: statement with no effect [-Werror=unused-value]
    132 |                 flags == 0; \
  sys/dev/cxgbe/iw_cxgbe/ev.c:283:17: note: in expansion of macro 'xa_unlock_irqrestore'
    283 |                 xa_unlock_irqrestore(&dev->cqs, flag);
        |                 ^~~~~~~~~~~~~~~~~~~~

It looks like the intent of the "flags == 0" statement was to make the
'flags' macro argument not unused, but it still results in a warning.

    [7 lines not shown]
DeltaFile
+1-1sys/compat/linuxkpi/common/include/linux/xarray.h
+1-11 files

FreeBSD/src c7b6798contrib/expat Makefile.in, contrib/expat/lib internal.h xmltok.c

contrib/expat: import expat 2.8.5

Changes: https://github.com/libexpat/libexpat/blob/R_2_8_5/expat/Changes

Security:       CVE-2026-93990
MFC after:      3 days
DeltaFile
+349-5contrib/expat/tests/basic_tests.c
+100-123contrib/expat/lib/xmlparse.c
+139-64contrib/expat/lib/xmltok.c
+67-100contrib/expat/lib/internal.h
+105-56contrib/expat/Makefile.in
+157-0contrib/expat/tests/hash_tests.c
+917-34854 files not shown
+1,614-85960 files

FreeBSD/src 5d169b5usr.sbin/bsnmpd/tools/libbsnmptools bsnmptools.c

bsnmpget: initialise the suboption value in getsubopt1()

Otherwise, "bsnmpget -o verbose -I cut" crashes.

Reported by:    clang static analyzer
MFC after:      2 weeks
DeltaFile
+1-0usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c
+1-01 files

FreeBSD/src 74cab6elib/libbsdconf bsdconf.h bsdconf.3, usr.sbin/sysconf sysconf_scan.c

libbsdconf: parse from a bounded in-memory buffer

Copy the descriptor into a buffer of at most 64 MiB (raise it with
BSDCONF_MAX_BYTES) and tokenize with bsdconf_scan(), the walker
bsdconf_put() already uses.  Input above the cap fails with EFBIG.
Bump libbsdconf to 1.2.0 and sysconf(8) to 2.0.

Suggested by:   fuz
Reviewed by:    fuz
Differential Revision:  https://reviews.freebsd.org/D59751
DeltaFile
+39-420lib/libbsdconf/bsdconf.c
+133-0lib/libbsdconf/bsdconf_stmt.c
+44-18lib/libbsdconf/bsdconf.3
+23-0usr.sbin/sysconf/tests/sysconf_test.sh
+0-16usr.sbin/sysconf/sysconf_scan.c
+9-3lib/libbsdconf/bsdconf.h
+248-4576 files not shown
+267-46312 files

FreeBSD/src 7b7ef79share/misc bsd-family-tree

bsd-family-tree: add NetBSD 10.2
DeltaFile
+23-20share/misc/bsd-family-tree
+23-201 files

FreeBSD/src 296e3fdusr.sbin/bsnmpd/tools/bsnmptools bsnmpget.c, usr.sbin/bsnmpd/tools/libbsnmptools bsnmptools.c

bsnmp: validate the lower bound of error_index in responses

Check if the response's error_index is within a sane interval.
Otherwise, a rogue peer could crash us.

PR:             298222
Reported by:    Robert Morris
Reviewed by:    markj
Discussed with: secteam (markj)
MFC after:      2 weeks
Analyzed with:  Claude Code Opus 5
DeltaFile
+6-2usr.sbin/bsnmpd/tools/bsnmptools/bsnmpget.c
+2-1usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c
+8-32 files

FreeBSD/src b94772dsys/dev/clk/spacemit k1_clk.c k1_apmu.c

clk: Fix a few typos in the spacemit CCU driver

Fixes:  dcb10e3add17
Reported by:    Bruno Banelli <bruno.banelli at sartura.hr> (p_idx typo)
DeltaFile
+3-3sys/dev/clk/spacemit/k1_apmu.c
+2-2sys/dev/clk/spacemit/k1_clk.c
+5-52 files

FreeBSD/src 3d03013sys/net/route fib_algo.c

route/fib_algo: Respect immediate_sync in fd_ref_nhop

Now fd_ref_nhop() returns zero for cross family routes,
Do not schedule nhop references and try to rebuild it immediately
for connected and static routes.

PR:     298733
Fixes:  633438224304 ("route/fib_algo: Fix nexthop index ...")
DeltaFile
+4-2sys/net/route/fib_algo.c
+4-21 files

FreeBSD/src 50eae68sys/net/route fib_algo.c

route/fib_algo: Remove redundant zeroing of fd_af

fd is allocated with M_ZERO and fd_num_af never decreases.
Therefore, no need for zeroing nhaf_count and nhaf_base here.

Fixes:  633438224304 ("route/fib_algo: Fix nexthop index ...")
DeltaFile
+0-2sys/net/route/fib_algo.c
+0-21 files

FreeBSD/src ab636e4usr.sbin/jail config.c

jail(8): Preserve const qualifier on strchr(3) results

Reviewed by:    fuz, dteske
Approved by:    fuz (mentor), dteske (mentor)
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D59876
DeltaFile
+3-3usr.sbin/jail/config.c
+3-31 files

FreeBSD/src 26b3ff1sys/compat/linux linux.c

Ignore LINUX_POLLREMOVE

This matches upstream behaviour since Linux's demangle_poll()
silently discards POLLREMOVE from the requested events.

Reviewed by:    emaste
Sponsored by:   Sippy Software, Inc.
Differential Revision:  https://reviews.freebsd.org/D59914
MFC after:      1 week
PR:             297467
DeltaFile
+4-2sys/compat/linux/linux.c
+4-21 files