HardenedBSD/src ba3d547sys/netinet tcp_usrreq.c, tests/sys/netinet so_reuseport_lb_test.c

tcp: Fix the SO_REUSEPORT_LB check

This needs to happen in tcp_connect() rather than tcp_usr_connect(), as
the latter is reachable by implied connect() via sendto().

Reviewed by:    glebius
Reported by:    syzbot+eecc86e6952fd9ba9f11 at syzkaller.appspotmail.com
Fixes:          c7f803c71dae ("inpcb: fix a panic with SO_REUSEPORT_LB + connect(2) misuse")
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D50893
DeltaFile
+10-0tests/sys/netinet/so_reuseport_lb_test.c
+6-2sys/netinet/tcp_usrreq.c
+16-22 files

HardenedBSD/src 1049c07libexec/nuageinit nuageinit.7

nuageinit.7: language and grammar fixes mostly
DeltaFile
+26-28libexec/nuageinit/nuageinit.7
+26-281 files

HardenedBSD/src 5ec727elibexec/nuageinit nuageinit.7 Makefile

nuageinit: write a documentation

Reviewed by:    imp, ziaee (both a previous version)
Differential Revision:  https://reviews.freebsd.org/D50878
DeltaFile
+288-0libexec/nuageinit/nuageinit.7
+1-0libexec/nuageinit/Makefile
+289-02 files

HardenedBSD/src f9c9122sys/fs/fuse fuse_device.c fuse_vfsops.c, sys/sys exterr_cat.h

fusefs: First take on exterrorizing

Reviewed by:    kib, asomers
Approved by:    kib, asomers
Differential Revision: https://reviews.freebsd.org/D50831
DeltaFile
+21-13sys/fs/fuse/fuse_device.c
+21-12sys/fs/fuse/fuse_vfsops.c
+1-0sys/sys/exterr_cat.h
+43-253 files

HardenedBSD/src 7e19304stand/lua drawer.lua

loader: Fix loader_brand = none

Setting loader_brand to none in loader.conf now result in a lua error
as we try to get a non-existant table
Defines it

Differential Revision:  https://reviews.freebsd.org/D50875
Fixes:  bef6d85b6de5 ("lualoader: allow graphical bits to be disabled with loader_gfx")
Reviewed by:    kevans, tsoome
Sponsored by:   Beckhoff Automation GmbH & Co. KG
DeltaFile
+1-1stand/lua/drawer.lua
+1-11 files

HardenedBSD/src 6039cd1sbin/ipf/ipsend iptests.c sock.c, usr.bin/netstat inet.c

Don't include netinet/tcp_timer.h when not needed

Reviewed by:            glebius
MFC after:              1 week
Sponsored by:           Netflix, Inc.
Differential Revision:  https://reviews.freebsd.org/D50889
DeltaFile
+0-1usr.bin/systat/tcp.c
+0-1sbin/ipf/ipsend/iptests.c
+0-1sbin/ipf/ipsend/sock.c
+0-1usr.bin/netstat/inet.c
+0-1usr.bin/systat/netstat.c
+0-55 files

HardenedBSD/src 990a088tools/build/mk OptionalObsoleteFiles.inc

OptionalObsoleteFiles: Keep common files between MIT and Heimdal

Reported by:    "Herbert J. Skuhra" <herbert at gojira.at>
Original by:    "Herbert J. Skuhra" <herbert at gojira.at>
Fixes:          7e35117eb07f
DeltaFile
+0-6tools/build/mk/OptionalObsoleteFiles.inc
+0-61 files

HardenedBSD/src 5c66d7ashare/vt/keymaps uk.kbd

uk.kbd: Fix € mapping

We previously emitted the generic currency sign `¤` for Ctrl+4.
Generally speaking the modifer should be AltGr not Ctrl, and this should
be the Euro symbol `€`.

Fixes: eb8f9028fb38 ("Add the Euro symbol mapping to the UK keyboard keymap.")
Fixes: a232c1d130d2 ("Copy country-code .iso syscons keymaps for vt(4)")
Fixes: fdd869bd8a89 ("Another rpund of fixes, after checking keymaps for plausibility and with")

Reviewed by:    ivy
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D50702
DeltaFile
+1-1share/vt/keymaps/uk.kbd
+1-11 files

HardenedBSD/src 64cbb43share/man/man4 mac_do.4, stand/efi/loader bootinfo.c

Merge branch 'freebsd/14-stable/main' into hardened/14-stable/master
DeltaFile
+21-0sys/amd64/amd64/machdep.c
+18-1usr.sbin/config/config.5
+4-4share/man/man4/mac_do.4
+7-1stand/efi/loader/bootinfo.c
+1-0sys/x86/include/metadata.h
+51-65 files

HardenedBSD/src 29b02ablib/libpam/modules/pam_ksu pam_ksu.c

pam_ksu: Move temp_realm into the correct context

Fixes:          98f18cd98824
DeltaFile
+2-1lib/libpam/modules/pam_ksu/pam_ksu.c
+2-11 files

HardenedBSD/src 0e8890astand/efi/loader bootinfo.c, sys/amd64/amd64 machdep.c

Add a new sysctl in order to diffrentiate UEFI architectures

With the new 32-bit UEFI loader, it's convenient to have a sysctl to
figure out how we booted. Can be accessed at machdep.efi_arch

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1098

(cherry picked from commit b538d4911004ca541507166b8ec9689d2e87d1aa)

Approved by: imp (mentor)
DeltaFile
+21-0sys/amd64/amd64/machdep.c
+7-1stand/efi/loader/bootinfo.c
+1-0sys/x86/include/metadata.h
+29-13 files

HardenedBSD/src 9134ed1usr.sbin/bsdinstall/scripts auto

bsdinstall: Default to pkgbase if media contains base packages

As of commit 62d18f8c4c10 ("release: Add -DPKGBASE option to include
pkgbase packages") we can include base system packages on the install
media instead of dist tarballs.

Set the default for the traditional/pkgbase question to match the
artifact type included in the install image.

Reviewed by:    jrm
Event:          Kitchener-Waterloo Hackathon 202506
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D50467
DeltaFile
+10-1usr.sbin/bsdinstall/scripts/auto
+10-11 files

HardenedBSD/src 66cc116lib/libprocstat zfs_defs.c zfs.c, lib/libprocstat/zfs Makefile Makefile.depend

libprocstat: Drop zfs_defs.c hack, including its _KERNEL define

Now that we have a _WANT_ZNODE we can use that instead of defining
_KERNEL, and we're able to move the code back into zfs.c using a real
znode_t pointer.

Whilst here, tidy the includes.

Reviewed by:    imp, kib, markj
Differential Revision:  https://reviews.freebsd.org/D50721
DeltaFile
+0-81lib/libprocstat/zfs_defs.c
+24-25lib/libprocstat/zfs.c
+0-36lib/libprocstat/zfs_defs.h
+0-30lib/libprocstat/zfs/Makefile
+14-9lib/libprocstat/Makefile
+0-11lib/libprocstat/zfs/Makefile.depend
+38-1926 files

HardenedBSD/src b4f9be7sys/contrib/openzfs/include/os/freebsd/zfs/sys zfs_znode_impl.h, sys/contrib/openzfs/include/sys zfs_znode.h zfs_vfsops.h

openzfs: Add a _WANT_ZNODE that defines struct znode / znode_t for userspace

Note that ZNODE_OS_FIELDS needs to change to using struct vnode over
vnode_t (matching struct zfsvfs rather than vnode_t) since vnode_t is
only defined in the kernel SPL, not the userspace SPL (libspl).

Whilst here, tidy up the includes and clarify a comment.

Reviewed by:    imp, markj
Differential Revision:  https://reviews.freebsd.org/D50720
DeltaFile
+8-1sys/contrib/openzfs/include/os/freebsd/zfs/sys/zfs_znode_impl.h
+4-1sys/contrib/openzfs/include/sys/zfs_znode.h
+1-1sys/contrib/openzfs/include/sys/zfs_vfsops.h
+13-33 files

HardenedBSD/src 20aaf0flib/libprocstat msdosfs.c smbfs.c

libprocstat: Drop all _KERNEL defines outside of zfs_defs.c

Defining _KERNEL is a historical hack that can often break due to the
environment not actually being that of a kernel build. Now that we have
other targeted macros we can define instead that don't have far-reaching
implications like _KERNEL we can drop this.

Reviewed by:    imp, kib, markj
Differential Revision:  https://reviews.freebsd.org/D50719
DeltaFile
+3-12lib/libprocstat/msdosfs.c
+1-2lib/libprocstat/smbfs.c
+1-2lib/libprocstat/zfs.c
+1-2lib/libprocstat/cd9660.c
+0-2lib/libprocstat/udf.c
+6-205 files

HardenedBSD/src b61239esys/fs/msdosfs msdosfsmount.h denode.h, usr.sbin/makefs/msdos Makefile.inc

msdosfs: Add _WANT_MSDOSFS_INTERNALS to replace MAKEFS in headers

This lets other bits of userspace expose these various definitions too.
In particular, this will be used by libprocstat so it can stop defining
_KERNEL.

The function prototypes surely won't be useful in other contexts, but
the various types are, and it's not worth hiding the prototypes unless
they end up causing issues, but so long as they aren't called they
shouldn't be a problem.

Note the MAKEFS define continues to exist, but only for use in
newfs_msdos, as those sources are reused by makefs with some changed
behaviour.

Reviewed by:    imp, markj
Differential Revision:  https://reviews.freebsd.org/D50718
DeltaFile
+5-5sys/fs/msdosfs/msdosfsmount.h
+2-2sys/fs/msdosfs/denode.h
+2-2sys/fs/msdosfs/fat.h
+1-1usr.sbin/makefs/msdos/Makefile.inc
+10-104 files

HardenedBSD/src c4d3a18sys/fs/msdosfs msdosfsmount.h

msdosfs: Don't #ifdef out msdosfsmount members

Whilst these aren't used by makefs, they do little harm existing once
the needed headers are included, and having structs change layout based
on defines like this can be fraught. This will be particularly true once
this code is exposed by defines other than _KERNEL and MAKEFS, as any
consumer will be able to opt into exposing this kernel type and all the
definitions should match.

Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D50885
DeltaFile
+4-3sys/fs/msdosfs/msdosfsmount.h
+4-31 files

HardenedBSD/src 68c3cecsys/fs/cd9660 iso.h

cd9660: Add _WANT_ISO_MNT

This allows struct iso_mnt to be defined for userspace without resorting
to the gross hack of defining _KERNEL. In particular, it will be used by
libprocstat so it can stop defining _KERNEL.

Reviewed by:    imp, kib, markj
Differential Revision:  https://reviews.freebsd.org/D50717
DeltaFile
+5-1sys/fs/cd9660/iso.h
+5-11 files

HardenedBSD/src b1e6714sys/sys mount.h

sys/mount.h: Add missing headers so it's standalone for _WANT_MOUNT

Reviewed by:    imp, kib, markj
Differential Revision:  https://reviews.freebsd.org/D50716
DeltaFile
+4-0sys/sys/mount.h
+4-01 files

HardenedBSD/src ebc0ceasys/sys mount.h

sys/mount.h: Hoist sys/types.h include

This header uses various types that come from here regardless of whether
_KERNEL is defined, so unconditionally include it rather than relying on
other headers implicitly including it for when _KERNEL is not defined.

Reviewed by:    kib
Differential Revision:  https://reviews.freebsd.org/D50884
DeltaFile
+1-1sys/sys/mount.h
+1-11 files

HardenedBSD/src 3923bf5tools/build Makefile, tools/build/cross-build/include/common/sys _types.h

tools/build: Provide extra headers on non-FreeBSD

These will be needed by future changes to continue to allow building
makefs as a bootstrap tool on Linux and macOS. This also requires
defining __sbintime_t in our cross-build sys/_types.
DeltaFile
+6-0tools/build/Makefile
+3-0tools/build/cross-build/include/common/sys/_types.h
+9-02 files

HardenedBSD/src 64e0b2eusr.sbin/makefs/zfs zap.c

makefs: Implement the collision differentiator for micro ZAPs

In the unlikely event of a hash collision, the collision differentiator
is used to create a unique lookup key for ZAP entries.  While the fat
ZAP implementation in makefs implemented this, the micro ZAP
implementation did not, so it's possible to end up with collisions in
directory entries.  These are caught deterministically by OpenZFS, but
the result is a panic.

Implement a simple differentiator by simply assigning a unique value to
each ZAP entry.  This scheme works since the 16-bit space of
differentiators is larger than the maximum number of entries in a micro
ZAP.  (While the on-disk encoding provides 32 bits of space for the
differentiator, the in-memory representation of micro ZAP entries is
smaller.)

PR:             287482
MFC after:      1 week
DeltaFile
+7-1usr.sbin/makefs/zfs/zap.c
+7-11 files

HardenedBSD/src 14fc135usr.sbin/config config.5

config.5: Bump .Dd to reflect latest update

MFC with:       1bdf1b818635 ("config.5: Document CONF_CFLAGS under 'makeoptions'")
Event:          Kitchener-Waterloo Hackathon 202506
Sponsored by:   The FreeBSD Foundation

(cherry picked from commit 956100d60fa86daebc1bd46ea62f207f6b54d93d)

Fixed the "MFC with" tag (which is wrong in main).

Event:          Kitchener-Waterloo Hackathon 202506
DeltaFile
+1-1usr.sbin/config/config.5
+1-11 files

HardenedBSD/src bb5a210usr.sbin/config config.5

config.5: Document CONF_CFLAGS under 'makeoptions'

This variable serves to tweak CFLAGS from the kernel configuration file,
easing some custom kernel builds.  It was introduced by bde@ in 1999.

The description has been kept simple on purpose.  It does not completely
reflect reality as the build infrastructure actually appends variables
to CFLAGS after CONF_CFLAGS has been processed in a few cases.  However,
these cases do not collide with expected common uses of CONF_CFLAGS, so
have not been mentioned.

Reviewed by:    markj (older version)
MFC after:      3 days
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D50544

(cherry picked from commit 1bdf1b8186359d4ea26e26de03e03b7c1543b707)

Event:          Kitchener-Waterloo Hackathon 202506
DeltaFile
+17-0usr.sbin/config/config.5
+17-01 files

HardenedBSD/src 9e185aeshare/man/man4 mac_do.4

mac_do(4): Bump .Dd to reflect latest update

MFC with:       94828b338033 ("mac_do(4): Examples: Fix some descriptions and a typo")
Sponsored by:   The FreeBSD Foundation

(cherry picked from commit 7747d826573a38e6caa06619f5596b792dc5a976)

Event:          Kitchener-Waterloo Hackathon 202506
DeltaFile
+1-1share/man/man4/mac_do.4
+1-11 files

HardenedBSD/src 27955edshare/man/man4 mac_do.4

mac_do(4): Examples: Fix some descriptions and a typo

MFC after:      3 days
Sponsored by:   The FreeBSD Foundation

(cherry picked from commit 94828b33803314b5c8e833b233ca6894a340aa88)

Event:          Kitchener-Waterloo Hackathon 202506
DeltaFile
+3-3share/man/man4/mac_do.4
+3-31 files

HardenedBSD/src 4dfbc03usr.bin/dtc input_buffer.cc input_buffer.hh

dtc: Sync with upstream commit 23387dd

Add the ability to parse char literals needed to compile DTBs currently
in base.

Reviewed by:    theraven, emaste
Approved by:    emaste (mentor)
Differential Revision:  https://reviews.freebsd.org/D42438
DeltaFile
+53-0usr.bin/dtc/input_buffer.cc
+22-0usr.bin/dtc/input_buffer.hh
+75-02 files

HardenedBSD/src 956100dusr.sbin/config config.5

config.5: Bump .Dd to reflect latest update

MFC with:       7d7b2d38463c ("config.5: Document CONF_CFLAGS under 'makeoptions'")
Event:          Kitchener-Waterloo Hackathon 202506
Sponsored by:   The FreeBSD Foundation
DeltaFile
+1-1usr.sbin/config/config.5
+1-11 files

HardenedBSD/src 98f18cdlib/libpam/modules/pam_ksu pam_ksu.c

pam_ksu: Move the realm free to end of function

This avoids a use after free.

Noted by:       jhb
DeltaFile
+2-2lib/libpam/modules/pam_ksu/pam_ksu.c
+2-21 files

HardenedBSD/src 12684e9sys/vm vm_mmap.c

HBSD: Resolve merge conflict

Signed-off-by:  Shawn Webb <shawn.webb at hardenedbsd.org>
DeltaFile
+3-17sys/vm/vm_mmap.c
+3-171 files