HardenedBSD/src 3ae1fea — sys/dev/sdio sdiob.c

Merge branch 'freebsd/15-stable/main' into hardened/15-stable/main
DeltaFile
+9-2sys/dev/sdio/sdiob.c
+9-21 files

HardenedBSD/src dc57dc2 — sys/dev/acpi_apple acpi_apple.c

acpi_apple: Add PNP record

Reviewed by:    seuros
Differential Revision:  https://reviews.freebsd.org/D61298
DeltaFile
+1-0sys/dev/acpi_apple/acpi_apple.c
+1-01 files

HardenedBSD/src 04db6f6 — sys/dev/acpi_apple acpi_apple.h acpi_apple_platform.c

acpi_apple: Fix sleep with non-sleepable lock held

Apple platform attach and detach functions are serialized with ordinary
mutex and contain code that executes malloc() that leads to INVARIANTS
warnings. Fix it through replacement of mutex with sx lock.

Fixes:  d7d237ce731f ("acpi_apple: Apple platform ACPI driver")
Reviewed by:    seuros
Differential Revision:  https://reviews.freebsd.org/D61295
DeltaFile
+7-7sys/dev/acpi_apple/acpi_apple_platform.c
+1-0sys/dev/acpi_apple/acpi_apple.h
+8-72 files

HardenedBSD/src 6b38db4 — sys/sys kobj.h

sys/kobj.h: Convert macro DEFINE_CLASS to designated initializers

So that it is less error prone when adding new struct members or
refactoring in future.

No functional change intended.

Reviewed by:    kib, imp
MFC after:      2 weeks
Differential Revision:  https://reviews.freebsd.org/D61276
DeltaFile
+36-28sys/sys/kobj.h
+36-281 files

HardenedBSD/src 94df98c — sys/dev/sdio sdiob.c

sdiob: copy vendor/device IDs from card common CIS

Copy both the vendor and device IDs from the card common CIS if they are
absent in a function.

These are optional according to the spec. [1]

[1] Part E1 SDIO Simplified Specification §16.6

MFC after:      3 days

Reviewed by:    kibab, imp, adrian
Differential Revision:  https://reviews.freebsd.org/D60988

(cherry picked from commit c91dfb47e0bcdf682f7f152624e03747787c6ea3)
DeltaFile
+9-2sys/dev/sdio/sdiob.c
+9-21 files

HardenedBSD/src ff06657 — sys/netinet/tcp_stacks rack.c

TCP RACK: fix RSM computation for TCP fast open

When spitting an RSM containing the SYN and data, honor the
sequence number used by the SYN flag when computing the offset
in the socket buffer.

PR:                     297006
Reviewed by:            rrs, Peter Lei
MFC after:              3 days
MFC to:                 stable/15
Sponsored by:           Netflix, Inc.
Differential Revision:  https://reviews.freebsd.org/D61149
DeltaFile
+13-2sys/netinet/tcp_stacks/rack.c
+13-21 files

HardenedBSD/src 3369af6 — sys/kern kern_cpuset.c, sys/sys syscallsubr.h

cpuset(2): add kern_cpuset

Effort:         CHERI upstreaming
Sponsored by:    Innovate UK
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2284
DeltaFile
+7-2sys/kern/kern_cpuset.c
+1-0sys/sys/syscallsubr.h
+8-22 files

HardenedBSD/src 230d581 — sys/kern kern_descrip.c, sys/sys syscallsubr.h

fstat(2): add user_fstat

Effort:         CHERI upstreaming
Sponsored by:   Innovate UK
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2284
DeltaFile
+8-7sys/kern/kern_descrip.c
+1-0sys/sys/syscallsubr.h
+9-72 files

HardenedBSD/src 4ca9291 — sys/kern kern_environment.c, sys/sys syscallsubr.h

kenv(2): add kern_kenv

Effort:         CHERI upstreaming
Sponsored by:   Innovate UK
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2284
DeltaFile
+22-14sys/kern/kern_environment.c
+2-0sys/sys/syscallsubr.h
+24-142 files

HardenedBSD/src d7c0ab9 — sys/kern kern_acct.c, sys/sys syscallsubr.h

acct(2): add kern_acct

Effort:         CHERI upstreaming
Sponsored by:   Innovate UK
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2284
DeltaFile
+11-4sys/kern/kern_acct.c
+1-0sys/sys/syscallsubr.h
+12-42 files

HardenedBSD/src 7b18863 — sys/security/mac mac_syscalls.c, sys/sys syscallsubr.h

mac syscalls: add kern_ implementations

Where the kern_ interfaces map trivially to the syscall interface, follow
the syscall name even if awkward (e.g., sys___mac* -> kern___mac*).
Otherwise use shorter names.

Effort:         CHERI upstreaming
Sponsored by:   DARPA, AFRL
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2284
DeltaFile
+57-31sys/security/mac/mac_syscalls.c
+11-0sys/sys/syscallsubr.h
+68-312 files

HardenedBSD/src 6d5c80a — sys/dev/usb/controller xhcireg.h xhci.h

xhci: only set the slot context parent hub fields on xHCI 1.2

The Enhanced SuperSpeed meaning of the slot context parent hub slot ID
and port number fields was introduced in xHCI 1.2. Controllers built to
an earlier revision define them only for a Low- or Full-speed device
behind a High-speed hub.

A SuperSpeed device behind a USB 3.2 hub on an Intel Alpine Ridge
controller, an xHCI 1.1 part, stops responding to Address Device and
loops in uhub_reattach_port until the port is disabled.

Fixes:          20b19982545e ("usb: support SSP and SSPx2 xHCI")

Reviewed by:    aokblast, ngie, adrian
Differential Revision:  https://reviews.freebsd.org/D61278
DeltaFile
+9-2sys/dev/usb/controller/xhci.c
+2-0sys/dev/usb/controller/xhcireg.h
+2-0sys/dev/usb/controller/xhci.h
+13-23 files

HardenedBSD/src 4ce90d5 — sys/dev/asmc asmcvar.h asmc.c

asmc: notify the SMC of shutdown and restart

Nothing tells the SMC that a power off or restart was user requested, so
the T2 keeps rebooting the machine thinking the system is wedged.

Approved-by: ngie (co-mentor)

Reviewed by:    ngie, adrian
Differential Revision:  https://reviews.freebsd.org/D61260
DeltaFile
+23-0sys/dev/asmc/asmc.c
+7-0sys/dev/asmc/asmcvar.h
+30-02 files

HardenedBSD/src 0f908da — sys/powerpc/include atomic.h

powerpc: Define the sub-word atomic load and store directly

All currently supported powerpc CPUs handle single-copy atomicity for
any size up to the native word size, so load and store operations are
guaranteed for sub-word size that are naturally aligned.
DeltaFile
+6-0sys/powerpc/include/atomic.h
+6-01 files

HardenedBSD/src 934ffa4 — sys/powerpc/powerpc elf64_machdep.c

powerpc64: Don't ignore lookup errors in kernel linker

If a lookup fails for a R_PPC_JMP_SLOT (PLT relocation) ignoring errors
results in an address of 0 gets written into the jump slot, leading to a
NULL pointer jump when attempting to call the function it points to.
Fix this with proper error checking so that a module will fail to load
instead of crashing later on.
DeltaFile
+3-1sys/powerpc/powerpc/elf64_machdep.c
+3-11 files

HardenedBSD/src 68ba58a — sbin/camcontrol nvres.c

camcontrol: Fix -Wcast-align errors in the NVMe reservation report

Casting the byte buffer that holds the Reservation Report payload to
the status structures trips -Wcast-align on strict-alignment
architectures, which broke the CI builds there.  Put the buffer in a
union with the two status structures instead, so it is properly
aligned and no casts are needed.

Reported by:    FreeBSD CI
Fixes:  ba75cf05727e ("camcontrol: Support NVMe reservations via the persist subcommand")
Co-authored-by: Claude Fable 5 <noreply at anthropic.com>
MFC after:      1 week
Sponsored by:   Spectra Logic
DeltaFile
+11-7sbin/camcontrol/nvres.c
+11-71 files

HardenedBSD/src c17aa09 — usr.sbin/camdd camdd.c

camdd: Fix the worker startup race

The reader can hand off its first buffer before the writer sets
CAMDD_DEV_FLAG_ACTIVE.  camdd_queue_peer_buf() then mistakes the writer
for an exited peer and releases the buffer instead of queueing it.  This
can make a copy fail with bytes read but nothing written, without an
error message.

Mark both devices active before creating either worker, leaving the
workers to clear the flag on exit.  The work queues and EVFILT_USER
events are already initialized, so queued buffers and their notification
can wait for the writer to start without a startup barrier.

Treat pthread_create() failure as fatal.  Returning through the normal
cleanup path can free devices that an already-started worker is still
using, and an unstarted peer cannot consume any queued buffers.

Reviewed by:    imp, markj, ken
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D61277
DeltaFile
+9-6usr.sbin/camdd/camdd.c
+9-61 files

HardenedBSD/src 80f0901 — sbin/camcontrol Makefile camcontrol.h

camcontrol: Support NVMe namespace formatting via the format subcommand

Support formatting NVMe namespaces through the existing format
subcommand.  The format subcommand now dispatches on the device
protocol, in the same way the identify and persist subcommands do,
and issues the NVMe FORMAT NVM command for NVMe devices.

The SCSI syntax and behavior are unchanged.  The NVMe-specific
options are -e (secure erase setting), -G (format all namespaces),
-f (LBA format), -l (protection information location), -m (metadata
setting) and -p (protection information type).  The -q and -y options
work for both protocols; NVMe formats gain the same confirmation
question that SCSI formats have always had.  The -r and -w options
are SCSI only; -r returns an error for NVMe devices and -w has no
effect, since the NVMe format command does not complete until the
format is finished.

The default timeout for NVMe is 30 seconds for a cryptographic erase
and 30 minutes otherwise; the generic -t option overrides it.

    [23 lines not shown]
DeltaFile
+313-0sbin/camcontrol/nvformat.c
+114-1sbin/camcontrol/camcontrol.8
+30-8sbin/camcontrol/camcontrol.c
+3-0sbin/camcontrol/camcontrol.h
+1-1sbin/camcontrol/Makefile
+461-105 files

HardenedBSD/src 6eae951 — sbin/camcontrol Makefile camcontrol.h

camcontrol: Add a feature subcommand for NVMe Get/Set Features

Add a feature subcommand for the NVMe Get Features and Set Features
commands:

  camcontrol feature ndaX -a <get|set> -f feature [-d data]
      [-s num] [-U]

There is no transport-specific prefix in the name: SCSI has no
feature command (the closest equivalents are mode pages), and the
ATA SET FEATURES subcommands are already exposed through dedicated
camcontrol subcommands (apm, aam, epc and the power commands), so
the name is unclaimed.  The subcommand returns an error for
non-NVMe devices.

Currently, only the hostid feature is fully implemented.  The
hostid value for set is specified with -d as a UUID or an integer
in decimal, hex, or octal, and -U outputs the hostid as a UUID on
get.

    [36 lines not shown]
DeltaFile
+539-0sbin/camcontrol/nvfeature.c
+182-0sbin/camcontrol/camcontrol.8
+32-1sbin/camcontrol/camcontrol.c
+3-0sbin/camcontrol/camcontrol.h
+1-1sbin/camcontrol/Makefile
+757-25 files

HardenedBSD/src 961fa19 — sbin/camcontrol camcontrol.h camcontrol.8

camcontrol: Add support for NVMe namespace Identify

Add a -N argument to camcontrol identify.  This will fetch and
display namespace Identify data for NVMe drives, using
nvme_print_namespace() from nvmecontrol(8).

This gets the namespace Identify data via XPT_DEV_ADVINFO (i.e.
data cached in the kernel) like the standard NVMe identify command
does, and so works even on NVMe devices that do not support NVMe
Namespace Management.

sbin/camcontrol/camcontrol.c:
        Add a -N argument to camcontrol identify.

        Rename nvme_get_cdata() to nvme_get_data(), and give it the
        ability to fetch controller or namespace Identify data.
        While here, improve its error reporting with
        cam_error_print(), and only look at the CAM status bits of
        the returned CCB.

    [22 lines not shown]
DeltaFile
+87-26sbin/camcontrol/camcontrol.c
+12-2sbin/camcontrol/camcontrol.8
+2-0sbin/camcontrol/camcontrol.h
+101-283 files

HardenedBSD/src ba75cf0 — sbin/camcontrol Makefile camcontrol.h

camcontrol: Support NVMe reservations via the persist subcommand

The NVMe reservation model is closely patterned after SCSI Persistent
Reservations, so support NVMe devices through the existing persist
subcommand rather than adding a transport-specific subcommand.  The
persist subcommand now dispatches on the device protocol, in the same
way the identify subcommand does.

The SCSI syntax is unchanged.  For NVMe devices, the -i modes all map
to the Reservation Report command (read_full_status requests the
extended data structure, which contains 128-bit Host Identifiers), and
the -o service actions map to the corresponding NVMe reservation
operations: register, register_ignore, reserve, preempt,
preempt_abort, release and clear, plus two NVMe-only actions,
unregister and replace.  The reservation type names for -T are shared
between SCSI and NVMe.  A new -c option gives explicit control over
the NVMe Persist Through Power Loss State; -p is equivalent to
-c enable.  SCSI-only options return an error for NVMe devices.


    [32 lines not shown]
DeltaFile
+674-0sbin/camcontrol/nvres.c
+107-7sbin/camcontrol/camcontrol.8
+23-9sbin/camcontrol/camcontrol.c
+3-0sbin/camcontrol/camcontrol.h
+1-1sbin/camcontrol/Makefile
+808-175 files

HardenedBSD/src 9814633 — sys/cam/nvme nvme_all.h nvme_all.c

cam: Add NVMe reservation, format and features CCB building functions

Add NVMe CCB (union ccb / struct ccb_nvmeio) building functions for
the four NVMe reservation opcodes, Format NVM, and Get Features /
Set Features.  These use the nvme_command building blocks added to
sys/dev/nvme/nvme.h, and are used by the new camcontrol(8) nvres,
nvformat and nvfeature subcommands that will be added separately.

sys/cam/nvme/nvme_all.c:
        Add NVMe CCB building functions for the four NVMe reservation
        opcodes: nvme_resv_report(), nvme_resv_register(),
        nvme_resv_acquire() and nvme_resv_release().  Data direction
        is set internally (CAM_DIR_IN or CAM_DIR_OUT as appropriate),
        so no flags parameter is needed.

        Add a new nvme_format() CCB building function.

        Add nvme_get_feature() and nvme_set_feature() CCB building
        functions, along with nvme_get_feature_hostid() and

    [16 lines not shown]
DeltaFile
+201-0sys/cam/nvme/nvme_all.c
+41-0sys/cam/nvme/nvme_all.h
+242-02 files

HardenedBSD/src 7a9e437 — sbin/nvmecontrol resv.c, sys/dev/nvme nvme_util.c nvme_ctrlr.c

nvme: Add reservation, format and features command building support

Add command (struct nvme_command) building functions for the four
NVMe reservation opcodes (Report, Register, Acquire and Release),
Format NVM, and Get Features / Set Features, along with the
enumerations and data structures that go with them.  These are
shared between the kernel and userland, and are the underpinnings
for new camcontrol(8) subcommands (nvres, nvformat, nvfeature) that
will be added separately.

The reservation type names are intentionally similar to the SCSI
names for the same reservation types.

sys/dev/nvme/nvme.h:
  Add NVMe command building functions for the four NVMe
  reservation opcodes: nvme_ns_resv_report_cmd(),
  nvme_ns_resv_register_cmd(), nvme_ns_resv_acquire_cmd() and
  nvme_ns_resv_release_cmd().


    [68 lines not shown]
DeltaFile
+176-10sys/dev/nvme/nvme.h
+15-22sys/dev/nvme/nvme_ctrlr_cmd.c
+8-9sys/dev/nvme/nvme_ctrlr.c
+15-0sys/dev/nvme/nvme_util.c
+5-4sbin/nvmecontrol/resv.c
+219-455 files

HardenedBSD/src 46198fb — sbin/nvmecontrol nvmecontrol.h nvmecontrol_ext.h

nvmecontrol: Factor out namespace Identify printing

Move print_namespace() from identify.c to identify_ext.c and rename
it to nvme_print_namespace(), to match nvme_print_controller().
This allows other consumers (notably camcontrol(8)) to print NVMe
namespace Identify data.

No functional changes intended.

sbin/nvmecontrol/identify.c:
        Remove print_namespace(), and call nvme_print_namespace()
        instead.

sbin/nvmecontrol/identify_ext.c:
        Add nvme_print_namespace(), moved here from identify.c.

sbin/nvmecontrol/nvmecontrol.h:
        Remove the print_namespace() prototype.


    [12 lines not shown]
DeltaFile
+1-128sbin/nvmecontrol/identify.c
+127-0sbin/nvmecontrol/identify_ext.c
+2-1sbin/nvmecontrol/ns.c
+0-1sbin/nvmecontrol/nvmecontrol.h
+1-0sbin/nvmecontrol/nvmecontrol_ext.h
+131-1305 files

HardenedBSD/src 4398c46 — contrib/bc/vs bcl.vcxproj.filters bc.vcxproj.filters, contrib/bc/vs/tests tests_bc.bat

Merge branch 'freebsd/15-stable/main' into hardened/15-stable/main
DeltaFile
+0-301contrib/bc/vs/bc.vcxproj
+0-264contrib/bc/vs/bcl.vcxproj
+247-0sbin/dhclient/tests/functional.py
+0-170contrib/bc/vs/bc.vcxproj.filters
+0-104contrib/bc/vs/tests/tests_bc.bat
+0-87contrib/bc/vs/bcl.vcxproj.filters
+247-92624 files not shown
+443-1,20130 files

HardenedBSD/src 9dae9b3 — lib/libthr/thread thr_exit.c

libthr: require both _Unwind_ForcedUnwind and _Unwind_GetCFA for !PIC

Static linking must bring in both symbols for the unwind to work.

The landing pads added by 2734bbbcba3c reference _Unwind_Resume and
__gcc_personality_v0. In a static link, these pull UnwindLevel1.o
from libgcc_eh.a, which also defines _Unwind_ForcedUnwind, but
not UnwindLevel1-gcc-ext.o, which defines _Unwind_GetCFA. Unless
something else pulls that object in, as libcxxrt does for C++ programs,
thread_unwind_stop() calls a NULL _Unwind_GetCFA on every thread exit.

Reported and tested by: dch
Fixes:  2734bbbcba3c ("libthr: Create landing pad in thr_once in C++ exception")
Sponsored by:   The FreeBSD Foundation
DeltaFile
+1-1lib/libthr/thread/thr_exit.c
+1-11 files

HardenedBSD/src c3a0593 — share/man/man4 iscsi.4, sys/dev/iscsi iscsi.c

Revert "iSCSI: Fast and per-session timeouts"

This reverts commit 6129bc4b65d8f00570bdcf2b2d36f3717e4b4741.
DeltaFile
+18-35sys/dev/iscsi/iscsi.c
+2-23usr.bin/iscsictl/parse.y
+6-8usr.bin/iscsictl/iscsictl.c
+2-6usr.sbin/iscsid/iscsid.c
+3-4share/man/man4/iscsi.4
+3-3usr.bin/iscsictl/iscsi.conf.5
+34-792 files not shown
+34-828 files

HardenedBSD/src b556d9c — share/man/man7 ports.7

ports.7: Add the DEVELOPER make variable

make.conf(5) says make variables that are for the ports tree should
be documented in ports(7). Add this from the porters handbook.

MFC after:              3 days
Reviewed by:            alven
Event:                  FreeBSD 2026 Vendor Summit
Differential Revision:  https://reviews.freebsd.org/D61272
DeltaFile
+4-1share/man/man7/ports.7
+4-11 files

HardenedBSD/src 5b5f93f — contrib/bc/vs bcl.vcxproj.filters bc.vcxproj.filters, contrib/bc/vs/tests tests_dc.bat tests_bc.bat

contrib/bc: remove vs sub-directory

Some of the files in the vs sub-directory are checked out with  CRLF
line breaks via .getattributes. This causes issues when checking out
the source tree with other tools that operate on Git repositories like
"got". Remove the vs sub-directory from the contrib tree, since it is
not required on FreeBSD.

(cherry picked from commit 94d4ba04a96f495d635bf246e4d5021eb1faab22)
DeltaFile
+0-301contrib/bc/vs/bc.vcxproj
+0-264contrib/bc/vs/bcl.vcxproj
+0-170contrib/bc/vs/bc.vcxproj.filters
+0-104contrib/bc/vs/tests/tests_bc.bat
+0-87contrib/bc/vs/bcl.vcxproj.filters
+0-61contrib/bc/vs/tests/tests_dc.bat
+0-9873 files not shown
+1-1,0559 files

HardenedBSD/src 6129bc4 — share/man/man4 iscsi.4, sys/dev/iscsi iscsi.c

iSCSI: Fast and per-session timeouts

Support per-session configurable ping (SCSI NOP) and login timeouts
similar to what is supported in the Linux iSCSI initiator configuration file.

Reduce iscsi timer granularity to 0.1 sec.
For backwards compatibility, when all timers are selected on integer numbers,
all status messages are unchanged. If the higher granularity is used, the
log messages include sub-second granularity.

The sysctl(3) interface has changed from pure int to string, in order to
support fractional seconds in a human-readable, dotted notation.

Reviewed By: #netapp, #manpages, jhb, pauamma_chezdork.com, siderop1_netapp.com
Sponsored by: NetApp, Inc.
Differential Revision: https://reviews.freebsd.org/D32540
DeltaFile
+35-18sys/dev/iscsi/iscsi.c
+23-2usr.bin/iscsictl/parse.y
+8-6usr.bin/iscsictl/iscsictl.c
+6-2usr.sbin/iscsid/iscsid.c
+4-3share/man/man4/iscsi.4
+3-3usr.bin/iscsictl/iscsi.conf.5
+79-342 files not shown
+82-348 files