HardenedBSD/src 9cf6a47. RELNOTES, lib/libc/tests/string stpncpy_test.c

Merge remote-tracking branch 'origin/hardened/current/master' into hardened/current/cross-dso-cfi
DeltaFile
+39-16lib/libc/tests/string/stpncpy_test.c
+50-0RELNOTES
+19-15sys/dev/netmap/netmap_mem2.c
+27-6sys/netpfil/pf/pf_ioctl.c
+9-6sys/netpfil/pf/if_pfsync.c
+4-4sys/kern/kern_proc.c
+148-479 files not shown
+169-6315 files

HardenedBSD/src a75e764. RELNOTES, lib/libc/tests/string stpncpy_test.c

Merge branch 'freebsd/current/main' into hardened/current/master
DeltaFile
+39-16lib/libc/tests/string/stpncpy_test.c
+50-0RELNOTES
+19-15sys/dev/netmap/netmap_mem2.c
+27-6sys/netpfil/pf/pf_ioctl.c
+9-6sys/netpfil/pf/if_pfsync.c
+6-2sys/net/pfvar.h
+150-459 files not shown
+169-6315 files

HardenedBSD/src 2d626c3contrib/tzdata theory.html Makefile

Merge branch 'freebsd/14-stable/main' into hardened/14-stable/master
DeltaFile
+186-181contrib/tzdata/theory.html
+138-58contrib/tzdata/Makefile
+135-0contrib/tzdata/NEWS
+47-47contrib/tzdata/zonenow.tab
+36-16contrib/tzdata/europe
+41-10contrib/tzdata/northamerica
+583-31216 files not shown
+682-40822 files

HardenedBSD/src fa259d1sys/contrib/openzfs/module/os/freebsd/zfs zfs_vnops_os.c

zfs: Merge commit 86b064469dc9c2 from OpenZFS

  FreeBSD: Fix a potential null dereference in zfs_freebsd_fsync()

  In general it's possible for a vnode to not have an associated VM
  object.  This happens in particular with named pipes, which have
  some distinct VOPs, defined in zfs_fifoops.  Thus, this chunk of
  zfs_freebsd_fsync() needs to check for the FIFO case, like other
  vm_object_mightbedirty() callers do.

  (Note that vn_flush_cached_data() calls are predicated on
  zn_has_cached_data() returning true, and it checks for a NULL v_object
  pointer already.)

  Fixes: ef4058fcdc01838117dd93a654228bac7487a37c
  Reported-by: Collin Funk <collin.funk1 at gmail.com>
  Reviewed-by: Sean Eric Fagan <sef at FreeBSD.org>
  Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
  Reviewed-by: Alexander Motin <alexander.motin at TrueNAS.com>

    [4 lines not shown]
DeltaFile
+1-1sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vnops_os.c
+1-11 files

HardenedBSD/src 8be8642lib/libc/tests/string stpncpy_test.c

libc/test: fix typo

I misapplied ngie's recommended correction.

Fixes:  123c086200491819595abc271d360e605288fd18
Differential Revision:  https://reviews.freebsd.org/D54169
DeltaFile
+1-1lib/libc/tests/string/stpncpy_test.c
+1-11 files

HardenedBSD/src 5917f95usr.bin/login login.1

login.1: Remove mention of login copyright display

PR:             291649
Fixes: 905571c03119 ("Remove copyright strings printed at login time via login(1) or sshd(8).")
DeltaFile
+2-2usr.bin/login/login.1
+2-21 files

HardenedBSD/src 66eb783lib/libc/amd64/string stpncpy.S

libc/amd64: fix overread conditions in stpncpy()

Due to incorrect unit test design, two overread conditions went
undetected in the amd64 baseline stpncpy() implementation.
For buffers of 1--16 and 32 bytes that do not contain nul bytes
and end exactly at a page boundary, the code would incorrectly
read 16 bytes from the next page, possibly crossing into an
unmapped page and crashing the program.  If the next page was
mapped, the code would then proceed with the expected behaviour
of the stpncpy() function.

Three changes were made to fix the bug:

 - an off-by-one error is fixed in the code deciding whether to
   enter the runt case or not, entering it for 0<n<=32 bytes
   instead of 0<n<32 bytes as it was before.
 - in the runt case, the logic to skip reading a second 16-byte
   chunk if the buffer ends in the first chunk was fixed to
   account for buffers that end at a 16-byte boundary but do not

    [16 lines not shown]
DeltaFile
+4-3lib/libc/amd64/string/stpncpy.S
+4-31 files

HardenedBSD/src 123c086lib/libc/tests/string stpncpy_test.c

libc/tests/string: improve stpncpy() "bounds" unit test

The test is extended the same way I previously extended the memccpy()
test to fix what is probably the same kind of bug.

PR:             291359
Reported by:    Collin Funk <collin.funk1 at gmail.com>
Reviewed by:    ngie
Approved by:    markj (mentor)
Fixes:          6fa9e7d8737548ef93c573387ce62402c368d486 (D42519)
See also:       61ed5748e4e9c7397fcb2638b442f46ac5c9e7c5 (D46051)
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D54169

lib/libc/tests/string/stpncpy_test.c: apply ngie's fixes
DeltaFile
+39-16lib/libc/tests/string/stpncpy_test.c
+39-161 files

HardenedBSD/src 796abcasys/net pfvar.h, sys/netpfil/pf pf_ioctl.c if_pfsync.c

pfsync: Avoid zeroing the state export union

pfsync_state_export() takes a pointer to a union that is in reality a
pointer to one of the three state formats (1301, 1400, 1500), and zeros
the union.  The three formats do not have the same size, so zeroing is
wrong when the format isn't that which has the largest size.

Refactor a bit so that the zeroing happens at the layer where we know
which format we're dealing with.

Reported by:    CHERI
Reviewed by:    kp
MFC after:      1 week
Sponsored by:   CHERI Research Centre (EPSRC grant UKRI3001)
Differential Revision:  https://reviews.freebsd.org/D54163
DeltaFile
+27-6sys/netpfil/pf/pf_ioctl.c
+9-6sys/netpfil/pf/if_pfsync.c
+6-2sys/net/pfvar.h
+42-143 files

HardenedBSD/src c694122sys/dev/netmap netmap_mem2.c

netmap: Let memory allocator parameters be settable via loader.conf

This is useful when dev.netmap.port_numa_affinity is set to 1.  When
interfaces attach, they get a memory allocator that is copied from
nm_mem.  Parameters in nm_mem can be set using sysctls, but this happens
after their values are copied.

To work around this, we can make it possible to set these memory
parameters as tunables.

Reviewed by:    vmaffione
MFC after:      1 week
Sponsored by:   Klara, Inc.
Differential Revision:  https://reviews.freebsd.org/D54178
DeltaFile
+19-15sys/dev/netmap/netmap_mem2.c
+19-151 files

HardenedBSD/src a0d6079sys/kern uipc_socket.c

socket: Fix the name of a parameter in a comment

Reported by:    des
Fixes:          0a68f644dca1 ("socket: Split up soreceive_generic()")
MFC after:      1 week
DeltaFile
+1-1sys/kern/uipc_socket.c
+1-11 files

HardenedBSD/src 9dda51flibexec/rc rc.subr

rc.subr: Use the variable we defined to invoke setaudit(8)

Reported by:    gtetlow
Fixes:          39ee24182b92 ("rc.subr: Support setting the audit user when starting services")
MFC after:      1 week
DeltaFile
+1-1libexec/rc/rc.subr
+1-11 files

HardenedBSD/src 9734ca0. RELNOTES

RELNOTES: Add entries from this week's scan of the commit logs

Reviewed by:    emaste, imp
Differential Revision:  https://reviews.freebsd.org/D54197
DeltaFile
+50-0RELNOTES
+50-01 files

HardenedBSD/src d4f25d0sys/kern vfs_syscalls.c kern_jail.c

vfs: Let prison_enforce_statfs zero the fsid

Currently, we unconditionally zero the fsid before returning a struct
statfs to a jailed process.  Move this into prison_enforce_statfs() so
it only happens if enforce_statfs is greater than 1, or enforce_statfs
is 1 but the mountpoint is outside the jail.

PR:             291301
MFC after:      1 week
Reviewed by:    kib
Differential Revision:  https://reviews.freebsd.org/D54214
DeltaFile
+1-4sys/kern/vfs_syscalls.c
+3-0sys/kern/kern_jail.c
+4-42 files

HardenedBSD/src 026d962sys/kern kern_proc.c kern_fork.c

proc: Fix proc_init / proc_dtor ordering issues

* Move the initialization of p_ktr into proc_init() and make the check
  in proc_dtor() unconditional.  Prior to this, it was possible to fail
  and invoke proc_dtor() after the first thread had been created (which
  was the condition for checking p_ktr in proc_dtor()) but before p_ktr
  had been initialized.

* Move the p_klist initialization in fork1() past the last possible
  failure point so we don't have to free it on failure.  We didn't,
  which meant we were leaking a knlist every time we failed to fork
  due to hitting the resource limit.

PR:             291470
MFC after:      1 week
Reviewed by:    kib
Differential Revision:  https://reviews.freebsd.org/D54215
DeltaFile
+4-4sys/kern/kern_proc.c
+2-2sys/kern/kern_fork.c
+6-62 files

HardenedBSD/src f3f0029contrib/tzdata theory.html Makefile

Merge branch 'freebsd/15-stable/main' into hardened/15-stable/main
DeltaFile
+186-181contrib/tzdata/theory.html
+138-58contrib/tzdata/Makefile
+135-0contrib/tzdata/NEWS
+47-47contrib/tzdata/zonenow.tab
+36-16contrib/tzdata/europe
+41-10contrib/tzdata/northamerica
+583-31216 files not shown
+682-40822 files

HardenedBSD/src 68e2f4ccontrib/tzdata theory.html Makefile

contrib/tzdata: import tzdata 2025c

Changes: https://github.com/eggert/tz/blob/2025c/NEWS

(cherry picked from commit a86dc94b84d177da8f00d1c9420ef0860576e4c4)
DeltaFile
+186-181contrib/tzdata/theory.html
+138-58contrib/tzdata/Makefile
+135-0contrib/tzdata/NEWS
+47-47contrib/tzdata/zonenow.tab
+36-16contrib/tzdata/europe
+41-10contrib/tzdata/northamerica
+583-31216 files not shown
+682-40822 files

HardenedBSD/src b94c971contrib/tzdata theory.html Makefile

contrib/tzdata: import tzdata 2025c

Changes: https://github.com/eggert/tz/blob/2025c/NEWS

(cherry picked from commit a86dc94b84d177da8f00d1c9420ef0860576e4c4)
DeltaFile
+186-181contrib/tzdata/theory.html
+138-58contrib/tzdata/Makefile
+135-0contrib/tzdata/NEWS
+47-47contrib/tzdata/zonenow.tab
+36-16contrib/tzdata/europe
+41-10contrib/tzdata/northamerica
+583-31216 files not shown
+682-40822 files

HardenedBSD/src 6dabc1dsbin/pfctl pf_print_state.c, sys/conf newvers.sh

Merge remote-tracking branch 'origin/hardened/current/master' into hardened/current/cross-dso-cfi
DeltaFile
+0-5sbin/pfctl/pf_print_state.c
+1-2sys/conf/newvers.sh
+1-72 files

HardenedBSD/src 5e00129sbin/pfctl pf_print_state.c

Merge branch 'freebsd/current/main' into hardened/current/master
DeltaFile
+0-5sbin/pfctl/pf_print_state.c
+0-51 files

HardenedBSD/src 7836f0clibexec/rc/rc.d FILESYSTEMS noshutdown, sbin/reboot nextboot.sh

Merge branch 'freebsd/14-stable/main' into hardened/14-stable/master
DeltaFile
+4-0sbin/reboot/nextboot.sh
+1-1libexec/rc/rc.d/FILESYSTEMS
+1-1libexec/rc/rc.d/noshutdown
+1-1sys/sys/bus.h
+1-1usr.bin/fsync/fsync.c
+1-0libexec/rc/rc.d/cleanvar
+9-46 files

HardenedBSD/src 4e323b8lib/libsysdecode Makefile, libexec/rc/rc.d noshutdown FILESYSTEMS

Merge branch 'freebsd/15-stable/main' into hardened/15-stable/main
DeltaFile
+34-10sbin/reboot/reboot.c
+2-2sbin/reboot/nextboot.8
+1-1libexec/rc/rc.d/noshutdown
+1-1libexec/rc/rc.d/FILESYSTEMS
+1-1lib/libsysdecode/Makefile
+1-1sys/sys/bus.h
+40-162 files not shown
+42-178 files

HardenedBSD/src 33510b1sbin/reboot nextboot.sh

nextboot: Reimplement missing -a option

PR:             260520
MFC after:      3 days
Fixes:          e307eb94ae52 ("loader: zfs should support bootonce an nextboot")
DeltaFile
+4-0sbin/reboot/nextboot.sh
+4-01 files

HardenedBSD/src ca87690libexec/rc/rc.d FILESYSTEMS cleanvar

cleanvar: Fix startup order

Instead of having FILESYSTEMS require cleanvar, which doesn't really
make semantic sense, say that cleanvar needs to run before FILESYSTEMS.

MFC after:      3 days
Reviewed by:    imp
Differential Revision:  https://reviews.freebsd.org/D54118

(cherry picked from commit 6ce227d6274869a95150746d2f2d8c8c5ed9a266)
DeltaFile
+1-1libexec/rc/rc.d/FILESYSTEMS
+1-0libexec/rc/rc.d/cleanvar
+2-12 files

HardenedBSD/src 2872555usr.bin/fsync fsync.c

fsync: Open files in non-blocking mode

This avoids blocking forever when invoked on a fifo.

MFC after:      1 week
Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D54084

(cherry picked from commit 69e041521a80a0b8950f6ec25269a9c3949d6590)
DeltaFile
+1-1usr.bin/fsync/fsync.c
+1-11 files

HardenedBSD/src 68ed90dsbin/reboot reboot.c nextboot.8

nextboot: Reimplement missing -a option

* Reimplement the -a option which was available in the original shell
  script and is still documented.

* Print the correct usage string when invoked as nextboot.

* Add the -D option to the manual page synopsis.

MFC after:      1 week
Fixes:          fd6d47375a78 ("rescue,nextboot: Install nextboot as a link to reboot, rm nextboot.sh")
Reviewed by:    imp
Differential Revision:  https://reviews.freebsd.org/D54120

(cherry picked from commit de670c611b17939712a81dc56f73a3ff84f6c178)
DeltaFile
+34-10sbin/reboot/reboot.c
+2-2sbin/reboot/nextboot.8
+36-122 files

HardenedBSD/src 8959edalibexec/rc/rc.d noshutdown

noshutdown: Fix startup order

This rc script exists solely to create a file, so have it explicitly
require FILESYSTEMS.  In its current form, it was as likely as not to
end up running before cleanvar, which would undo its work.

MFC after:      3 days
Fixes:          384d976725a5 ("rc.d: Add precious_machine rc.conf knob to create /var/run/noshutdown")
Reviewed by:    kib
Differential Revision:  https://reviews.freebsd.org/D54119

(cherry picked from commit e540e8b2c04f03b4210a3bf2f421c05b918d1b51)
DeltaFile
+1-1libexec/rc/rc.d/noshutdown
+1-11 files

HardenedBSD/src 5f8988blib/libsysdecode Makefile

libsysdecode: Use consistent include path

mkioctls should look at the same set of headers as mktables does.

MFC after:      1 week
Fixes:          139d114acc7b ("libsysdecode use MKTABLES_INCLUDEDIR")
Sponsored by:   Klara, Inc.
Sponsored by:   NetApp, Inc.
Reviewed by:    sjg
Differential Revision:  https://reviews.freebsd.org/D54106

(cherry picked from commit c51876a107310984ba3a31b088caebcfd86a9844)
DeltaFile
+1-1lib/libsysdecode/Makefile
+1-11 files

HardenedBSD/src ed66f6esys/sys bus.h

bus: Return 0 if reading an ivar fails

In the non-INVARIANTS case, return 0 rather than stack garbage if
reading an ivar fails (in the INVARIANTS case, we still panic).

MFC after:      1 week
Sponsored by:   Klara, Inc.
Sponsored by:   NetApp, Inc.
Reviewed by:    jhb
Differential Revision:  https://reviews.freebsd.org/D54078

(cherry picked from commit 4c2295c15860e70c8bd3f05f9229d2fc40dfd50d)
DeltaFile
+1-1sys/sys/bus.h
+1-11 files

HardenedBSD/src 1dee233sbin/pfctl pf_print_state.c

pfctl: report ICMP states consistently for IPv4/IPv6

Remove the '#ifndef INET6', which never actually mattered because this
define is never set. This makes us report ICMP states for IPv4 and IPv6
the same way (and also aligns us with OpenBSD).

This means we will now always report state 0:0 rather than
NO_TRAFFIC:NO_TRAFFIC for icmp6 (like we already did for icmp).

Reported by:    Lev Prokofev <lev at netgate.com>
Sponsored by:   Rubicon Communications, LLC ("Netgate")
DeltaFile
+0-5sbin/pfctl/pf_print_state.c
+0-51 files