HardenedBSD/src 51011f4lib/librpcsec_gss svc_rpcsec_gss.c, sys/netinet tcp_subr.c

Merge remote-tracking branch 'origin/hardened/current/master' into hardened/current/cross-dso-cfi
DeltaFile
+9-1sys/rpc/rpcsec_gss/svc_rpcsec_gss.c
+8-1lib/librpcsec_gss/svc_rpcsec_gss.c
+2-3tests/sys/kern/timerfd.c
+2-0sys/netinet/tcp_subr.c
+0-1tests/sys/kern/Makefile
+21-65 files

HardenedBSD/src 8001477lib/librpcsec_gss svc_rpcsec_gss.c, sys/netinet tcp_subr.c

Merge branch 'freebsd/current/main' into hardened/current/master
DeltaFile
+9-1sys/rpc/rpcsec_gss/svc_rpcsec_gss.c
+8-1lib/librpcsec_gss/svc_rpcsec_gss.c
+2-3tests/sys/kern/timerfd.c
+2-0sys/netinet/tcp_subr.c
+0-1tests/sys/kern/Makefile
+21-65 files

HardenedBSD/src 981cd08sys/vm vm_mmap.c

Provide more precise error explanations for mmap(2) EINVAL errors.

Reviewed by:  kib
Differential Revision: https://reviews.freebsd.org/D55888
Sponsored by: Netflix

(cherry picked from commit dad6e6fc1ea4b737e9f1661ebd30da5d551e3d4a)
DeltaFile
+23-13sys/vm/vm_mmap.c
+23-131 files

HardenedBSD/src b0ef93asys/vm vm_mmap.c

Delete error-check code that can never happen.

Near the top of kern_mmap() that implements the mmap(2) system call,
it sets

        prot = PROT_EXTRACT(prot);

with

So prot can only be the three PROT_ flags.

The following test of the user's mmap(2) parameters (near line 275
in vm/vm_mmap.c):

        if (prot != PROT_NONE &&
            (prot & ~(PROT_READ | PROT_WRITE | PROT_EXEC)) != 0) {
                return (EXTERROR(EINVAL, "invalid prot %#jx", prot));
        }


    [8 lines not shown]
DeltaFile
+0-4sys/vm/vm_mmap.c
+0-41 files

HardenedBSD/src 1b00fdclib/librpcsec_gss svc_rpcsec_gss.c, sys/rpc/rpcsec_gss svc_rpcsec_gss.c

rpcsec_gss: Fix a stack overflow in svc_rpc_gss_validate()

svc_rpc_gss_validate() copies the input message into a stack buffer
without ensuring that the buffer is large enough.  Sure enough,
oa_length may be up to 400 bytes, much larger than the provided space.
This enables an unauthenticated user to trigger an overflow and obtain
remote code execution.

Add a runtime check which verifies that the copy won't overflow.

Approved by:    so
Security:       FreeBSD-SA-26:08.rpcsec_gss
Security:       CVE-2026-4747
Reported by:    Nicholas Carlini <npc at anthropic.com>
Reviewed by:    rmacklem
Fixes:          a9148abd9da5d

(cherry picked from commit 143293c14f8de00c6d3de88cd23fc224e7014206)
DeltaFile
+9-1sys/rpc/rpcsec_gss/svc_rpcsec_gss.c
+8-1lib/librpcsec_gss/svc_rpcsec_gss.c
+17-22 files

HardenedBSD/src 1fddb54sys/netinet tcp_subr.c

tcp: plug an mbuf leak

When a challenge ACK should be sent via tcp_send_challenge_ack(),
but the rate limiter suppresses the sending, free the mbuf chain.
The caller of tcp_send_challenge_ack() expects this similar to the
callers of tcp_respond().

Approved by:    so
Security:       FreeBSD-SA-26:06.tcp
Security:       CVE-2026-4247
Reviewed by:    lstewart
Tested by:      lstewart
Sponsored by:   Netflix, Inc.

(cherry picked from commit 6b2d6ccad2552e46a5c9c3ba70b2d0ed27c70ca8)
DeltaFile
+2-0sys/netinet/tcp_subr.c
+2-01 files

HardenedBSD/src 143293clib/librpcsec_gss svc_rpcsec_gss.c, sys/rpc/rpcsec_gss svc_rpcsec_gss.c

rpcsec_gss: Fix a stack overflow in svc_rpc_gss_validate()

svc_rpc_gss_validate() copies the input message into a stack buffer
without ensuring that the buffer is large enough.  Sure enough,
oa_length may be up to 400 bytes, much larger than the provided space.
This enables an unauthenticated user to trigger an overflow and obtain
remote code execution.

Add a runtime check which verifies that the copy won't overflow.

Approved by:    so
Security:       FreeBSD-SA-26:08.rpcsec_gss
Security:       CVE-2026-4747
Reported by:    Nicholas Carlini <npc at anthropic.com>
Reviewed by:    rmacklem
Fixes:          a9148abd9da5d
DeltaFile
+9-1sys/rpc/rpcsec_gss/svc_rpcsec_gss.c
+8-1lib/librpcsec_gss/svc_rpcsec_gss.c
+17-22 files

HardenedBSD/src 6b2d6ccsys/netinet tcp_subr.c

tcp: plug an mbuf leak

When a challenge ACK should be sent via tcp_send_challenge_ack(),
but the rate limiter suppresses the sending, free the mbuf chain.
The caller of tcp_send_challenge_ack() expects this similar to the
callers of tcp_respond().

Approved by:    so
Security:       FreeBSD-SA-26:06.tcp
Security:       CVE-2026-4247
Reviewed by:    lstewart
Tested by:      lstewart
Sponsored by:   Netflix, Inc.
DeltaFile
+2-0sys/netinet/tcp_subr.c
+2-01 files

HardenedBSD/src cb69238tests/sys/kern timerfd.c Makefile

timerfd: Expect periodic timer performance failures

The current timerfd implementation fails to correctly count events on a
nanosecond callout interval. The timerfd__periodic_timer_performance
test detects this and reports failure.

Mark this test as an expected failure so it isn't flagged by CI. A link
to the bug report is attached to the test for reference.

While we're here, clean up some minor style and Make issues.

Fixes:          834c1ba793d9 ("timerfd: Add tests")
MFC after:      1 week
DeltaFile
+2-3tests/sys/kern/timerfd.c
+0-1tests/sys/kern/Makefile
+2-42 files

HardenedBSD/src 689c0cbsys/dev/ufshci ufshci_acpi.c ufshci_ctrlr.c, tests/sys/netinet raw.c

Merge remote-tracking branch 'origin/hardened/current/master' into hardened/current/cross-dso-cfi
DeltaFile
+248-0sys/dev/ufshci/ufshci_acpi.c
+170-71tests/sys/netinet/raw.c
+95-107usr.bin/m4/eval.c
+45-45usr.bin/m4/mdef.h
+62-9sys/dev/ufshci/ufshci_ctrlr.c
+35-35usr.bin/m4/main.c
+655-26725 files not shown
+849-36831 files

HardenedBSD/src 2220d96lib/libpmc pmc.ibs.3, sys/dev/hwpmc hwpmc_ibs.c hwpmc_ibs.h

Merge branch 'freebsd/current/main' into hardened/current/master
DeltaFile
+170-71tests/sys/netinet/raw.c
+4-1lib/libpmc/pmc.ibs.3
+1-2sys/dev/hwpmc/hwpmc_ibs.c
+1-2sys/dev/hwpmc/hwpmc_ibs.h
+0-2sys/rpc/clnt_bck.c
+176-785 files

HardenedBSD/src 8c183d9stand defs.mk

HBSD: Resolve merge conflict

Signed-off-by:  Shawn Webb <shawn.webb at hardenedbsd.org>
DeltaFile
+0-3stand/defs.mk
+0-31 files

HardenedBSD/src c1a66fcsys/dev/ufshci ufshci_acpi.c ufshci_ctrlr.c, usr.bin/m4 eval.c mdef.h

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

Conflicts:
        stand/defs.mk (unresolved)
DeltaFile
+248-0sys/dev/ufshci/ufshci_acpi.c
+95-107usr.bin/m4/eval.c
+45-45usr.bin/m4/mdef.h
+62-9sys/dev/ufshci/ufshci_ctrlr.c
+35-35usr.bin/m4/main.c
+36-4sys/dev/ufshci/ufshci_req_sdb.c
+521-20020 files not shown
+676-29026 files

HardenedBSD/src 98bedcalib/libpmc pmc.ibs.3, sys/dev/hwpmc hwpmc_ibs.c hwpmc_ibs.h

pmc: Fix copyright in previous commits

Fix the copyright attribution to Netflix and the date and missing SPDX
line in pmc.ibs man page.

Sponsored by: Netflix

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/2094
DeltaFile
+4-1lib/libpmc/pmc.ibs.3
+1-2sys/dev/hwpmc/hwpmc_ibs.c
+1-2sys/dev/hwpmc/hwpmc_ibs.h
+6-53 files

HardenedBSD/src 41b423csys/rpc clnt_bck.c

clnt_bck.c: Delete a couple of old diagnostic printfs

There were two debug printf()s that were left in the
code while debugging the handling of callbacks over
a NFSv4.1/4.2 backchannel was being done.

This patch removes them, since they are no longer
of benefit and cause "noise".

Requested by:   wollman
MFC after:      2 weeks
DeltaFile
+0-2sys/rpc/clnt_bck.c
+0-21 files

HardenedBSD/src f698988tests/sys/netinet raw.c

tests/netinet: add raw:reconnect test

It tests repetitive connect(2) on AF_INET/SOCK_RAW including connect(2)
to INADDR_ANY that puts socket back into receive-all mode.
DeltaFile
+170-71tests/sys/netinet/raw.c
+170-711 files

HardenedBSD/src 648d0fetests/sys/netpfil/common utils.subr

ipfw: skip tests if required sysctl is not set

Since this is a configuration prerequisite rather than a test failure, use
atf_skip instead.

Sponsored by:   Netflix
Differential Revision:  https://reviews.freebsd.org/D56069
DeltaFile
+1-1tests/sys/netpfil/common/utils.subr
+1-11 files

HardenedBSD/src 90de72bsbin/pfctl pfctl.c, sys/netpfil/pf pf_ioctl.c

Merge branch 'freebsd/15-stable/main' into hardened/15-stable/main
DeltaFile
+94-9sys/netpfil/pf/pf_ioctl.c
+38-0tests/sys/netpfil/pf/pass_block.sh
+2-2sbin/pfctl/pfctl.c
+134-113 files

HardenedBSD/src 6900d8brelease/packages/ucl libsdp-all.ucl

packages: Remove stale libsdp-all.ucl

This package no longer exists since it was merged into bluetooth.

Fixes:  41ee4321cc52 ("libsdp: Move to bluetooth-lib package")
MFC after:      3 days
Reviewed by:    emaste
Differential Revision:  https://reviews.freebsd.org/D55822
Sponsored by:           https://www.patreon.com/bsdivy
DeltaFile
+0-28release/packages/ucl/libsdp-all.ucl
+0-281 files

HardenedBSD/src ea25f49release/packages/ucl ftpd-all.ucl

packages: Remove stale ftpd-all.ucl

This file was missed when ftpd(8) was removed.

Fixes:  614c8750ce11 ("Remove ftpd(8)")
MFC after:      3 days
Reviewed by:    emaste
Differential Revision:  https://reviews.freebsd.org/D55820
Sponsored by:           https://www.patreon.com/bsdivy
DeltaFile
+0-4release/packages/ucl/ftpd-all.ucl
+0-41 files

HardenedBSD/src 4311217sys/netpfil/pf pf_ioctl.c

pf: include all elements when hashing rules

MFC after:      1 week
Sponsored by:   Rubicon Communications, LLC ("Netgate")

(cherry picked from commit c6bcf6e6fd507d952a48226b51cc161b8ef972a2)
DeltaFile
+93-9sys/netpfil/pf/pf_ioctl.c
+93-91 files

HardenedBSD/src e224b9bsbin/pfctl pfctl.c

pfctl: always warn if a duplicate rule was detected

MFC after:      1 week
Sponsored by:   Rubicon Communications, LLC ("Netgate")

(cherry picked from commit 66d66dd0f6f83926980fc1d68dd366c0057350c5)
DeltaFile
+2-2sbin/pfctl/pfctl.c
+2-21 files

HardenedBSD/src 4e00773tests/sys/netpfil/pf pass_block.sh

pf tests: verify that we handle address range rules correctly

There's been a problem where rules which differed only in address ranges
were considered duplicates and not added. Test for this.

MFC after:      1 week
Sponsored by:   Rubicon Communications, LLC ("Netgate")

(cherry picked from commit ab74151e8d097b263237942c0b12277098bc9533)
DeltaFile
+38-0tests/sys/netpfil/pf/pass_block.sh
+38-01 files

HardenedBSD/src 38f8ac5sys/netpfil/pf pf_ioctl.c

pf: Fix hashing of IP address ranges

This corrects the false detection of duplicate rules.

MFC after:      1 week
Reviewed by:    kp

(cherry picked from commit 1fa873c93c8b08561c53107c7b90c53dfad30ddc)
DeltaFile
+1-0sys/netpfil/pf/pf_ioctl.c
+1-01 files

HardenedBSD/src 746d6b2lib/libc/stdlib realpath.3 realpath.c, sys/dev/nvmf/controller nvmft_controller.c

Merge branch 'freebsd/15-stable/main' into hardened/15-stable/main
DeltaFile
+12-24lib/libc/stdlib/realpath.3
+7-3lib/libc/stdlib/realpath.c
+1-1sys/dev/nvmf/controller/nvmft_controller.c
+20-283 files

HardenedBSD/src 61f7813stand defs.mk

stand: Force disable RETPOLINE for boot loaders

Boot loaders do not require speculative execution protection, and may be
too large if enabled.

Reported by:    Shawn Webb
Reviewed by:    dim, imp
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D56068
DeltaFile
+1-0stand/defs.mk
+1-01 files

HardenedBSD/src 615f1b9sys/amd64/amd64 machdep.c

kern/amd64/machdep: Replace memset in wrmsr_early_safe_end

GENERIC-KASAN kernel failed to boot on a Dell PowerEdge C6615 with
an AMD EPYC 8224P CPU; UEFI BIOS caught a #GP exception with %RIP
in kasan_memset where %GS relative pointer (curthread->td_pflags2)
was dereferenced. Investigation led to wrmsr_early_safe_end which
calls memset to clear early #GP IDT entry. Replacing memset with
__builtin_memset_inline still resulted in the compiler emitting a
call to the memset resolver in GENERIC-KASAN build and the kernel
stil faulted during boot. This version which has been successfully
tested with both GENERIC and GENERIC-KASAN kernels uses memset_early.

Signed-off-by: Kristofer Peterson <kris at tranception.com>
Reviewed-by: kib
Pull-Request: https://github.com/freebsd/freebsd-src/pull/2069
DeltaFile
+1-1sys/amd64/amd64/machdep.c
+1-11 files

HardenedBSD/src b1d3252sys/dev/nvmf/controller nvmft_controller.c

nvmf: Fix null ptr reference

Reported by:    Nikolay Denev <ndenev at gmail.com>
Reviewed by:    imp, jhb
Differential Revision:  https://reviews.freebsd.org/D55863

(cherry picked from commit 09c5bb35425bc70573c007e7f7e82be286677a87)
DeltaFile
+1-1sys/dev/nvmf/controller/nvmft_controller.c
+1-11 files

HardenedBSD/src 930a790share/man/man4 rge.4, sys/dev/rge if_rge_sysctl.c if_rge.c

rge: make rx_process_limit a sysctl tunable

The number of packets processed per interrupt was hardcoded to 16.
Add a per-interface sysctl dev.rge.%d.rx_process_limit tunable so
users can adjust this value at runtime.

Signed-off-by: Christos Longros <chris.longros at gmail.com>

Reviewed by:    ziaee, adrian
Differential Revision:  https://reviews.freebsd.org/D56014
DeltaFile
+5-0share/man/man4/rge.4
+5-0sys/dev/rge/if_rge_sysctl.c
+2-1sys/dev/rge/if_rge.c
+2-0sys/dev/rge/if_rgevar.h
+14-14 files

HardenedBSD/src 8f36a01share/man/man4 rge.4

rge.4: fix incorrect speed range in HARDWARE section

The HARDWARE section stated "PCIe 1GB to 1GB Ethernet devices"
which is incorrect. The RTL8125/8126/8127 chips support speeds
from 1Gbps to 10Gbps. Correct the range.

Signed-off-by: Christos Longros <chris.longros at gmail.com>

rge.4: note that the driver manages PHY directly

The rge(4) driver does not use the miibus(4) interface for PHY
management. Instead, it accesses PHY registers directly via the
chip's OCP (On-Chip Peripheral) bus. Document this in the
DESCRIPTION section.

Signed-off-by: Christos Longros <chris.longros at gmail.com>

Reviewed by:    adrian
Differential Revision:  https://reviews.freebsd.org/D55995
DeltaFile
+17-2share/man/man4/rge.4
+17-21 files