HardenedBSD/src de9f0b6share/man/man4 rl.4 re.4, sys/conf NOTES

Merge branch 'freebsd/current/main' into hardened/current/master
DeltaFile
+18-18sys/conf/NOTES
+18-18sys/dev/re/if_re.c
+16-16sys/dev/rl/if_rl.c
+9-9sys/dev/mii/rlphy.c
+8-8share/man/man4/rl.4
+6-6share/man/man4/re.4
+75-7523 files not shown
+126-12629 files

HardenedBSD/src fd1e32dusr.sbin/bsdinstall Makefile

Merge branch 'freebsd/15-stable/main' into hardened/15-stable/main
DeltaFile
+1-1usr.sbin/bsdinstall/Makefile
+1-11 files

HardenedBSD/src e27d5c1usr.sbin/bsdconfig/share device.subr

bsdconfig: RealTek -> Realtek

Realtek changed how it styled its name 25 or so years ago, but the old
style persisted in many places. These products use the new styling in
their datasheets.

Signed-off-by: ykla yklaxds at gmail.com
Sponsored by: Chinese FreeBSD Community
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1901
DeltaFile
+3-3usr.sbin/bsdconfig/share/device.subr
+3-31 files

HardenedBSD/src 8cbe0ddsys/dev/mii rlphy.c miidevs, sys/dev/re if_re.c

sys: RealTek -> Realtek

Realtek changed how it styled its name 25 or so years ago, but the old
style persisted in many places. These products use the new styling in
their datasheets.

Signed-off-by: ykla yklaxds at gmail.com
Sponsored by: Chinese FreeBSD Community
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1901
DeltaFile
+18-18sys/dev/re/if_re.c
+16-16sys/dev/rl/if_rl.c
+9-9sys/dev/mii/rlphy.c
+5-5sys/dev/rl/if_rlreg.h
+4-4sys/dev/mii/miidevs
+4-4sys/dev/usb/net/ruephy.c
+56-5614 files not shown
+77-7720 files

HardenedBSD/src 5fd8a01share/man/man4 rl.4 re.4

man: RealTek -> Realtek

Realtek changed how it styled its name 25 or so years ago, but the old
style persisted in many places. These products use the new styling in
their datasheets.

Signed-off-by: ykla yklaxds at gmail.com
Sponsored by: Chinese FreeBSD Community
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1901
DeltaFile
+8-8share/man/man4/rl.4
+6-6share/man/man4/re.4
+4-4share/man/man4/rue.4
+4-4share/man/man4/miibus.4
+2-2share/man/man4/rgephy.4
+24-245 files

HardenedBSD/src 2996c41sys/conf NOTES

NOTES: fix typos and unify terminology in comments

Signed-off-by: ykla yklaxds at gmail.com
Sponsored by: Chinese FreeBSD Community
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1901
DeltaFile
+18-18sys/conf/NOTES
+18-181 files

HardenedBSD/src 7fe881estand/defaults loader.conf.5

loader: Note current autoboot_delay behavior

Some time ago, the boot loader stopped polling for a key press during
the kernel and module loading prior to the transition to lua. Inspection
of the code shows the polling is no longer there. Document the change.

Sponsored by:           Netflix
DeltaFile
+3-3stand/defaults/loader.conf.5
+3-31 files

HardenedBSD/src 52c0749lib/libsecureboot verify_file.c

libsecureboot: do further checks on files without manifests

verify_prep can return VE_FINGERPRINT_NONE. Consider such scenario so
the VE_GEUSS heuristics works with files that likely will not have
fingerprints in the manifest file.

Obtained from:  Hewlett Packard Enterprise
Reviewed by:    sjg
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D53940
DeltaFile
+1-1lib/libsecureboot/verify_file.c
+1-11 files

HardenedBSD/src 56275b7usr.sbin/bsdinstall Makefile

bsdinstall: Ignore -p[0-9]+ in determining BRANCH

The patch level is not part of the branch per se and should not be
used in constructing the FreeBSD-base.conf file used by bsdinstall.

MFC after:      1 day

(cherry picked from commit d45816f369eb0099fd274fee23a3bf137ee794b1)
DeltaFile
+1-1usr.sbin/bsdinstall/Makefile
+1-11 files

HardenedBSD/src a12e9c0lib/libc/tests/stdlib strfmon_test.c, share/doc/papers/malloc implementation.ms performance.ms

Merge branch 'freebsd/current/main' into hardened/current/master
DeltaFile
+245-24usr.bin/mdo/mdo.1
+0-223share/doc/papers/malloc/implementation.ms
+0-111share/doc/papers/malloc/performance.ms
+57-23lib/libc/tests/stdlib/strfmon_test.c
+0-72share/doc/papers/malloc/intro.ms
+0-70share/doc/papers/malloc/malloc.ms
+302-52317 files not shown
+360-77723 files

HardenedBSD/src 8fef8a7sys/dev/sound/pcm channel.c vchan.c, usr.bin/mdo mdo.1

Merge branch 'freebsd/15-stable/main' into hardened/15-stable/main
DeltaFile
+245-24usr.bin/mdo/mdo.1
+22-48sys/dev/sound/pcm/channel.c
+0-18sys/dev/sound/pcm/vchan.c
+0-5sys/dev/sound/pcm/vchan.h
+267-954 files

HardenedBSD/src 3cf8333sys/dev/sound/pcm vchan.c vchan.h

sound: Remove vchan_passthrough() and hw.snd.passthrough_verbose

Unused and confusing.

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week

(cherry picked from commit 3612ef642f511a1bd9f759da87abeafe7d6ff110)
DeltaFile
+0-18sys/dev/sound/pcm/vchan.c
+0-5sys/dev/sound/pcm/vchan.h
+0-232 files

HardenedBSD/src 068b20esys/dev/sound/pcm channel.c

sound: Fix KASSERT panics in chn_read() and chn_write()

INVARIANTS kernels may trigger a KASSERT panic from sndbuf_acquire(),
when fuzzing write(2) using stress2, because of a race in chn_write().

In the case of chn_write(), what sndbuf_acquire() does is extend the
ready-to-read area of the buffer by a specified amount of bytes. The
KASSERT in question makes sure the number of bytes we want to extend the
ready area by, is less than or equal to the number of free bytes in the
buffer. This makes sense, because we cannot extend the ready area to
something larger than what is available (i.e., free) in the first place.

What chn_write() currently does for every write is; calculate the
appropriate write size, let's say X, unlock the channel, uiomove() X
bytes to the channel's buffer, lock the channel, and call
sndbuf_acquire() to extend the ready area by X bytes. The problem with
this approach, however, is the following.

Suppose an empty channel buffer with a length of 1024 bytes, and 2

    [45 lines not shown]
DeltaFile
+22-48sys/dev/sound/pcm/channel.c
+22-481 files

HardenedBSD/src 35232d8share/doc/papers/malloc implementation.ms performance.ms

papers: Retire phkmalloc paper

It has not been installed since commit cdc37953165c ("In preparation for
the removal of the roff toolchain, disconnect the") and turned up in
a search for outdated MALLOC_OPTIONS settings.

The rendered paper is available at
https://papers.freebsd.org/1998/phk-malloc

PR:             287357
Reviewed by:    bapt
Event:          Kitchener-Waterloo Hackathon 202506
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D50908
DeltaFile
+0-223share/doc/papers/malloc/implementation.ms
+0-111share/doc/papers/malloc/performance.ms
+0-72share/doc/papers/malloc/intro.ms
+0-70share/doc/papers/malloc/malloc.ms
+0-54share/doc/papers/malloc/kernel.ms
+0-52share/doc/papers/malloc/problems.ms
+0-5825 files not shown
+0-71211 files

HardenedBSD/src 5198c32sys/dev/vt vt_core.c

vt: Allow VT_SETMODE with frsig=0

Linux does not check that any of the signals in vt_mode VT_SETMODE ioctl
(relsig, acqsig, frsig) are valid, but FreeBSD required that all three
are valid.  frsig is unusued in both Linux and FreeBSD, and software
typically leaves it unset.  To improve portability, allow frsig to be
set to zero.

PR:             289812
Reported by:    Dušan Gvozdenović
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D52835
DeltaFile
+3-3sys/dev/vt/vt_core.c
+3-31 files

HardenedBSD/src ddec420sys/netpfil/ipfilter/netinet fil.c ip_nat.c

ipfilter: fix broken build

Every commit earns me a dozen emails that LINT is broken. This should
stop that.

Fixes: eda1756d0454f ipfilter: Verify frentry on entry into kernel
Sponsored by: Netflix
DeltaFile
+1-3sys/netpfil/ipfilter/netinet/fil.c
+0-3sys/netpfil/ipfilter/netinet/ip_nat.c
+1-62 files

HardenedBSD/src eb90470sys/modules/mqueue Makefile

mqueuefs: Export another symbol required by linux.ko

Fixes: e00a781c216c ("mqueue: Export kern_kmq_* symbols from kernel module")
Sponsored by:   The FreeBSD Foundation
DeltaFile
+2-1sys/modules/mqueue/Makefile
+2-11 files

HardenedBSD/src 78c6cfdsys/netpfil/ipfilter/netinet fil.c

ipfilter: Restore used variable

One of the "unused" i variables is actually used.

Fixes:          20c48f090b27
DeltaFile
+1-1sys/netpfil/ipfilter/netinet/fil.c
+1-11 files

HardenedBSD/src 20c48f0sys/netpfil/ipfilter/netinet ip_nat.c fil.c

ipfilter: Remove unused variable

Reported by:    jlduran
Fixes:          eda1756d0454, 821774dfbdaa
MFC after:      1 week
X-MFC with:     eda1756d0454, 821774dfbdaa
DeltaFile
+1-1sys/netpfil/ipfilter/netinet/ip_nat.c
+1-1sys/netpfil/ipfilter/netinet/fil.c
+2-22 files

HardenedBSD/src d5d005elibexec/rc/rc.d ippool

ipfilter: Load optionlist prior to ippool invocation

As a safety precaution df381bec2d2b limits ippool hash table size to 1K.
This causes any legitimely large hash table to fail to load. The
htable_size_max ipf tuneable adjusts this but the adjustment is made
in the ipfilter rc script, invoked after the ippool script (because it
depends on ippool). Let's load the ipfilter_optionlist in ippool as well.
ipfilter_optionlist load will also occur in the ipfilter rc script in case
the user uses ipfilter without ippool.

Fixes:          df381bec2d2b
MFC after:      3 days
DeltaFile
+3-0libexec/rc/rc.d/ippool
+3-01 files

HardenedBSD/src 3e69618sys/contrib/openzfs/lib/libzpool/include/sys zfs_bootenv_os.h

openzfs: We are FreeBSD, not posix.

Partially revert:
https://github.com/openzfs/zfs/commit/99d7453b43dc0ef04a35e461ef14db72e1326c7c
which introduced this file upstream. This causes this definition to be
preferred for all builds. Make the smallest change possible to this file
to change the default to FreeBSD. We're talking to the upstraem folks
about the right fix. Feel free to revert this in the future, so long as
`bectl activate -t` still works properly afterwards.

Sponsored by:           Netflix
DeltaFile
+1-1sys/contrib/openzfs/lib/libzpool/include/sys/zfs_bootenv_os.h
+1-11 files

HardenedBSD/src cf85e70lib/libc/stdlib strfmon.c, lib/libc/tests/stdlib strfmon_test.c

strfmon: Fix negative sign handling for C locale

If the locale's positive_sign and negative_sign values would both be
returned by localeconv() as empty strings, strfmon() shall behave as if
the negative_sign value was the string "-".

This occurs with the C locale.  The implementation previously assigned
"0" to sign_posn (parentheses around the entire string); now it assigns
it to "1" (sign before the string) when it is undefined (CHAR_MAX).

Austin Group Defect 1199[1] is applied, changing the requirements for
the '+' and '(' flags.

[1]: https://www.austingroupbugs.net/view.php?id=1199

Reviewed by:    kib
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D53913
DeltaFile
+3-3lib/libc/tests/stdlib/strfmon_test.c
+1-1lib/libc/stdlib/strfmon.c
+4-42 files

HardenedBSD/src 1fd0189lib/libc/stdlib strfmon.3 strfmon.c, lib/libc/tests/stdlib strfmon_test.c

strfmon: EINVAL if the '+' flag and both signs are empty

According to the Open Group Base Specifications Issue 8[1], strfmon(3)
should return EINVAL when the '+' flag was included in a conversion
specification and the locale's positive_sign and negative_sign values
would both be returned by localeconv(3) as empty strings.

Austin Group Defect 1199[2] is applied, adding the [EINVAL] error.

[1]: https://pubs.opengroup.org/onlinepubs/9799919799/functions/strfmon.html
[2]: https://www.austingroupbugs.net/view.php?id=1199

Reviewed by:    kib
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D53912
DeltaFile
+11-1lib/libc/stdlib/strfmon.3
+4-4lib/libc/tests/stdlib/strfmon_test.c
+3-1lib/libc/stdlib/strfmon.c
+18-63 files

HardenedBSD/src 19e1530lib/libc/tests/stdlib strfmon_test.c

strfmon: Add tests for Austin Group Defect 1199

Add tests for The Open Group Base Specifications Issue 8[1], Austin
Group Defect 1199[2].

Items marked with XXX represent an invalid output.  These items will be
fixed in subsequent commits.

Notice that an existing test is now considered invalid.

Our locale definitions do not include int_p_sep_by_space nor
int_n_sep_by_space[3].  Those will be addressed in a subsequent commit.
However, the CLDR project defines them as "0", which causes the output
to appear as "USD123.45".  If our locale definitions were to set the
international {n,p}_sep_by_space to "1", the output would display as the
expected "USD 123.45".

While here, use the SPDX license identifier and add my name to the
file.

    [8 lines not shown]
DeltaFile
+57-23lib/libc/tests/stdlib/strfmon_test.c
+57-231 files

HardenedBSD/src dc75034usr.bin/mdo mdo.1

mdo.1: Document group-related and fine-grained control functionalities

This is a manual page update describing the functionality that was added
to mdo(1) in commit 3ca1e69028ac ("mdo(1): Add support and shortcuts for
fully specifying users and groups").  Please either refer to that commit
or the new manual page's content for more information.

While here:
- Add to the introduction a description of process credentials and some
  specific vocabulary that is used throughout the page, as well as the
  relationship between mdo(1) and mac_do(4).
- Update the HISTORY section.
- Add AUTHORS and SECURITY CONSIDERATIONS sections.

Reviewed by:    ziaee
MFC after:      1 minute
Sponsored by:   The FreeBSD Foundation
Sponsored by:   Google LLC (GSoC 2025)
Co-authored-by: Kushagra Srivastava <kushagra1403 at gmail.com>

    [3 lines not shown]
DeltaFile
+245-24usr.bin/mdo/mdo.1
+245-241 files

HardenedBSD/src 73dd00fusr.bin/mdo mdo.1

mdo.1: Document group-related and fine-grained control functionalities

This is a manual page update describing the functionality that was added
to mdo(1) in commit 3ca1e69028ac ("mdo(1): Add support and shortcuts for
fully specifying users and groups").  Please either refer to that commit
or the new manual page's content for more information.

While here:
- Add to the introduction a description of process credentials and some
  specific vocabulary that is used throughout the page, as well as the
  relationship between mdo(1) and mac_do(4).
- Update the HISTORY section.
- Add AUTHORS and SECURITY CONSIDERATIONS sections.

Reviewed by:    ziaee
MFC after:      1 minute
Sponsored by:   The FreeBSD Foundation
Sponsored by:   Google LLC (GSoC 2025)
Co-authored-by: Kushagra Srivastava <kushagra1403 at gmail.com>
Differential Revision:  https://reviews.freebsd.org/D53905
DeltaFile
+245-24usr.bin/mdo/mdo.1
+245-241 files

HardenedBSD/src ebf1d98share/examples/sound oss.h

sound examples: Fix buffer mapping/allocation

The buffer in struct config should be allocated or mmap'ed. The code
without this patch allocates the buffer unconditionally, even for mmap
configs.

MFC after:      1 week
Reviewed by:    christos
Differential Revision:  https://reviews.freebsd.org/D53939
DeltaFile
+18-3share/examples/sound/oss.h
+18-31 files

HardenedBSD/src aa1cf24sys/fs/nfsserver nfs_nfsdstate.c

nfs_nfsdstate.c: Add sanity checks for lock stateids

Bugzilla PR reported a crash caused by a synthetic client
doing a Lock operation request with a delegation stateid.

This patch fixes the problem by adding sanity checks
for the type of stateid provided as an argument to the
Lock and LockU operations.

It has been tested with the FreeBSD, Linux and Solaris 11.4
clients.  Hopefully, other NFSv4 clients will work ok
as well.

PR:     291080
Tested by:      Robert Morris <rtm at lcs.mit.edu>
MFC after:      2 weeks
DeltaFile
+14-0sys/fs/nfsserver/nfs_nfsdstate.c
+14-01 files

HardenedBSD/src cb58eb8sys/dev/xilinx if_xae.c axidma.c, sys/netpfil/ipfilter/netinet fil.c ip_nat.c

Merge branch 'freebsd/current/main' into hardened/current/master
DeltaFile
+669-446sys/dev/xilinx/if_xae.c
+60-498sys/dev/xilinx/axidma.c
+90-2sys/netpfil/ipfilter/netinet/fil.c
+53-0sys/dev/xilinx/axidma_if.m
+37-16sys/dev/xilinx/if_xaevar.h
+41-1sys/netpfil/ipfilter/netinet/ip_nat.c
+950-9639 files not shown
+1,012-98315 files

HardenedBSD/src 4d84888contrib/unbound/iterator iter_scrub.c, usr.sbin/unbound/setup local-unbound-setup.sh

Merge branch 'freebsd/14-stable/main' into hardened/14-stable/master
DeltaFile
+35-4contrib/unbound/iterator/iter_scrub.c
+4-4usr.sbin/unbound/setup/local-unbound-setup.sh
+39-82 files