HardenedBSD/src b3b3b4cbin/pwd pwd.c, sys/powerpc/aim mmu_radix.c

Merge remote-tracking branch 'rad/hardened/current/master' into hardened/current/cross-dso-cfi
DeltaFile
+14-7bin/pwd/pwd.c
+1-3sys/powerpc/aim/mmu_radix.c
+15-102 files

HardenedBSD/src 99722cabin/pwd pwd.c, sys/powerpc/aim mmu_radix.c

Merge remote-tracking branch 'rad/hardened/current/master' into hardened/current/pledge
DeltaFile
+14-7bin/pwd/pwd.c
+1-3sys/powerpc/aim/mmu_radix.c
+15-102 files

HardenedBSD/src e7e5140bin/pwd pwd.c, sys/powerpc/aim mmu_radix.c

Merge branch 'freebsd/current/main' into hardened/current/master
DeltaFile
+14-7bin/pwd/pwd.c
+1-3sys/powerpc/aim/mmu_radix.c
+15-102 files

HardenedBSD/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

HardenedBSD/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

HardenedBSD/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

HardenedBSD/src dfa6afecontrib/expat Makefile.in, contrib/expat/lib internal.h xmltok.c

Merge remote-tracking branch 'rad/hardened/current/master' into hardened/current/cross-dso-cfi
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

HardenedBSD/src aa9e9a5contrib/expat Makefile.in, contrib/expat/lib internal.h xmltok.c

Merge remote-tracking branch 'rad/hardened/current/master' into hardened/current/pledge
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

HardenedBSD/src faad511contrib/expat Makefile.in, contrib/expat/lib internal.h xmltok.c

Merge branch 'freebsd/current/main' into hardened/current/master
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

HardenedBSD/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

HardenedBSD/src 9bf66edlib/libbsdconf bsdconf.3 bsdconf_stmt.c, share/misc bsd-family-tree

Merge remote-tracking branch 'rad/hardened/current/master' into hardened/current/cross-dso-cfi
DeltaFile
+39-420lib/libbsdconf/bsdconf.c
+133-0lib/libbsdconf/bsdconf_stmt.c
+44-18lib/libbsdconf/bsdconf.3
+23-20share/misc/bsd-family-tree
+23-0usr.sbin/sysconf/tests/sysconf_test.sh
+0-16usr.sbin/sysconf/sysconf_scan.c
+262-47415 files not shown
+315-50421 files

HardenedBSD/src ddd28e3lib/libbsdconf bsdconf.3 bsdconf_stmt.c, share/misc bsd-family-tree

Merge remote-tracking branch 'rad/hardened/current/master' into hardened/current/pledge
DeltaFile
+39-420lib/libbsdconf/bsdconf.c
+133-0lib/libbsdconf/bsdconf_stmt.c
+44-18lib/libbsdconf/bsdconf.3
+23-20share/misc/bsd-family-tree
+23-0usr.sbin/sysconf/tests/sysconf_test.sh
+0-16usr.sbin/sysconf/sysconf_scan.c
+262-47415 files not shown
+315-50421 files

HardenedBSD/src bca3c76lib/libbsdconf bsdconf.3 bsdconf_stmt.c, share/misc bsd-family-tree

Merge branch 'freebsd/current/main' into hardened/current/master
DeltaFile
+39-420lib/libbsdconf/bsdconf.c
+133-0lib/libbsdconf/bsdconf_stmt.c
+44-18lib/libbsdconf/bsdconf.3
+23-20share/misc/bsd-family-tree
+23-0usr.sbin/sysconf/tests/sysconf_test.sh
+0-16usr.sbin/sysconf/sysconf_scan.c
+262-47415 files not shown
+315-50421 files

HardenedBSD/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

HardenedBSD/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

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

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

HardenedBSD/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

HardenedBSD/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

HardenedBSD/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

HardenedBSD/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

HardenedBSD/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

HardenedBSD/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

HardenedBSD/src 0cb85c5share/man/man4 aq.4

aq.4: Remove experimental note

I added the text when this driver was merely an import of
https://github.com/Aquantia/aqtion-freebsd with patches from ports applied.
nprice@ resolved issues and added support for newer cards and the note is
no longer applicable.

Reviewed by:    adrian
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D59909
DeltaFile
+0-4share/man/man4/aq.4
+0-41 files

HardenedBSD/src 5cada16contrib/atf NEWS, contrib/atf/atf-c++/detail auto_array.hpp auto_array_test.cpp

Merge remote-tracking branch 'rad/hardened/current/master' into hardened/current/cross-dso-cfi
DeltaFile
+0-336contrib/atf/doc/atf-test-case.4
+328-0contrib/atf/doc/atf-test-case.7
+0-302contrib/atf/atf-c++/detail/auto_array_test.cpp
+269-0sys/riscv/starfive/jh7110_temp.c
+147-53contrib/atf/NEWS
+0-175contrib/atf/atf-c++/detail/auto_array.hpp
+744-866156 files not shown
+2,134-1,707162 files

HardenedBSD/src 13b82fbcontrib/atf NEWS, contrib/atf/atf-c++/detail auto_array.hpp auto_array_test.cpp

Merge remote-tracking branch 'rad/hardened/current/master' into hardened/current/pledge
DeltaFile
+0-336contrib/atf/doc/atf-test-case.4
+328-0contrib/atf/doc/atf-test-case.7
+0-302contrib/atf/atf-c++/detail/auto_array_test.cpp
+269-0sys/riscv/starfive/jh7110_temp.c
+147-53contrib/atf/NEWS
+0-175contrib/atf/atf-c++/detail/auto_array.hpp
+744-866156 files not shown
+2,134-1,707162 files

HardenedBSD/src 8594be5lib/libarchive/tests Makefile, share/man/man4 dtrace_pid.4

Merge remote-tracking branch 'rad/hardened/15-stable/main' into hardened/15-stable/pledge
DeltaFile
+18-17lib/libarchive/tests/Makefile
+17-7sys/dev/sound/pcm/dsp.c
+22-2share/man/man4/dtrace_pid.4
+15-7sys/dev/sound/pci/hdspe-pcm.c
+17-5sys/powerpc/aim/mmu_radix.c
+15-2sys/dev/sound/pci/hdsp-pcm.c
+104-4012 files not shown
+117-6018 files

HardenedBSD/src 0e516e6contrib/atf NEWS, contrib/atf/atf-c++/detail auto_array.hpp auto_array_test.cpp

Merge branch 'freebsd/current/main' into hardened/current/master
DeltaFile
+0-336contrib/atf/doc/atf-test-case.4
+328-0contrib/atf/doc/atf-test-case.7
+0-302contrib/atf/atf-c++/detail/auto_array_test.cpp
+269-0sys/riscv/starfive/jh7110_temp.c
+147-53contrib/atf/NEWS
+0-175contrib/atf/atf-c++/detail/auto_array.hpp
+744-866145 files not shown
+1,998-1,697151 files

HardenedBSD/src 32137c4sys/arm/allwinner a10_codec.c, sys/arm/broadcom/bcm2835 bcm2835_audio.c

sound: Retire the version constants

They exist only to fill in MODULE_DEPEND() and MODULE_VERSION(), and
every consumer passed the same value for all three, so the version
range never did anything. Use 1, like the rest of the tree does.

MFC after:      1 week
Sponsored by:   The FreeBSD Foundation
Reviewed by:    kib, emaste
Differential Revision:  https://reviews.freebsd.org/D59873
DeltaFile
+0-6sys/dev/sound/pcm/sound.h
+1-1sys/dev/firewire/fwisound.c
+1-1sys/arm/freescale/vybrid/vf_sai.c
+1-1sys/arm/freescale/imx/imx6_ssi.c
+1-1sys/arm/broadcom/bcm2835/bcm2835_audio.c
+1-1sys/arm/allwinner/a10_codec.c
+5-1133 files not shown
+38-4439 files

HardenedBSD/src 57d542clib/libc/tests/stdlib test-search.h bsearch_test.c

libc: Preserve const qualifier on bsearch(3) results in tests

Reviewed by:    dteske, fuz
Approved by:    dteske (mentor), fuz (mentor)
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D59611

(cherry picked from commit 3caa8d2c58b2787e4c4c64d9ac1831dadd7b0b47)
DeltaFile
+1-1lib/libc/tests/stdlib/test-search.h
+1-1lib/libc/tests/stdlib/bsearch_test.c
+1-1lib/libc/tests/stdlib/bsearch_s_test.c
+1-1lib/libc/tests/stdlib/bsearch_b_test.c
+4-44 files

HardenedBSD/src b169b80lib/libc/aarch64/string strpbrk.c, lib/libc/amd64/string strpbrk.c

libc: Parenthesise qualifier-preserving function definitions

Required to prevent function-like macros with the same name from
being expanded in the definitions once they become active in a
later C mode.  Without the parentheses, the macro would rewrite
the declarator, and the file would consequently fail to compile.
This style is already used for similar cases such as mempcpy().

Reviewed by:    fuz
Approved by:    fuz (mentor)
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D59600

(cherry picked from commit c389738f21c09931cd88a84a357be514b5c60030)
DeltaFile
+3-3lib/libc/stdlib/bsearch.c
+1-1lib/libc/string/memrchr.c
+1-1lib/libc/string/memmem.c
+1-1lib/libc/string/memchr.c
+1-1lib/libc/amd64/string/strpbrk.c
+1-1lib/libc/aarch64/string/strpbrk.c
+8-812 files not shown
+20-2018 files