HardenedBSD/src bec9dbfsys/compat/linuxkpi/common/src linux_80211.c, sys/contrib/dev/iwlwifi/mld agg.c

Merge remote-tracking branch 'origin/hardened/current/master' into hardened/current/cross-dso-cfi
DeltaFile
+9-2sys/compat/linuxkpi/common/src/linux_80211.c
+4-6sys/powerpc/aim/mmu_oea64.c
+8-0sys/contrib/dev/iwlwifi/mld/agg.c
+4-4usr.sbin/unbound/setup/local-unbound-setup.sh
+2-3sys/powerpc/booke/pmap_64.c
+2-3sys/powerpc/aim/mmu_oea.c
+29-182 files not shown
+32-228 files

HardenedBSD/src 3e7c1b1sys/compat/linuxkpi/common/src linux_80211.c, sys/contrib/dev/iwlwifi/mld agg.c

Merge branch 'freebsd/current/main' into hardened/current/master
DeltaFile
+9-2sys/compat/linuxkpi/common/src/linux_80211.c
+4-6sys/powerpc/aim/mmu_oea64.c
+4-4usr.sbin/unbound/setup/local-unbound-setup.sh
+8-0sys/contrib/dev/iwlwifi/mld/agg.c
+2-3sys/powerpc/booke/pmap_32.c
+2-3sys/powerpc/aim/mmu_oea.c
+29-182 files not shown
+32-228 files

HardenedBSD/src 96c73fdsys/cam/nvme nvme_da.c, sys/dev/nvd nvd.c

Merge branch 'freebsd/15-stable/main' into hardened/15-stable/main
DeltaFile
+51-25sys/cam/nvme/nvme_da.c
+44-1sys/dev/nvd/nvd.c
+19-9sys/dev/nvme/nvme_sim.c
+12-2sys/dev/nvme/nvme_ctrlr.c
+6-3sys/dev/nvme/nvme_ns.c
+5-2sys/dev/nvme/nvme.h
+137-421 files not shown
+139-427 files

HardenedBSD/src 9b01028sys/powerpc/aim mmu_oea64.c mmu_oea.c, sys/powerpc/booke pmap_64.c pmap_32.c

powerpc: Don't use cache to zero pages

pmap_zero_page() may be called on uncached pages, so using the cache to
zero uncached pages may trigger a fault.

MFC after:      2 weeks
DeltaFile
+4-6sys/powerpc/aim/mmu_oea64.c
+2-3sys/powerpc/booke/pmap_64.c
+2-3sys/powerpc/booke/pmap_32.c
+2-3sys/powerpc/aim/mmu_oea.c
+10-154 files

HardenedBSD/src b7ffac0sys/dev/nvme nvme_sim.c

nvme_sim: signal namespace depature

Signal when the namespace is gone so we can tear down the disk when a
nvme drive is removed.

Reviewed by:            imp
Differential Revision:  https://reviews.freebsd.org/D33032

(cherry picked from commit 4640f5008922c5b189d2f7b63edf73300277e6df)
DeltaFile
+19-9sys/dev/nvme/nvme_sim.c
+19-91 files

HardenedBSD/src 96a7ed1sys/dev/nvd nvd.c

nvd: handle namespace changes

Signal the new media size when the namespace changes size.

Reviewed by:            imp
Differential Revision:  https://reviews.freebsd.org/D33032

(cherry picked from commit bd769e73d8f1d5141b1c2eb2322b4c6caed5d9e0)
DeltaFile
+44-1sys/dev/nvd/nvd.c
+44-11 files

HardenedBSD/src 9a465b3sys/cam/nvme nvme_da.c nvme_xpt.c

nda: React to namespace change events

Register for AC_GETDEV_CHANGED. When we receive a namespace
notification, we only create a new device if it was unconfigured. If it
was configured, generate this async event. Rely on the fact that we
reconstruct namespace to just get the data from the identify data and
call disk_resised.

Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D33032

(cherry picked from commit 86d3ec359a56d1b5d015718bd19ef4bda681a032)
DeltaFile
+20-9sys/cam/nvme/nvme_da.c
+2-0sys/cam/nvme/nvme_xpt.c
+22-92 files

HardenedBSD/src 31412fdsys/cam/nvme nvme_da.c

nvme: Refactor geom setting to function.

Refactor setting of geometry for the disk to its own function. No
functional changes.

Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D33032

(cherry picked from commit dffd882d12d2a71aca464f48209ec9ae6f393b15)
DeltaFile
+31-16sys/cam/nvme/nvme_da.c
+31-161 files

HardenedBSD/src fe6ee00sys/dev/nvme nvme_ctrlr.c nvme_ns.c

nvme: Notify namespace changes better

When we get a namespace notification, we have to reconstrut the
namespace to get the new identification data from the namespace. For
each namespace in the AEN, we will reconstrict it before we call the
notification. We also flag it as changed for the duration of the change
callback (prior versions of the patch needed to keep track, but we no
longer do, so this bit may be removed). Note when we've seen the
namespace so we can notify when it goes away.

Co-authored-by: imp
Differential Revision: https://reviews.freebsd.org/D33032

(cherry picked from commit 20e94950c54e398049396647da36b9e2c3b639c1)
DeltaFile
+11-1sys/dev/nvme/nvme_ctrlr.c
+6-3sys/dev/nvme/nvme_ns.c
+5-2sys/dev/nvme/nvme.h
+22-63 files

HardenedBSD/src fd73781sys/dev/nvme nvme_ctrlr.c

nvme: Fix backwards sense of error condition

b21e67875bf0c tested for the good condition, not the error condition, so
we'd never do anything else in this function. This was causing certain
logging not to happen, and also prevented forthcoming namespace size
change code from working as well.

Fixes: b21e67875bf0c
Sponsored by: Netflix
(cherry picked from commit 27481c268916b0790c7ad16202a5b012625ce1a8)
DeltaFile
+1-1sys/dev/nvme/nvme_ctrlr.c
+1-11 files

HardenedBSD/src d1180basys/compat/linuxkpi/common/src linux_80211.c

LinuxKPI: 802.11: initialize a backpointer on the link_sta

iwlwifi/mld uses the back pointer in iwl_mld_link_sta_from_mac80211().
Initialize it to make BE200 cards work again.

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
PR;             290808
DeltaFile
+1-0sys/compat/linuxkpi/common/src/linux_80211.c
+1-01 files

HardenedBSD/src 9040277sys/contrib/dev/iwlwifi/mld agg.c

iwlwifi/mld: only get tid after checking that it is a dataqos frame

Like we did for mvm, only get the tid after all the other checks are
done by the function in order to not trigger an assert.  Linux will
likely return a random value there which later is not used as the
driver does an early return.  In LinuxKPI we do check that the frame
assumptions hold up, which does not go so well for a random frame.

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
PR:             290808
DeltaFile
+8-0sys/contrib/dev/iwlwifi/mld/agg.c
+8-01 files

HardenedBSD/src 90b6a9asys/compat/linuxkpi/common/src linux_80211.c

LinuxKPI: 802.11: implement mtx support for ieee80211_iterate_interfaces

Implement the lockdep_assert_wiphy call for
ieee80211_iterate_active_interfaces_mtx() to avoid a warning when
used and to make sure callers comply with assumptions.

Leave an "IMPROVE" note as we can likely switch another of the multiple
callers to RCU.

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
DeltaFile
+8-2sys/compat/linuxkpi/common/src/linux_80211.c
+8-21 files

HardenedBSD/src 0021f70sys/compat/linuxkpi/common/include/net mac80211.h

LinuxKPI: 802.11: use a _check rather than a _protected version for linksta

Switch to link_sta_dereference_check rather than _protected to access
the value.  The actual problem we hit was elsewhere though.

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
DeltaFile
+1-1sys/compat/linuxkpi/common/include/net/mac80211.h
+1-11 files

HardenedBSD/src 0628400usr.sbin/unbound/setup local-unbound-setup.sh

local-unbound: Read a tab separated resolv.conf

Use [[:space:]] rather than a white space character to delimit the keys
and the values in the resolv.conf file.

PR:             236079
Reviewed by:    des
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D53811
DeltaFile
+4-4usr.sbin/unbound/setup/local-unbound-setup.sh
+4-41 files

HardenedBSD/src e367917sys/cam/nvme nvme_da.c, sys/dev/nvd nvd.c

Merge remote-tracking branch 'origin/hardened/current/master' into hardened/current/cross-dso-cfi
DeltaFile
+51-25sys/cam/nvme/nvme_da.c
+44-1sys/dev/nvd/nvd.c
+19-9sys/dev/nvme/nvme_sim.c
+12-2sys/dev/nvme/nvme_ctrlr.c
+6-3sys/dev/nvme/nvme_ns.c
+5-2sys/dev/nvme/nvme.h
+137-425 files not shown
+153-4511 files

HardenedBSD/src 8335780sys/cam/nvme nvme_da.c, sys/dev/nvd nvd.c

Merge branch 'freebsd/current/main' into hardened/current/master
DeltaFile
+51-25sys/cam/nvme/nvme_da.c
+44-1sys/dev/nvd/nvd.c
+19-9sys/dev/nvme/nvme_sim.c
+12-2sys/dev/nvme/nvme_ctrlr.c
+6-3sys/dev/nvme/nvme_ns.c
+5-2sys/dev/nvme/nvme.h
+137-422 files not shown
+145-438 files

HardenedBSD/src bd769e7sys/dev/nvd nvd.c

nvd: handle namespace changes

Signal the new media size when the namespace changes size.

Reviewed by:            imp
Differential Revision:  https://reviews.freebsd.org/D33032
DeltaFile
+44-1sys/dev/nvd/nvd.c
+44-11 files

HardenedBSD/src 4640f50sys/dev/nvme nvme_sim.c

nvme_sim: signal namespace depature

Signal when the namespace is gone so we can tear down the disk when a
nvme drive is removed.

Reviewed by:            imp
Differential Revision:  https://reviews.freebsd.org/D33032
DeltaFile
+19-9sys/dev/nvme/nvme_sim.c
+19-91 files

HardenedBSD/src dffd882sys/cam/nvme nvme_da.c

nvme: Refactor geom setting to function.

Refactor setting of geometry for the disk to its own function. No
functional changes.

Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D33032
DeltaFile
+31-16sys/cam/nvme/nvme_da.c
+31-161 files

HardenedBSD/src 86d3ec3sys/cam/nvme nvme_da.c nvme_xpt.c

nda: React to namespace change events

Register for AC_GETDEV_CHANGED. When we receive a namespace
notification, we only create a new device if it was unconfigured. If it
was configured, generate this async event. Rely on the fact that we
reconstruct namespace to just get the data from the identify data and
call disk_resised.

Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D33032
DeltaFile
+20-9sys/cam/nvme/nvme_da.c
+2-0sys/cam/nvme/nvme_xpt.c
+22-92 files

HardenedBSD/src 20e9495sys/dev/nvme nvme_ctrlr.c nvme_ns.c

nvme: Notify namespace changes better

When we get a namespace notification, we have to reconstrut the
namespace to get the new identification data from the namespace. For
each namespace in the AEN, we will reconstrict it before we call the
notification. We also flag it as changed for the duration of the change
callback (prior versions of the patch needed to keep track, but we no
longer do, so this bit may be removed). Note when we've seen the
namespace so we can notify when it goes away.

Co-authored-by: imp
Differential Revision: https://reviews.freebsd.org/D33032
DeltaFile
+11-1sys/dev/nvme/nvme_ctrlr.c
+6-3sys/dev/nvme/nvme_ns.c
+5-2sys/dev/nvme/nvme.h
+22-63 files

HardenedBSD/src 27481c2sys/dev/nvme nvme_ctrlr.c

nvme: Fix backwards sense of error condition

b21e67875bf0c tested for the good condition, not the error condition, so
we'd never do anything else in this function. This was causing certain
logging not to happen, and also prevented forthcoming namespace size
change code from working as well.

Fixes: b21e67875bf0c
Sponsored by: Netflix
DeltaFile
+1-1sys/dev/nvme/nvme_ctrlr.c
+1-11 files

HardenedBSD/src 6d0ee20share/mk bsd.sys.mk

HBSD: Use the right Makefile variables

The -fno-delete-null-pointer-checks is not a warning, but rather a
normal compiler flag.

Signed-off-by:  Shawn Webb <shawn.webb at hardenedbsd.org>
MFC-to:         15-STABLE
MFC-to:         14-STABLE
Fixes:          ca0a80281e4ee936f0bf9df8f40448d37cd6667d
DeltaFile
+2-2share/mk/bsd.sys.mk
+2-21 files

HardenedBSD/src 5d53462sys/dev/iicbus iichid.c

iichid: The IICHID spec defines the response to the RESET command as two bytes of zeros.

Our recent changes to iichid.c has caused us to attempt to read a
full REPORT instead, and at least one keyboard hangs solid when we
do that.

This patch changes us to be spec-compliant.

Differential Revision: https://reviews.freebsd.org/D53803
MFC after: 1 day
Approved by: re(ccperciva)
DeltaFile
+6-1sys/dev/iicbus/iichid.c
+6-11 files

HardenedBSD/src ca0a802contrib/diff/src diff3.c, lib/clang/liblldb LLDBWrapLua.cpp

HBSD: Add various C/C++ hardening flags

One common optimization is to remove NULL pointer checks when the
compiler thinks it's not truly needed. We want to keep those checks in
place (-fno-delete-null-pointer-checks).

Another C/C++ compiler flag enabled by this commit is to check for
potential format string vulnerabilities (-Werror=format-security).

Signed-off-by:  Shawn Webb <shawn.webb at hardenedbsd.org>
MFC-to:         15-STABLE
MFC-to:         14-STABLE
DeltaFile
+6-0share/mk/bsd.sys.mk
+1-1contrib/diff/src/diff3.c
+1-1lib/clang/liblldb/LLDBWrapLua.cpp
+8-23 files

HardenedBSD/src 9c8dbf3contrib/diff/lib getopt.h, libexec/rc rc.subr

Merge remote-tracking branch 'origin/hardened/current/master' into hardened/current/cross-dso-cfi
DeltaFile
+0-176contrib/diff/lib/getopt.h
+158-0usr.sbin/setaudit/setaudit.c
+134-0sys/dev/fdt/simplebus.c
+68-46libexec/rc/rc.subr
+88-0usr.sbin/setaudit/setaudit.8
+85-0sys/arm64/arm64/nexus.c
+533-22215 files not shown
+628-24921 files

HardenedBSD/src d7cf7ebcontrib/diff/lib getopt.h, libexec/rc rc.subr

Merge branch 'freebsd/current/main' into hardened/current/master
DeltaFile
+0-176contrib/diff/lib/getopt.h
+158-0usr.sbin/setaudit/setaudit.c
+134-0sys/dev/fdt/simplebus.c
+68-46libexec/rc/rc.subr
+88-0usr.sbin/setaudit/setaudit.8
+85-0sys/arm64/arm64/nexus.c
+533-22215 files not shown
+628-24921 files

HardenedBSD/src bc7bd9bcddl/contrib/opensolaris/cmd/dtrace dtrace.1, share/man/man4 geom_zero.4 dtrace_callout_execute.4

Merge branch 'freebsd/14-stable/main' into hardened/14-stable/master
DeltaFile
+174-0share/man/man4/geom_zero.4
+68-0share/man/man4/dtrace_callout_execute.4
+3-1share/man/man9/callout.9
+3-0share/man/man4/Makefile
+2-1share/man/man4/zero.4
+1-0cddl/contrib/opensolaris/cmd/dtrace/dtrace.1
+251-26 files

HardenedBSD/src 786ff1bshare/man/man4 geom_zero.4, share/man/man7 d.7

Merge branch 'freebsd/15-stable/main' into hardened/15-stable/main
DeltaFile
+174-0share/man/man4/geom_zero.4
+36-125sys/amd64/vmm/vmm.c
+124-0share/man/man7/d.7
+15-91sys/arm64/vmm/vmm.c
+6-86sys/riscv/vmm/vmm.c
+83-8sys/dev/vmm/vmm_dev.c
+438-31020 files not shown
+578-38526 files