HardenedBSD/src fb3044fsbin/swapon/tests swapon_test.sh, sys/compat/linux linux_misc.c linux_uid16.c

Merge branch 'freebsd/current/main' into hardened/current/master
DeltaFile
+113-86sys/kern/kern_prot.c
+52-8sbin/swapon/tests/swapon_test.sh
+7-28sys/compat/linux/linux_misc.c
+6-28sys/compat/linux/linux_uid16.c
+16-10sys/sys/ucred.h
+4-16sys/ufs/ufs/ufs_vnops.c
+198-17613 files not shown
+222-19919 files

HardenedBSD/src 61c2dfcsys/dev/qlnx/qlnxe qlnx_os.c

Merge branch 'freebsd/14-stable/main' into hardened/14-stable/master
DeltaFile
+2-3sys/dev/qlnx/qlnxe/qlnx_os.c
+2-31 files

HardenedBSD/src 4befc67sys/sys param.h

param.h: bump __FreeBSD_version for be1f7435ef218b

I meant to review the diff again to make sure that __FreeBSD_version had
not progressed in the interim, but failed to do so- belatedly bump it
for a struct ucred ABI change.

Fixes:  be1f7435ef21 ("kern: start tracking cr_gid outside of [...]")
DeltaFile
+1-1sys/sys/param.h
+1-11 files

HardenedBSD/src be1f743sys/compat/linux linux_misc.c linux_uid16.c, sys/kern kern_prot.c

kern: start tracking cr_gid outside of cr_groups[]

This is the (mostly) kernel side of de-conflating cr_gid and the
supplemental groups.  The pre-existing behavior for getgroups() and
setgroups() is retained to keep the user <-> kernel boundary
functionally the same while we audit use of these syscalls, but we can
remove a lot of the internal special-casing just by reorganizing ucred
like this.

struct xucred has been altered because the cr_gid macro becomes
problematic if ucred has a real cr_gid member but xucred does not.  Most
notably, they both also have cr_groups[] members, so the definition
means that we could easily have situations where we end up using the
first supplemental group as the egid in some places.  We really can't
change the ABI of xucred, so instead we alias the first member to the
`cr_gid` name and maintain the status quo.

This also fixes the Linux setgroups(2)/getgroups(2) implementation to
more cleanly preserve the group set, now that we don't need to special

    [17 lines not shown]
DeltaFile
+113-86sys/kern/kern_prot.c
+7-28sys/compat/linux/linux_misc.c
+6-28sys/compat/linux/linux_uid16.c
+16-10sys/sys/ucred.h
+4-16sys/ufs/ufs/ufs_vnops.c
+5-1sys/rpc/authunix_prot.c
+151-1696 files not shown
+164-17912 files

HardenedBSD/src 763a097stand/defaults loader.conf

loader: add nvidia modules to the loader blacklist

It is known that nvidia modules, like the drm modules that are already
present, will panic if loaded in early boot rather than later.  Pop them
into our list to deny loading them if someone were to add, e.g.,
nvidia-modeset_load="YES", to their loader.conf.  This doesn't prevent
them from being loaded if one drops to the loader prompt, but it does
prevent the standard user from easy foot-shooting if they find old or
inaccurate information out in the wild.

Reviewed by:    imp, kbowling
MFC after:      3 days
Differential Revision:  https://reviews.freebsd.org/D51644
DeltaFile
+1-0stand/defaults/loader.conf
+1-01 files

HardenedBSD/src bfbb93bsys/dev/qlnx/qlnxe qlnx_os.c

qlnxe: Advertise the IFCAP_HWSTATS capability

The hardware can count statistics and the driver has already retrieved
them via qlnx_get_counter().

Advertise the IFCAP_HWSTATS capability to avoid the net stack from
double counting IFCOUNTER_IBYTES.

Reviewed by:    kbowling
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D51451

(cherry picked from commit 386960a8805edc6d5ac6bb6215ad102a83314549)
DeltaFile
+1-0sys/dev/qlnx/qlnxe/qlnx_os.c
+1-01 files

HardenedBSD/src cdd97f3sys/dev/qlnx/qlnxe qlnx_os.c

qlnxe: Fix advertising the IFCAP_LINKSTATE capability

The following up advertising of IFCAP_HWCSUM capability unconditionally
overwrite IFCAP_LINKSTATE.

Reviewed by:    kbowling
MFC after:      3 days
Differential Revision:  https://reviews.freebsd.org/D51450

(cherry picked from commit c18860339d5051dea99cb5cee7e322ffa5dd2a81)
DeltaFile
+1-3sys/dev/qlnx/qlnxe/qlnx_os.c
+1-31 files

HardenedBSD/src 147b909. UPDATING, share/man/man5 src.conf.5

Revert "src.opts.mk: Default LLVM_ASSERTIONS off"

Enabling and disabling LLVM assertions changes the ABI. There have
been multiple reports on the freebsd-current@ mailing list of broken
'cc'.

Out of caution, you may wish to do a clean build while crossing this
commit after building the reverted commit if you do not set
LLVM_ASSERTIONS in your src.conf.

Discussed with: kevans, jrtc27

This reverts commit 9b3055d0d4bcbe665d3c622c761adcc7d0a5b1c9.
DeltaFile
+3-4share/man/man5/src.conf.5
+0-5UPDATING
+1-1share/mk/src.opts.mk
+0-1tools/build/options/WITH_LLVM_ASSERTIONS
+4-114 files

HardenedBSD/src a01ce3bsbin/swapon/tests swapon_test.sh

swapon: Improve tests for non-standard kernel page size and small media

Add a test to verify swapon's behavior when attaching to media that's too small.
This also adapts existing tests to accommodate kernel page sizes larger than
the default 4KB.

Approved by:    kib, chs (previous version)
Sponsored by:   Netflix
Differential Revision:  https://reviews.freebsd.org/D51641
DeltaFile
+52-8sbin/swapon/tests/swapon_test.sh
+52-81 files

HardenedBSD/src 59d514f. UPDATING, sys/ufs/ffs ffs_softdep.c

Merge branch 'freebsd/current/main' into hardened/current/master
DeltaFile
+289-178usr.bin/sockstat/sockstat.c
+10-10sys/ufs/ffs/ffs_softdep.c
+16-1usr.bin/sockstat/sockstat.1
+12-5sys/vm/swap_pager.c
+10-0UPDATING
+4-4sys/ufs/ufs/ufs_extern.h
+341-19810 files not shown
+360-22816 files

HardenedBSD/src 0c57688cddl/contrib/opensolaris/cmd/dtrace dtrace.1, usr.sbin/bsdinstall/scripts auto

Merge branch 'freebsd/14-stable/main' into hardened/14-stable/master
DeltaFile
+8-0usr.sbin/bsdinstall/scripts/auto
+0-4cddl/contrib/opensolaris/cmd/dtrace/dtrace.1
+8-42 files

HardenedBSD/src 6fa24b2release/scripts pkgbase-stage.lua, usr.sbin/bsdinstall/scripts pkgbase.in

release, bsdinstall: include FreeBSD-kernel-man package

This package has been newly split off during man page reorganization and
should be considered part of the "base" component rather than being
ignored. Update pkgbase release and bsdinstall scripts for this change.

Reviewed by:    ivy
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D51519
DeltaFile
+3-1release/scripts/pkgbase-stage.lua
+3-1usr.sbin/bsdinstall/scripts/pkgbase.in
+6-22 files

HardenedBSD/src 3b3a289usr.sbin/syslogd syslogd.c

syslogd: Fix function return test

Looks like during the capsicum setup the return value for cap_syslogd
is checked twice rather than checking the return value of cap_net
after initializing the casper service.

Signed-off-by: Nathan Huff <nhuff at acm.org>
Fixes: 897240c7d666 ("syslogd: Enter capability mode")
Pull-request: https://github.com/freebsd/freebsd-src/pull/1796
DeltaFile
+1-1usr.sbin/syslogd/syslogd.c
+1-11 files

HardenedBSD/src 2e3fa93sys/vm swap_pager.c

swapongeom: destroy consumer/close vnode in case swaponsomething failed

Fixes:  aa42e4984997c9d3aa5d30534bdaf760e613e97b
Reported and tested by: olivier
Reviewed by:    alc, markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D51636
DeltaFile
+12-5sys/vm/swap_pager.c
+12-51 files

HardenedBSD/src 6f4de20sys/ufs/ffs ffs_softdep.c, sys/ufs/ufs ufs_extern.h ufs_vnops.c

ufs: change isrmdir type to bool or u_int as appropriate

Use bool for isrmdir argument to
ufs_dirremove()/softdep_setup_remove()/newdirrem(), where it is used as
bool.

Use u_int for isrmdir argument to
ufs_dirrewrite()/softdep_setup_directory_change()
where it is 0/1/ino.  Without the change to unsigned, the
        if (isrmdir > 1)
test is broken on volumes with many inodes.
Use newparent instead of isrmdir for the argument name in this case.

Reviewed by:    markj, olce
Tested by:      pho
Fixes:  610319c766e941de96e52f2d28fea9f8cfc51aeb
Fixes:  98eb6f0eaa50d8bd9a6794f0a9da2eddeae5bcd8
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D51617
DeltaFile
+10-10sys/ufs/ffs/ffs_softdep.c
+4-4sys/ufs/ufs/ufs_extern.h
+4-4sys/ufs/ufs/ufs_vnops.c
+4-3sys/ufs/ufs/ufs_lookup.c
+22-214 files

HardenedBSD/src bf426b8share/vt/fonts INDEX.fonts, share/vt/keymaps INDEX.keymaps

vt: Remove FONT specification from INDEX files

There is no reason to change the font in order to select a keymap or a
font.

This was done in the syscons(4) era to ensure that a font with the
appropriate character set was used for kbdmap or vidfont's localized
menu, but vt is always UTF-8 and this is no longer necessary.

PR:             235565
Reviewed by:    imp
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D51640
DeltaFile
+0-8share/vt/fonts/INDEX.fonts
+0-8share/vt/keymaps/INDEX.keymaps
+0-162 files

HardenedBSD/src 7b35b4dusr.bin/sockstat sockstat.c sockstat.1

sockstat: add libxo support

Sponsored by:   Google, LLC (GSoC 2025)
MFC after:      2 weeks
Reviewed by:    asomers
Pull Request:   https://github.com/freebsd/freebsd-src/pull/1770
Relnotes:       yes
DeltaFile
+289-178usr.bin/sockstat/sockstat.c
+16-1usr.bin/sockstat/sockstat.1
+1-1usr.bin/sockstat/Makefile
+306-1803 files

HardenedBSD/src 74072e9. UPDATING, share/man/man4 usbhid.4

usbhid: Enable by default

Co-authored-by: Emmanuel Vadot <manu at FreeBSD.org>
Reviewed by:    bapt, wulf
Relnotes:       Yes
Sponsored by:   Beckhoff Automation GmbH & Co. KG
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D45659
DeltaFile
+10-0UPDATING
+2-2share/man/man4/usbhid.4
+1-1sys/dev/usb/input/usbhid.c
+13-33 files

HardenedBSD/src 185bd9ccddl/contrib/opensolaris/cmd/dtrace dtrace.1

dtrace.1: Resolve merge conflict

PR: 288556
Fixes: 0c91fa982437 ("dtrace_fbt.4: Document the DTrace fbt provider")
DeltaFile
+0-4cddl/contrib/opensolaris/cmd/dtrace/dtrace.1
+0-41 files

HardenedBSD/src 525795cusr.sbin/bsdinstall/scripts auto

bsdinstall: Emit a warning if the system has too little memory

PR:             251993
Reviewed by:    adrian
Event:          Kitchener-Waterloo Hackathon 202506
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D50944

(cherry picked from commit eb5884c564ae0e37df1d8a3fc5704ab6b2fa07d0)
DeltaFile
+8-0usr.sbin/bsdinstall/scripts/auto
+8-01 files

HardenedBSD/src 6c2e961sbin/ping Makefile, sbin/recoverdisk recoverdisk.c

Merge branch 'freebsd/current/main' into hardened/current/master
DeltaFile
+0-2sbin/ping/Makefile
+1-1sbin/recoverdisk/recoverdisk.c
+1-32 files

HardenedBSD/src 0d9aa2asbin/recoverdisk recoverdisk.c

recoverdisk(1): Change time variables to time_t to compile on i386

Reported by: fluffy
PR: 288550
DeltaFile
+1-1sbin/recoverdisk/recoverdisk.c
+1-11 files

HardenedBSD/src 8526152sbin/ping Makefile

ping: Remove unnecessary compiler flag

This reverts commit 55e0aefae688075718e212594e823fe5fbfba4bf.
DeltaFile
+0-2sbin/ping/Makefile
+0-21 files

HardenedBSD/src 1e858c1lib/libc/db/hash hash.c, lib/libc/db/man dbopen.3 dbm.3

Merge branch 'freebsd/current/main' into hardened/current/master
DeltaFile
+98-0lib/libc/tests/db/dbm_perm_test.c
+16-7lib/libc/tests/db/dbm_open_test.c
+9-6lib/libc/db/hash/hash.c
+1-4lib/libc/db/man/dbopen.3
+1-4lib/libc/db/man/dbm.3
+1-0lib/libc/tests/db/Makefile
+126-216 files

HardenedBSD/src 550b4f8cddl/contrib/opensolaris/cmd/dtrace dtrace.1, libexec/rc rc

Merge branch 'freebsd/14-stable/main' into hardened/14-stable/master
DeltaFile
+332-0share/man/man4/dtrace_fbt.4
+17-1cddl/contrib/opensolaris/cmd/dtrace/dtrace.1
+8-4share/man/man4/dtrace_kinst.4
+4-4libexec/rc/rc.d/zfs
+2-2libexec/rc/rc
+2-2libexec/rc/rc.d/hostname
+365-135 files not shown
+371-1811 files

HardenedBSD/src 943ad2clibexec/rc rc rc.shutdown, libexec/rc/rc.d zfs hostname

rc: Use check_jail to check values of security.jail MIBs

PR:             282404
Reviewed by:    markj, netchild
Approved by:    markj (mentor)
MFC after:      2 weeks
Event:          Berlin Hackathon 202507
Differential Revision:  https://reviews.freebsd.org/D47329

(cherry picked from commit 46f18ecf8d3cdda1cd433841c44a4c1268ab9721)
DeltaFile
+4-4libexec/rc/rc.d/zfs
+2-2libexec/rc/rc.d/hostname
+2-2libexec/rc/rc
+2-2libexec/rc/rc.shutdown
+1-1libexec/rc/rc.d/routing
+1-1libexec/rc/rc.d/zfsbe
+12-121 files not shown
+13-137 files

HardenedBSD/src 0c91fa9cddl/contrib/opensolaris/cmd/dtrace dtrace.1, share/man/man4 dtrace_fbt.4 dtrace_kinst.4

dtrace_fbt.4: Document the DTrace fbt provider

Reported by:    markj
Reviewed by:    christos, markj (earlier version), ziaee
Obtained from:  Mark Johnston, DTrace, FreeBSD Journal, May 2014
Obtained from:  https://wiki.freebsd.org/DTrace/One-Liners
MFC after:      2 weeks
Relnotes:       yes

(cherry picked from commit 9388c2887817d7162ebb356b39aa9b4ab67a8c00)
DeltaFile
+332-0share/man/man4/dtrace_fbt.4
+8-4share/man/man4/dtrace_kinst.4
+5-0cddl/contrib/opensolaris/cmd/dtrace/dtrace.1
+1-0share/man/man4/Makefile
+346-44 files

HardenedBSD/src 8679496cddl/contrib/opensolaris/cmd/dtrace dtrace.1

dtrace.1: Mention providers in SEE ALSO

Reviewed by:    bnovkov, christos, markj
Approved by:    bnovkov (mentor), christos (mentor), markj (mentor)
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D50852

(cherry picked from commit 177471148a6111537e84912fb9a033b6ac5ecb17)
DeltaFile
+12-1cddl/contrib/opensolaris/cmd/dtrace/dtrace.1
+12-11 files

HardenedBSD/src 1459853lib/libc/db/hash hash.c, lib/libc/db/man dbm.3 dbopen.3

db/hash.c: Allow O_WRONLY in dbm_open

The dbm(3) manpage explicitly states that O_WRONLY is not allowed in
dbm_open, but a more recent comment in ` __hash_open` suggests otherwise.
Furthermore, POSIX.1 allows O_WRONLY in dbm_open and states
that the underlying file must be opened for both reading and writing.

Fix this by correcting the O_WRONLY check and moving it further into
the function to make sure that the original flags are stored in hashp.

Sponsored by:   Klara, Inc.
Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D51514
DeltaFile
+98-0lib/libc/tests/db/dbm_perm_test.c
+16-7lib/libc/tests/db/dbm_open_test.c
+9-6lib/libc/db/hash/hash.c
+1-4lib/libc/db/man/dbm.3
+1-4lib/libc/db/man/dbopen.3
+1-0lib/libc/tests/db/Makefile
+126-216 files

HardenedBSD/src 7deab63usr.bin/find function.c

Merge branch 'freebsd/current/main' into hardened/current/master
DeltaFile
+3-2usr.bin/find/function.c
+3-21 files