HardenedBSD/src df59484sys/kern kern_rwlock.c kern_mutex.c

Merge remote-tracking branch 'origin/hardened/current/master' into hardened/current/cross-dso-cfi
DeltaFile
+4-12sys/kern/kern_rwlock.c
+1-3sys/kern/kern_mutex.c
+5-152 files

HardenedBSD/src 749854asys/kern kern_rwlock.c kern_mutex.c

Merge branch 'freebsd/current/main' into hardened/current/master
DeltaFile
+4-12sys/kern/kern_rwlock.c
+1-3sys/kern/kern_mutex.c
+5-152 files

HardenedBSD/src 83d13d8sys/kern kern_rwlock.c kern_mutex.c

locks: run the extra NULL check only with INVARIANTS

This reverts commit 73da0265c29c79641dab3e6b98452bd5afca01fb.
This reverts commit 87ee63bac69dc49291f55590b8baa57cad6c7d85.

Discussed with:         mjg
DeltaFile
+4-12sys/kern/kern_rwlock.c
+1-3sys/kern/kern_mutex.c
+5-152 files

HardenedBSD/src 9dae821sys/dev/pci pci.c, sys/kern subr_intr.c kern_prot.c

Merge remote-tracking branch 'origin/hardened/current/master' into hardened/current/cross-dso-cfi
DeltaFile
+2-9sys/kern/subr_intr.c
+2-2sys/sys/ucred.h
+1-1sys/kern/kern_prot.c
+1-1usr.sbin/uefisign/uefisign.8
+2-0sys/dev/pci/pci.c
+8-135 files

HardenedBSD/src eb1970csys/dev/pci pci.c, sys/kern subr_intr.c kern_prot.c

Merge branch 'freebsd/current/main' into hardened/current/master
DeltaFile
+2-9sys/kern/subr_intr.c
+2-2sys/sys/ucred.h
+1-1usr.sbin/uefisign/uefisign.8
+2-0sys/dev/pci/pci.c
+1-1sys/kern/kern_prot.c
+8-135 files

HardenedBSD/src cd46e98sys/kern kern_prot.c, sys/sys ucred.h

cred: fix struct credbatch to use long for refcount

This structure collects count from multiple cred structures.  Of course it
can't use a smaller type.

PR:                     283747
Reviewed by:            olce, mjg, markj
Differential Revision:  https://reviews.freebsd.org/D49562
Fixes:                  37337709d3334f32650ba3a7c529fa013ed5e1f2
DeltaFile
+2-2sys/sys/ucred.h
+1-1sys/kern/kern_prot.c
+3-32 files

HardenedBSD/src d2859cdusr.sbin/uefisign uefisign.8

uefisign.8: fix indent

The current version has every item description beginning on a new line;
not the intention.
DeltaFile
+1-1usr.sbin/uefisign/uefisign.8
+1-11 files

HardenedBSD/src 0e33c2esys/dev/pci pci.c

pci: Only re-route IRQs based on firmware on x86

There is a (very historical) call to pci_assign_interrupt for the
purpose of routing IRQs which may have been set up wrong by x86 BIOS
or firmware.  On non-x86 systems, this is unnecessary; and on INTRNG
systems it results in a (synthetic) IRQ leak and ultimately a kernel
panic after many hotplug/unplug cycles.

Suggested by:   jhb
Reviewed by:    jhb
MFC after:      2 weeks
Sponsored by:   Amazon
Differential Revision:  https://reviews.freebsd.org/D49560
DeltaFile
+2-0sys/dev/pci/pci.c
+2-01 files

HardenedBSD/src 4cb527bsys/kern subr_intr.c

Correctly track index of first free irq map entry

Any time an IRQ map entry was removed, irq_map_first_free_idx was being
set to the index of the removed entry; this caused problems when
entries were removed in random order since irq_map_first_free_idx was
set to a larger value than the index of the first free map entry, and
in 9beb195fd9fd ("Continue searching for an irq map from the start")
the IRQ map allocation code was adjusted to use irq_map_first_free_idx
as a starting point but ultimately scan the entire map if necessary,
including values less than irq_map_first_free_idx.

Remove that workaround and instead make irq_map_first_free_idx do what
the name suggests -- tracking the index of the first free map entry --
by only setting to the index of a newly-freed entry if that index is
lower than the existing irq_map_first_free_idx value.

Reviewed by:    imp, mhorne
Sponsored by:   Amazon
Differential Revision:  https://reviews.freebsd.org/D49543
DeltaFile
+2-9sys/kern/subr_intr.c
+2-91 files

HardenedBSD/src 875a178. Makefile.inc1, sys/compat/linuxkpi/common/include/linux pwm.h

Merge remote-tracking branch 'origin/hardened/current/master' into hardened/current/cross-dso-cfi
DeltaFile
+49-0usr.sbin/periodic/etc/security/120.hardenedmtree
+0-47usr.sbin/periodic/etc/security/120.chkfileperm
+6-0Makefile.inc1
+6-0sys/compat/linuxkpi/common/include/linux/pwm.h
+3-3usr.sbin/periodic/periodic.conf
+5-0tests/sys/kern/coredump_phnum_test.sh
+69-504 files not shown
+78-5210 files

HardenedBSD/src cfa6bc8sys/compat/linuxkpi/common/include/linux pwm.h mmzone.h, tests/sys/kern coredump_phnum_test.sh

Merge branch 'freebsd/current/main' into hardened/current/master
DeltaFile
+6-0sys/compat/linuxkpi/common/include/linux/pwm.h
+5-0tests/sys/kern/coredump_phnum_test.sh
+3-0sys/compat/linuxkpi/common/include/linux/mmzone.h
+14-03 files

HardenedBSD/src 9c52326. Makefile.inc1, etc Makefile

Merge branch 'hardened/current/mirror_hardened_mtree' into 'hardened/current/master'

HBSD: apply BSD.hardened.dist during 'make' in /usr/src

See merge request hardenedbsd/HardenedBSD!103
DeltaFile
+6-0Makefile.inc1
+2-1etc/Makefile
+8-12 files

HardenedBSD/src 8289d0c. ObsoleteFiles.inc, usr.sbin/periodic periodic.conf

Merge branch 'hardened/current/hardened_mtree' into 'hardened/current/master'

HBSD: rename periodic script chkfileperm as hardenedmtree

See merge request hardenedbsd/HardenedBSD!102
DeltaFile
+49-0usr.sbin/periodic/etc/security/120.hardenedmtree
+0-47usr.sbin/periodic/etc/security/120.chkfileperm
+3-3usr.sbin/periodic/periodic.conf
+3-0ObsoleteFiles.inc
+1-1usr.sbin/periodic/etc/security/Makefile
+56-515 files

HardenedBSD/src f339897sys/compat/linuxkpi/common/include/linux mmzone.h

linuxkpi: Define `MAX_PAGE_ORDER` and `NR_PAGE_ORDERS`

The TTM component of the DRM drivers started to use the latter in Linux
6.8.

Reviewed by:    emaste
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D49387
DeltaFile
+3-0sys/compat/linuxkpi/common/include/linux/mmzone.h
+3-01 files

HardenedBSD/src 0b02cfbsys/compat/linuxkpi/common/include/linux pwm.h

linuxkpi: Add `pwm_apply_might_sleep()`

The i915 DRM driver started to use it in Linux 6.8.

Reviewed by:    emaste
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D49386
DeltaFile
+6-0sys/compat/linuxkpi/common/include/linux/pwm.h
+6-01 files

HardenedBSD/src 5df8159tests/sys/kern coredump_phnum_test.sh

tests: xfail readelf phdr count test w/LLVM binutils

LLVM readelf does not (yet) support phdr counts that overflow 16 bits.
Temporarily xfail this test until fixed; see upstream issue 132216 for
more details https://github.com/llvm/llvm-project/issues/132216.

PR:             285547
Reported by:    markj
Reviewed by:    dim, markj
Sponsored by:   The FreeBSD Foundation
Fixes: 1cae7121c667 ("Enable LLVM_BINUTILS by default")
Differential Revision: https://reviews.freebsd.org/D49561
DeltaFile
+5-0tests/sys/kern/coredump_phnum_test.sh
+5-01 files

HardenedBSD/src be6c537sys/net pfvar.h, sys/netpfil/pf pf.c

Merge remote-tracking branch 'origin/hardened/current/master' into hardened/current/cross-dso-cfi
DeltaFile
+104-104sys/netpfil/pf/pf.c
+2-1sys/net/pfvar.h
+106-1052 files

HardenedBSD/src ae63cc6sys/net pfvar.h, sys/netpfil/pf pf.c

Merge branch 'freebsd/current/main' into hardened/current/master
DeltaFile
+104-104sys/netpfil/pf/pf.c
+2-1sys/net/pfvar.h
+106-1052 files

HardenedBSD/src 27f70efsys/net pfvar.h, sys/netpfil/pf pf.c

pf: Use a macro to get the hash row in pf_find_state_byid()

This seems a bit preferable to open-coding it.  No functional change
intended.

Reviewed by:    kp, glebius
MFC after:      2 weeks
Differential Revision:  https://reviews.freebsd.org/D49518
DeltaFile
+2-1sys/net/pfvar.h
+1-1sys/netpfil/pf/pf.c
+3-22 files

HardenedBSD/src 674701esys/netpfil/pf pf.c

pf: Remove some state pointer indirection

Several subroutines take a pointer to a pointer to a pf state, but never
modify the input pointer.  As in commit 9f9cf83f114a, let's remove the
indirection, making the code easier to read.  No functional change
intended.

Reviewed by:    kp, glebius
MFC after:      2 weeks
Differential Revision:  https://reviews.freebsd.org/D49519
DeltaFile
+103-103sys/netpfil/pf/pf.c
+103-1031 files

HardenedBSD/src 261f13bsys/dev/ixgbe ixgbe_mbx.c, sys/powerpc/powerpc trap.c

Merge remote-tracking branch 'origin/hardened/current/master' into hardened/current/cross-dso-cfi
DeltaFile
+12-2sys/dev/ixgbe/ixgbe_mbx.c
+1-1sys/powerpc/powerpc/trap.c
+13-32 files

HardenedBSD/src 950679esys/dev/ixgbe ixgbe_mbx.c, sys/powerpc/powerpc trap.c

Merge branch 'freebsd/current/main' into hardened/current/master
DeltaFile
+12-2sys/dev/ixgbe/ixgbe_mbx.c
+1-1sys/powerpc/powerpc/trap.c
+13-32 files

HardenedBSD/src 23a6a48share/man/man5 intro.5, sys/ufs/ffs ffs_subr.c ffs_vfsops.c

Merge branch 'freebsd/14-stable/main' into hardened/14-stable/master
DeltaFile
+70-42sys/ufs/ffs/ffs_subr.c
+16-26sys/ufs/ffs/ffs_vfsops.c
+27-8share/man/man5/intro.5
+113-763 files

HardenedBSD/src 3cdf03dshare/man/man5 intro.5

intro.5: Crossreference ascii(7)

Since the beginning, Unix has included an ASCII chart. Over the last
half a century to this day, the most common format for lexographical
organization in files is according to ASCII. Consistency is maintainable
and for that reason, crossreference ascii(7) promenently in the
introduction to the File Formats Manual. Additionally, this demonstrates
the often softer style of bullet lists in the manual tradition.

PR:             248562
MFC after:      3 days
Reviewed by:    mhorne
Approved by:    mhorne (mentor)
Pull Request:   https://github.com/freebsd/freebsd-src/pull/1534

(cherry picked from commit a6175f28da7018ba9f824f48fe6db732bd9cb501)
DeltaFile
+4-3share/man/man5/intro.5
+4-31 files

HardenedBSD/src 0d35e63share/man/man5 intro.5

intro.5: More verbose introductory sentence

Explain a little about everything is a file,
matching the style of earlier intro pages.

PR:             248562
MFC after:      3 days
Approved by:    mhorne (mentor)
Reviewed by:    imp, mhorne, Lexi Winter <lexi at le-fay.org>
Pull Request:   https://github.com/freebsd/freebsd-src/pull/1534

(cherry picked from commit 37508388d066826d0a36b5ec646c95a9ffb00d28)
DeltaFile
+4-1share/man/man5/intro.5
+4-11 files

HardenedBSD/src bb28ea4share/man/man5 intro.5

intro.5: Import description table from OpenBSD

Looking around at how everyone else is doing it, this list seems nearly
perfect to me and we should just import it from them. I have added "and
streams" because we have some explanations of those in this section too.

PR:             248562
MFC after:      3 days
Obtained from:  OpenBSD
Approved by:    mhorne (mentor)
Reviewed by:    imp, mhorne, Lexi Winter <lexi at le-fay.org>
Pull Request:   https://github.com/freebsd/freebsd-src/pull/1534

(cherry picked from commit 26ec376536622e8fec8f40847aa9b2d1121d585d)
DeltaFile
+10-1share/man/man5/intro.5
+10-11 files

HardenedBSD/src 342fa74share/man/man5 intro.5

intro.5: Add local to files, minor maintenence

New users are sometimes confused about the difference between /etc/ and
/usr/local/etc. Explain this in the manual as we did in intro(1). Link
hier(7) which now lists base system configuration files in /etc/. Add a
section number to HISTORY for clarity.

PR:             248562
MFC after:      3 days
Approved by:    mhorne (mentor)
Reviewed by:    imp, mhorne, Lexi Winter <lexi at le-fay.org>
Pull Request:   https://github.com/freebsd/freebsd-src/pull/1534

(cherry picked from commit 8d65152cbfc8861f6920846dea6f540c673ab7b6)
DeltaFile
+13-7share/man/man5/intro.5
+13-71 files

HardenedBSD/src ae15f8csys/ufs/ffs ffs_subr.c ffs_vfsops.c

Get consistent updates for UFS superblocks.
Formatting and style cleanups.

Differential Revision: https://reviews.freebsd.org/D49276
Sponsored-by: Netflix

(cherry picked from commit c2cd605e8c8a15e545dfd3e50aef2f660d460b30)
(cherry picked from commit 16649530b7be02a61a32b34d56e6e937734cd247)
DeltaFile
+70-42sys/ufs/ffs/ffs_subr.c
+16-26sys/ufs/ffs/ffs_vfsops.c
+86-682 files

HardenedBSD/src 7a49072sys/powerpc/powerpc trap.c

powerpc/trap: Change prediction of NOFAULTING in trap_pfault()

This was probably intended to match the amd64 check, but that tests
NOFAULTING against non-zero, while this checks against 0.  We're most
likely to end up in this function when faulting is allowed, so
predict_true is the better option.
DeltaFile
+1-1sys/powerpc/powerpc/trap.c
+1-11 files

HardenedBSD/src 1580f8dsys/dev/ixgbe ixgbe_mbx.c

ixgbe: fix mailbox ack handling

Check if CTS bit is set in the mailbox message before waiting for ACK.
Otherwise ACK will never be received causing the function to timeout. Add
a note for ixgbe_write_mbx that it should be called while holding a lock.

Fixes: 6d243d2 ("net/ixgbe/base: introduce new mailbox API")
Cc: stable at dpdk.org

Signed-off-by: Norbert Ciosek <norbertx.ciosek at intel.com>
Signed-off-by: Anatoly Burakov <anatoly.burakov at intel.com>
Acked-by: Bruce Richardson <bruce.richardson at intel.com>

Obtained from:  DPDK (1f119e4)
MFC after:      1 week
DeltaFile
+12-2sys/dev/ixgbe/ixgbe_mbx.c
+12-21 files