HardenedBSD/src c1f5f72lib/libc/gen posix_spawn.c

HBSD: Fix build error caused by mismerge

Signed-off-by:  Shawn Webb <shawn.webb at hardenedbsd.org>
DeltaFile
+2-0lib/libc/gen/posix_spawn.c
+2-01 files

HardenedBSD/src 11fae7asys/compat/freebsd32 freebsd32.h, sys/dev/hpt27xx hpt27xx_osm_bsd.c

Merge remote-tracking branch 'origin/hardened/current/master' into hardened/current/cross-dso-cfi
DeltaFile
+49-7sys/kern/subr_devstat.c
+27-0sys/compat/freebsd32/freebsd32.h
+3-7sys/dev/hptrr/hptrr_osm_bsd.c
+3-7sys/dev/hpt27xx/hpt27xx_osm_bsd.c
+3-7sys/dev/hptnr/hptnr_osm_bsd.c
+5-3sys/sys/module.h
+90-311 files not shown
+91-337 files

HardenedBSD/src d432d87sys/compat/freebsd32 freebsd32.h, sys/dev/hpt27xx hpt27xx_osm_bsd.c

Merge branch 'freebsd/current/main' into hardened/current/master
DeltaFile
+49-7sys/kern/subr_devstat.c
+27-0sys/compat/freebsd32/freebsd32.h
+3-7sys/dev/hptrr/hptrr_osm_bsd.c
+3-7sys/dev/hpt27xx/hpt27xx_osm_bsd.c
+3-7sys/dev/hptnr/hptnr_osm_bsd.c
+5-3sys/sys/module.h
+90-311 files not shown
+91-337 files

HardenedBSD/src 2cbb4c5contrib/llvm-project/libcxx/include inttypes.h, sys/arm/broadcom/bcm2835 files.bcm283x

Merge branch 'freebsd/15-stable/main' into hardened/15-stable/main
DeltaFile
+9-2contrib/llvm-project/libcxx/include/inttypes.h
+3-0sys/conf/kern.mk
+1-1sys/conf/files.arm64
+1-1sys/arm/broadcom/bcm2835/files.bcm283x
+1-1sys/dev/mxge/if_mxge.c
+2-0sys/modules/iwlwifi/Makefile
+17-52 files not shown
+20-68 files

HardenedBSD/src a11d132sys/compat/freebsd32 freebsd32.h, sys/kern subr_devstat.c

devstat: Provide 32-bit compatibility

If a 32-bit process running on a 64-bit kernel requests kern.devstat.all,
translate each struct devstat to its 32-bit equivalent before copying it
out.

Also fix a bug where an early error would be ignored if there were no
devices to report.

MFC after:      1 week
Reviewed by:    kib
Differential Revision:  https://reviews.freebsd.org/D54591
DeltaFile
+49-7sys/kern/subr_devstat.c
+27-0sys/compat/freebsd32/freebsd32.h
+76-72 files

HardenedBSD/src c29e051sys/dev/hpt27xx hpt27xx_osm_bsd.c, sys/dev/hptmv entry.c

hpt: remove unnecessary macro expansion hacks

Reviewed by:    imp
Differential Revision:  https://reviews.freebsd.org/D54875
DeltaFile
+3-7sys/dev/hptrr/hptrr_osm_bsd.c
+3-7sys/dev/hpt27xx/hpt27xx_osm_bsd.c
+3-7sys/dev/hptnr/hptnr_osm_bsd.c
+1-2sys/dev/hptmv/entry.c
+10-234 files

HardenedBSD/src 6ecaa8dsys/sys module.h

sys/module.h: allow MODULE_DEPEND to accept macros

Allow MODULE_DEPEND to accept macros by adding an extra level of
indirection. Some drivers in the tree actually depend on this being the
case.

Reviewed by:    imp
Differential Revision:  https://reviews.freebsd.org/D54874
DeltaFile
+5-3sys/sys/module.h
+5-31 files

HardenedBSD/src 5080b34sys/arm/broadcom/bcm2835 files.bcm283x, sys/conf kern.mk files.arm64

vchiq: fix build with clang 21

When compiling vchiq with clang 21, the following -Werror warning is
produced:

    sys/contrib/vchiq/interface/vchiq_arm/vchiq_arm.c:728:27: error: default initialization of an object of type 'VCHIQ_QUEUE_MESSAGE32_T' with const member leaves the object uninitialized [-Werror,-Wdefault-const-init-field-unsafe]
      728 |                 VCHIQ_QUEUE_MESSAGE32_T args32;
          |                                         ^
    sys/contrib/vchiq/interface/vchiq_arm/vchiq_ioctl.h:151:40: note: member 'elements' declared 'const' here
      151 |         const /*VCHIQ_ELEMENT_T * */ uint32_t elements;
          |                                               ^

While the warning is formally correct, the 'args32' object is
immediately initialized after its declaration. Therefore, suppress the
warning.

MFC after:      3 days

(cherry picked from commit b39662fc388678db2b7b5fa3c900205252d15b3b)
DeltaFile
+3-0sys/conf/kern.mk
+1-1sys/conf/files.arm64
+1-1sys/arm/broadcom/bcm2835/files.bcm283x
+5-23 files

HardenedBSD/src 0b52fb5sys/dev/mxge if_mxge.c

mxge(4): avoid clang 21 warning in NO-IP configuration

Building the LINT-NOIP kernel on amd64 with clang 21 results in a
-Werror warning similar to:

    sys/dev/mxge/if_mxge.c:1846:44: error: variable 'sum' is uninitialized when passed as a const pointer argument here [-Werror,-Wuninitialized-const-pointer]
     1846 |                     cksum_offset, sizeof(sum), (caddr_t)&sum);
          |                                                          ^~~

Indeed, if both `INET` and `INET6` are undefined, `sum` is never
initialized. Initialize it to zero to silence the warning.

Reviewed by:    jhibbits
MFC after:      3 days
Differential Revision: https://reviews.freebsd.org/D54730

(cherry picked from commit 74cac745fe302b26ad22114f60735c8b73e90571)
DeltaFile
+1-1sys/dev/mxge/if_mxge.c
+1-11 files

HardenedBSD/src cff26b9contrib/llvm-project/libcxx/include inttypes.h

libc++ inttypes.h: define __STDC_CONSTANT_MACROS and __STDC_LIMIT_MACROS

Before transitively including the base version of inttypes.h, define
__STDC_CONSTANT_MACROS and __STDC_LIMIT_MACROS, because the base
inttypes.h directly includes sys/stdint.h, instead of going through the
'regular' stdint.h.

The libc++ version of the latter does define those macros, to ensure
things like UINT64_C() and SIZE_MAX are defined even in C++98 or C++03.

MFC after:      3 days

(cherry picked from commit 3cdb6c9d92ecf479a0df338267f3f844ef6feeb2)
DeltaFile
+9-2contrib/llvm-project/libcxx/include/inttypes.h
+9-21 files

HardenedBSD/src 027743asys/modules/miiproxy Makefile

modules: miiproxy: Fix standalone build

The fix is made in main branch [1] by imp but it appears to be done
incidentally. Let's do it directly for stable/15 branch.

[1] 8e985774117d kern: Remove needless kern.opts.mk
DeltaFile
+1-1sys/modules/miiproxy/Makefile
+1-11 files

HardenedBSD/src e09f36csys/modules/iwlwifi Makefile, sys/modules/rtw89 Makefile

modules: iwlwifi/rtw89 allow standalone build

The KERN_OPTS:MDEV_ACPI checks are fine for as long as we are building
modules along the kernel.  If one wants to just build the module
standalone out of the module directory this would fail.
Add the missing include for kmod.opts.mk (as was done for tcp
in 1319a76179682).

Sponsored by:   The FreeBSD Foundation
Reported by:    Tassilo Philipp (tphilipp potion-studios.com)
Fixes:  f5a77dc8f8df ("improve module Makefile dependency on ACPI")
Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D54769

(cherry picked from commit 0f0b833e4db6d450b39de0365b657936f5a6993b)
DeltaFile
+2-0sys/modules/iwlwifi/Makefile
+2-0sys/modules/rtw89/Makefile
+4-02 files

HardenedBSD/src bfa93d2lib/libc/gen posix_spawnattr_getexecfd_np.3, lib/libsys pdfork.2

Merge remote-tracking branch 'origin/hardened/current/master' into hardened/current/cross-dso-cfi
DeltaFile
+278-127sys/kern/kern_exit.c
+68-26sys/kern/kern_fork.c
+81-8lib/libsys/pdfork.2
+86-0lib/libc/gen/posix_spawnattr_getexecfd_np.3
+68-0sys/kern/systrace_args.c
+68-0sys/compat/freebsd32/freebsd32_systrace_args.c
+649-16155 files not shown
+1,117-18961 files

HardenedBSD/src 556161csbin/camcontrol camcontrol.c, sys/cam/scsi scsi_all.c scsi_all.h

Merge branch 'freebsd/current/main' into hardened/current/master
DeltaFile
+34-0sys/cam/scsi/scsi_all.c
+4-0sys/cam/scsi/scsi_all.h
+1-1sys/dev/ufshci/ufshci_sim.c
+0-2sys/cam/scsi/scsi_cd.c
+0-1sbin/camcontrol/camcontrol.c
+0-1sys/dev/mpr/mpr_sas_lsi.c
+39-52 files not shown
+39-78 files

HardenedBSD/src 8ef8c6asys/cam cam_periph.c, sys/cam/scsi scsi_all.c scsi_all.h

cam/scsi: Restore scsi_start_stop() and add scsi_start_stop_pc()

Revert the argument change that broke libcam in 8c35de49 and move
power_condition support to scsi_start_stop_pc().

Reported by:            imp
Reviewed By:            #cam, imp (mentor)
Sponsored by:           Samsung Electronics
Differential Revision:  https://reviews.freebsd.org/D54822
DeltaFile
+34-0sys/cam/scsi/scsi_all.c
+4-0sys/cam/scsi/scsi_all.h
+0-2sys/cam/scsi/scsi_cd.c
+1-1sys/dev/ufshci/ufshci_sim.c
+0-1sys/dev/mps/mps_sas_lsi.c
+0-1sys/cam/cam_periph.c
+39-52 files not shown
+39-78 files

HardenedBSD/src 7c49c67lib/libc/gen posix_spawn.c, sys/kern kern_fork.c

HBSD: Resolve merge conflicts

Signed-off-by:  Shawn Webb <shawn.webb at hardenedbsd.org>
DeltaFile
+1-6lib/libc/gen/posix_spawn.c
+0-3sys/kern/kern_fork.c
+1-92 files

HardenedBSD/src 0662f0dlib/libc/gen posix_spawnattr_getexecfd_np.3, lib/libsys pdfork.2

Merge remote-tracking branch 'origin/freebsd/current/main' into hardened/current/master

Conflicts:
        lib/libc/gen/posix_spawn.c (unresolved)
        sys/kern/kern_fork.c (unresolved)
DeltaFile
+278-127sys/kern/kern_exit.c
+71-26sys/kern/kern_fork.c
+81-8lib/libsys/pdfork.2
+86-0lib/libc/gen/posix_spawnattr_getexecfd_np.3
+68-0sys/kern/systrace_args.c
+68-0sys/compat/freebsd32/freebsd32_systrace_args.c
+652-16147 files not shown
+1,084-18053 files

HardenedBSD/src 9d71290sys/compat/linuxkpi/common/src linux_current.c linux_shmemfs.c, sys/dev/asmc asmc.c

Merge branch 'freebsd/15-stable/main' into hardened/15-stable/main
DeltaFile
+55-0sys/dev/asmc/asmc.c
+6-6sys/dev/iicbus/adc/ads111x.c
+2-8sys/compat/linuxkpi/common/src/linux_current.c
+5-5sys/dev/isl/isl.c
+5-5sys/dev/jme/if_jme.c
+3-4sys/compat/linuxkpi/common/src/linux_shmemfs.c
+76-285 files not shown
+83-3511 files

HardenedBSD/src 36daea2tools/build make_libc_exterr_cat_filenames.sh

exterr: Sort output from make_libc_exterr_cat_filenames.sh

Otherwise the script may permute the order of entries in the file since
find(1) output is not stable.

Reviewed by:    kib
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D54669

(cherry picked from commit bda6ed2ee4d8e836b1b2f8ca7a6ed72034e5f231)
DeltaFile
+1-1tools/build/make_libc_exterr_cat_filenames.sh
+1-11 files

HardenedBSD/src f1e1bfesys/compat/linuxkpi/common/src linux_shmemfs.c

linuxkpi: Clean up linux_shmem_file_setup() a bit

- Free the pointer that was returned by the allocator, instead of the
  address of the first member.  These will be equal in practice, but
  it's sketchy and won't work on CHERI with subobject bounds checking.
- Use an anonymous struct, there's no need to name it.

Reviewed by:    bz, brooks, emaste
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D54673

(cherry picked from commit 251662e5abdd85f5a83766b400e23c2ac5597fb9)
DeltaFile
+3-4sys/compat/linuxkpi/common/src/linux_shmemfs.c
+3-41 files

HardenedBSD/src a11b4f7sys/dev/asmc asmc.c

asmc: add per-fan manual mode control via sysctl

Add per-fan manual mode control via dev.asmc.0.fan.N.manual sysctl.

Apple SMCs support manual fan control via the FS! SMC key,
a 16-bit bitmask where each bit controls one fan (0=auto, 1=manual).

This change adds a new sysctl per fan:
    dev.asmc.0.fan.N.manual (0=auto, 1=manual)

When set to manual mode (1), the fan runs at the speed set via
dev.asmc.0.fan.N.targetspeed instead of automatic thermal control.  When
set to auto mode (0), the SMC controls fan speed automatically.

The FS! key was already defined in asmcvar.h but not accessible.
This exposes it for debugging, testing, and advanced fan control.

Implementation uses read-modify-write to allow independent control of
each fan without affecting others.

    [6 lines not shown]
DeltaFile
+55-0sys/dev/asmc/asmc.c
+55-01 files

HardenedBSD/src 6cbd76esys/dev/jme if_jme.c

jme: Convert driver to CTLFLAG_MPSAFE

Replace CTLFLAG_NEEDGIANT with CTLFLAG_MPSAFE for all interrupt
coalescing sysctls. The driver uses jme_mtx mutex for proper
synchronization and does not require Giant lock.

Sysctls converted:
- dev.jme.X.tx_coal_to (TX coalescing timeout)
- dev.jme.X.tx_coal_pkt (TX coalescing packet count)
- dev.jme.X.rx_coal_to (RX coalescing timeout)
- dev.jme.X.rx_coal_pkt (RX coalescing packet count)
- dev.jme.X.process_limit (max RX events to process)

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

(cherry picked from commit c2a55efd74cccb3d4e7b9037b240ad062c203bb8)
DeltaFile
+5-5sys/dev/jme/if_jme.c
+5-51 files

HardenedBSD/src fd6bccclib/libc/gen exterr_cat_filenames.h

exterr: Regenerate exterr_cat_filenames.h
DeltaFile
+1-1lib/libc/gen/exterr_cat_filenames.h
+1-11 files

HardenedBSD/src 72dc1a1sys/compat/linuxkpi/common/src linux_current.c

linuxkpi: Fix an error path in linux_alloc_current()

If the allocation fails we should free the task struct.

While here get rid of a couple of unnecessary assertions.

Reported by:    Kevin Day <kevin at your.org>
Reviewed by:    emaste
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D54671

(cherry picked from commit a4955b0143361900140df640d116891f047f5431)
DeltaFile
+2-8sys/compat/linuxkpi/common/src/linux_current.c
+2-81 files

HardenedBSD/src 4d9eaa0sys/arm64/iommu smmu.c

arm64/iommu: Fix a resource leak in smmu_domain_alloc()

We should free the allocated ASID if smmu_init_cd() fails.

Move the allocation of "domain" to simplify the first error path.

Reported by:    Kevin Day <kevin at your.org>
Reviewed by:    br
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D54676

(cherry picked from commit 6740cccb1eff2a0e1e6d451fa9676a21736937d2)
DeltaFile
+2-3sys/arm64/iommu/smmu.c
+2-31 files

HardenedBSD/src da714e3sys/dev/isl isl.c

isl: Convert driver to CTLFLAG_MPSAFE

Replace CTLFLAG_NEEDGIANT with CTLFLAG_MPSAFE for all light sensor
sysctls.  All of the sysctl handlers are serialized by a driver mutex.

Sysctls converted:
- dev.isl.X.als (ambient light sensor)
- dev.isl.X.ir (infrared sensor)
- dev.isl.X.prox (proximity sensor)
- dev.isl.X.resolution (sensor resolution)
- dev.isl.X.range (sensor range)

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

(cherry picked from commit 0672e0e38a08c580f723a02bb183344d8c7cee65)
DeltaFile
+5-5sys/dev/isl/isl.c
+5-51 files

HardenedBSD/src a3b3be5sys/compat/linuxkpi/common/src linux_firmware.c

linuxkpi: Avoid a potential null pointer dereference in an error path

Reported by:    Kevin Day <kevin at your.org>
Reviewed by:    bz, emaste
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D54672

(cherry picked from commit aa1eb623389008c95b897976f4d28a7fe0acd93c)
DeltaFile
+2-1sys/compat/linuxkpi/common/src/linux_firmware.c
+2-11 files

HardenedBSD/src 0e2e588sys/arm64/vmm/io vgic_v3.c

arm64/vgic_v3: Fix an inverted test when reading GICD_I<C|S>ENABLER

On read, these registers' fields return 1 if forwarding of the
corresponding interrupt is enabled, and 0 otherwise.  The test in
read_enabler() was inverted.

Reported by:    Kevin Day <kevin at your.org>
Reviewed by:    andrew
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D54678

(cherry picked from commit 6fef0c9ee64cea1f22b6a33a0c4dd39f605b7465)
DeltaFile
+1-1sys/arm64/vmm/io/vgic_v3.c
+1-11 files

HardenedBSD/src 714d5b3sys/dev/iicbus/adc ads111x.c

ads111x: Convert driver to CTLFLAG_MPSAFE

Replace CTLFLAG_NEEDGIANT with CTLFLAG_MPSAFE for all ADC sensor
sysctls.  All of the sysctl handlers are serialized by a driver mutex.

Sysctls converted:
- dev.ads111x.X.channelN.gain_index (PGA setting)
- dev.ads111x.X.channelN.rate_index (sample rate)
- dev.ads111x.X.channelN.voltage (sampled voltage)
- dev.ads111x.X.config (configuration register)
- dev.ads111x.X.lo_thresh (comparator low threshold)
- dev.ads111x.X.hi_thresh (comparator high threshold)

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

(cherry picked from commit 2c029cff5ba3716757646a2d2c89db49987c1e98)
DeltaFile
+6-6sys/dev/iicbus/adc/ads111x.c
+6-61 files

HardenedBSD/src 4efe75alib/libsys kqueue.2

kqueue.2: Fix reference to unexisting kevent1()

kqueue1() was meant.

While here, make the wording in the AUTHORS section more clear.

PR:             291908
Fixes:          9b1585384d53 ("kqueue.2: Editorial pass")
Reviewed by:    kib, dab
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D54858
DeltaFile
+4-4lib/libsys/kqueue.2
+4-41 files