HardenedBSD/src 4f78c98sys/contrib/zstd/lib zstd.h, sys/contrib/zstd/lib/common xxhash.h

Merge remote-tracking branch 'origin/hardened/current/master' into hardened/current/cross-dso-cfi
DeltaFile
+2,416-1,011sys/contrib/zstd/lib/common/xxhash.h
+2,413-897sys/contrib/zstd/lib/compress/zstd_compress.c
+1,063-820sys/contrib/zstd/programs/fileio.c
+835-446sys/contrib/zstd/programs/benchzstd.c
+630-535sys/contrib/zstd/lib/compress/zstd_lazy.c
+889-266sys/contrib/zstd/lib/zstd.h
+8,246-3,975181 files not shown
+19,903-11,444187 files

HardenedBSD/src 0517946sys/contrib/zstd/lib zstd.h, sys/contrib/zstd/lib/common xxhash.h

Merge branch 'freebsd/current/main' into hardened/current/master
DeltaFile
+2,416-1,011sys/contrib/zstd/lib/common/xxhash.h
+2,413-897sys/contrib/zstd/lib/compress/zstd_compress.c
+1,063-820sys/contrib/zstd/programs/fileio.c
+835-446sys/contrib/zstd/programs/benchzstd.c
+630-535sys/contrib/zstd/lib/compress/zstd_lazy.c
+889-266sys/contrib/zstd/lib/zstd.h
+8,246-3,975181 files not shown
+19,903-11,444187 files

HardenedBSD/src c0d9a07sys/contrib/zstd/lib zstd.h, sys/contrib/zstd/lib/common xxhash.h

MFV: zstd 1.5.7.

MFC after:      2 weeks
Relnotes:       yes
DeltaFile
+2,416-1,011sys/contrib/zstd/lib/common/xxhash.h
+2,413-897sys/contrib/zstd/lib/compress/zstd_compress.c
+1,063-820sys/contrib/zstd/programs/fileio.c
+835-446sys/contrib/zstd/programs/benchzstd.c
+630-535sys/contrib/zstd/lib/compress/zstd_lazy.c
+889-266sys/contrib/zstd/lib/zstd.h
+8,246-3,975170 files not shown
+19,451-11,214176 files

HardenedBSD/src dd201e4usr.bin/lockf lockf.1

lockf.1: Organize and provide error numbers

Add error numbers to the exit codes so that readers can decode them
without having to use a separate utility. Organize exits by error code.
Mark up the error constants with the error constant macro, even though
this is really not very helpful because people will search for the error
code, the macro is explicitly for the constants and not the codes.

While where, align and alphabetize the options list as well, fix
misaligned padding in an example, and a one-sentance-per-line error.

MFC after:              3 days
Reported by:            Antranig Vartanian <antranigv at freebsd.am>
Differential Revision:  https://reviews.freebsd.org/D48470
DeltaFile
+33-30usr.bin/lockf/lockf.1
+33-301 files

HardenedBSD/src 8e99453sys/dev/dpaa2 dpaa2_ni.c dpaa2_frame.h

dpaa2: Extract frame-specific routines to dpaa2_frame.[h,c]

As soon as we need information from the hardware frame annotation to
make sure that checksums of the ingress frames were verified by the
DPAA2 HW, I've decided to make a preparation and extracted all of the
frame related routines into the separate dpaa2_frame.[h,c] along with
some clean up and improvements, e.g. no more dpaa2_fa, but dpaa2_swa
and dpaa2_hwa structures to describe software and hardware frame
annotations respectively, dpaa2_fa_get_swa/dpaa2_fa_get_hwa to obtain
those annotations from the frame descriptor. The next step is to
implement dpaa2_fa_get_hwa.

PR:             292006
Approved by:    tuexen
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D56315
DeltaFile
+63-145sys/dev/dpaa2/dpaa2_ni.c
+174-0sys/dev/dpaa2/dpaa2_frame.h
+165-0sys/dev/dpaa2/dpaa2_frame.c
+1-50sys/dev/dpaa2/dpaa2_swp.h
+5-4sys/dev/dpaa2/dpaa2_buf.c
+5-0sys/dev/dpaa2/dpaa2_types.h
+413-1994 files not shown
+419-20010 files

HardenedBSD/src 52d3217sys/arm64/arm64 pmap.c

HBSD: Resolve merge conflict

Signed-off-by:  Shawn Webb <shawn.webb at hardenedbsd.org>
DeltaFile
+0-3sys/arm64/arm64/pmap.c
+0-31 files

HardenedBSD/src e2640d9sys/arm64/arm64 trap.c pmap.c, sys/dev/virtio/gpu virtio_gpu.c

Merge remote-tracking branch 'origin/freebsd/15-stable/main' into hardened/15-stable/main

Conflicts:
        sys/arm64/arm64/pmap.c (unresolved)
DeltaFile
+72-81sys/arm64/arm64/trap.c
+53-47sys/arm64/arm64/pmap.c
+52-6sys/arm64/arm64/copyinout.S
+38-16sys/arm64/arm64/machdep.c
+38-13sys/dev/virtio/gpu/virtio_gpu.c
+32-18sys/arm64/arm64/identcpu.c
+285-18120 files not shown
+447-24926 files

HardenedBSD/src a716a9clib/libc/tests/string strrchr_test.c, stand/lua core.lua

Merge remote-tracking branch 'origin/hardened/current/master' into hardened/current/cross-dso-cfi
DeltaFile
+438-0tests/sys/arch/aarch64/sve.c
+156-0lib/libc/tests/string/strrchr_test.c
+52-32sys/dev/acpica/acpi.c
+46-0tests/sys/arch/aarch64/sve_ptrace_helper.c
+13-12usr.bin/stat/tests/stat_test.sh
+18-2stand/lua/core.lua
+723-4622 files not shown
+822-7928 files

HardenedBSD/src 5edde9clib/libc/tests/string strrchr_test.c, stand/lua core.lua

Merge branch 'freebsd/current/main' into hardened/current/master
DeltaFile
+438-0tests/sys/arch/aarch64/sve.c
+156-0lib/libc/tests/string/strrchr_test.c
+52-32sys/dev/acpica/acpi.c
+46-0tests/sys/arch/aarch64/sve_ptrace_helper.c
+13-12usr.bin/stat/tests/stat_test.sh
+18-2stand/lua/core.lua
+723-4622 files not shown
+822-7928 files

HardenedBSD/src 8cbd394usr.bin/stat/tests stat_test.sh

stat: Nits in stat tests

* Use ourselves as test file instead of /COPYRIGHT, which may or may not
  be present in the test environment.

* atf-check understands \n in strings, use it.

* Some file systems don't like creating small holes, so create large ones
  instead.  This means we need two variables: ps (page size) is the
  minimum size of a data region and the alignment for a hole, while hs
  (hole size) is the minimum size of the holes we create.  This makes no
  difference on FreeBSD but makes it easier to port the test to other
  platforms.

MFC after:      1 week
Sponsored by:   Klara, Inc.
Reviewed by:    kevans
Differential Revision:  https://reviews.freebsd.org/D56304
DeltaFile
+13-12usr.bin/stat/tests/stat_test.sh
+13-121 files

HardenedBSD/src a7e07d0lib/libgcc_s Symbol.map

libgcc_s: export __extendhftf2

We've compiled it since the LLVM 13 import in 2021, but for some reason
never exported it.  A user of CheriBSD recently caused Morello LLVM to
emit a reference to it so finish the job and export it.

Reviewed by:    dim, emaste
Fixes:          6e75b2fbf9a0 ("Merge llvm-project release/13.x llvmorg-13.0.0-rc1-97-g23ba3732246a")
MFC after:      1 week
Sponsored by:   DARPA, AFRL
See also:       https://github.com/CTSRD-CHERI/cheribsd/issues/2614
Differential Revision:  https://reviews.freebsd.org/D56310
DeltaFile
+1-0lib/libgcc_s/Symbol.map
+1-01 files

HardenedBSD/src 16aa49fsys/compat/linprocfs linprocfs.c

compat/linprocfs: Fix auxv sbuf leak

linprocfs_doauxv() allocates an automatic sbuf before validating
whether the requested read can be satisfied.

When the computed auxv read length exceeds IOSIZE_MAX, or when the
buffer length is too big, the function returns early without
releasing the sbuf.

Route these early exits through a shared cleanup path so the sbuf is
always deleted after sbuf_new_auto() succeeds.

Signed-off-by:  Shunchao Hu <ankohuu at gmail.com>
Reviewed by:    des, spmzt, zlei, aokblast
MFC after:      2 weeks
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2118
DeltaFile
+11-8sys/compat/linprocfs/linprocfs.c
+11-81 files

HardenedBSD/src 96a685clib/msun/aarch64 fenv.c fenv.h

lib/msun/aarch64: provide export file for arch-specific fenv methods

Reported and tested by: fluffy
Reviewed by:    emaste
Fixes:  3a01e1e1a50cb9a9594aac2148dc920a6b295428
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D56283
DeltaFile
+18-0lib/msun/aarch64/fenv.c
+9-5lib/msun/aarch64/fenv.h
+10-0lib/msun/aarch64/Symbol.map
+37-53 files

HardenedBSD/src c913dcelib/msun Makefile, lib/msun/amd64 Makefile.inc

lib/msun: centralize addition of the arch-specific symbol map files

This also adds the aarch64 symbols, exporting them.

Reported and tested by: fluffy
Reviewed by:    emaste
Fixes:  3a01e1e1a50cb9a9594aac2148dc920a6b295428
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D56283
DeltaFile
+0-1lib/msun/arm/Makefile.inc
+0-1lib/msun/powerpc/Makefile.inc
+0-1lib/msun/riscv/Makefile.inc
+0-1lib/msun/i387/Makefile.inc
+1-0lib/msun/Makefile
+0-1lib/msun/amd64/Makefile.inc
+1-56 files

HardenedBSD/src 0ddaa4cetc/mtree BSD.tests.dist, tests/sys/arch Makefile Makefile.inc

arm64: Add arm64 SVE tests

Add the tests/sys/arch directory for architecture-specific tests and
use it to add arm64 SVE tests. These test the kernel is managing the
SVE state in a way we expect.

These tests require SVE hardware support to run so will skip when they
can't detect it.

Reviewed by:    markj
Sponsored by:   Arm Ltd
Differential Revision:  https://reviews.freebsd.org/D43311
DeltaFile
+438-0tests/sys/arch/aarch64/sve.c
+46-0tests/sys/arch/aarch64/sve_ptrace_helper.c
+8-0tests/sys/arch/aarch64/Makefile
+5-0tests/sys/arch/Makefile
+3-0tests/sys/arch/Makefile.inc
+2-0etc/mtree/BSD.tests.dist
+502-01 files not shown
+503-07 files

HardenedBSD/src 77df024sys/netinet6 ip6_mroute.c

ip6_mroute: VNETify counters

Commit a223d6c489c7 made most of the ip6_mroute state per-VNET, but
failed to do this for a couple of counter structures.  Make them
per-VNET too.

Reported by:    zlei
Reviewed by:    pouria, zlei
Fixes:          a223d6c489c7 ("ip6_mroute: Start putting global variables into a structure")
Differential Revision:  https://reviews.freebsd.org/D56253
DeltaFile
+10-8sys/netinet6/ip6_mroute.c
+10-81 files

HardenedBSD/src 04132e0sys/vm vm_fault.c

vm_fault: Reset m_needs_zeroing properly

- When allocating a page, we should only consider the PG_ZERO flag when
  handling the top-level page.
- Unconditionally reset the flag when restarting the fault handler.
  Previously, vm_fault_busy_sleep() would fail to reset it.

PR:             294039
Reviewed by:    kib
Tested by:      Peter Much <pmc at citylink.dinoex.sub.org>
MFC after:      3 days
Fixes:          cff67bc43df1 ("vm_fault: only rely on PG_ZERO when the page was newly allocated")
Differential Revision:  https://reviews.freebsd.org/D56234
DeltaFile
+3-4sys/vm/vm_fault.c
+3-41 files

HardenedBSD/src 8a68c25sys/kern imgact_elf.c

imgact_elf: Unconditionally initialize a variable in a note handler

In the sb == NULL case, we are computing the size of the note using a
dummy sbuf drain handler which counts bytes and discards the contents of
the buffer, so the fact that "structsize" is uninitialized doesn't
matter.  But, the compiler may complain about this, so we might as well
just initialize it unconditionally to silence the warning, as other
handlers already do.

PR:             292811
MFC after:      1 week
DeltaFile
+1-1sys/kern/imgact_elf.c
+1-11 files

HardenedBSD/src cf9949fsys/arm64/arm64 pmap.c

arm64: Optimise the repeated TLBI workaround

It has been reported that the overhead of repeating all TLBI
instructions is too large [1]. The Software Developer Errata Notices
(SDEN) for the relevant Arm CPUs have been updated so a single
"tlbi vale1is, xzr" followed by "dsb ish"  is sufficient to work around
the issues.

Replace the places we repeat TLBI instructions with the new sequence.

[1] https://lore.kernel.org/linux-arm-kernel/20260218164348.2022831-1-mark.rutland@arm.com/

Reviewed by:    kib
Sponsored by:   Arm Ltd
Differential Revision:  https://reviews.freebsd.org/D55646

(cherry picked from commit 80b4129bef8b908eb19fe47853cb6e45e4513d76)
DeltaFile
+14-30sys/arm64/arm64/pmap.c
+14-301 files

HardenedBSD/src 767f1aasys/arm64/include armreg.h

arm64: Fix the ESR_ELx_EC_MASK definition

Sponsored by:   Arm Ltd

(cherry picked from commit f4d1a3ab0271216df05bab14c641d8023cc43a04)
DeltaFile
+1-1sys/arm64/include/armreg.h
+1-11 files

HardenedBSD/src f6f5d92sys/arm64/arm64 trap.c

arm64: Have a common call to userret

Rather than each exception calling userret use a common copy. As
syscallret already calls userret we need to skip it in that case.

Reviewed by:    kib
Sponsored by:   Arm Ltd
Differential Revision:  https://reviews.freebsd.org/D55250

(cherry picked from commit 14e97448fcebbe4b038eaf5628933abe5f9e690d)
DeltaFile
+9-21sys/arm64/arm64/trap.c
+9-211 files

HardenedBSD/src ffaa67esys/arm64/include elf.h

arm64: Add more HWCAP values

Sponsored by:   Arm Ltd
Differential Revision:  https://reviews.freebsd.org/D55219

(cherry picked from commit 3a960425df759a7bb8f946d23f035c63f3a5de7a)
DeltaFile
+21-0sys/arm64/include/elf.h
+21-01 files

HardenedBSD/src 1d4a619sys/arm64/vmm vmm.c

arm64/vmm: Support PMU v3p9

The only new register is read-only. As the kernel just passes the
registers to the guest directly no further change should be needed.

Sponsored by:   Arm Ltd
Differential Revision:  https://reviews.freebsd.org/D51764

(cherry picked from commit d1650d226205cdf07fb19e0c9b10b47b941e8747)
DeltaFile
+1-1sys/arm64/vmm/vmm.c
+1-11 files

HardenedBSD/src 920f5f6sys/arm64/arm64 identcpu.c

arm64: Treat the PMUVer field of ID_AA64DFR0 as unsigned

The PMUVer field of ID_AA64DFR0 contains an unsigned version of the
Performance Monitors Extension, but it is currently treated as signed.
Change it to unsigned.

Reviewed by:    andrew
Sponsored by:   Arm Ltd
Signed-off-by:  Kajetan Puchalski <kajetan.puchalski at arm.com>
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2062

(cherry picked from commit e40e5458616d13b44cd407aa1afff620f8ff8766)
DeltaFile
+1-1sys/arm64/arm64/identcpu.c
+1-11 files

HardenedBSD/src db2a34bsbin/nvmecontrol identify_ext.c

nvmecontrol: Remove an incorrect use of PAGE_SIZE

The mdts value is in terms of the nvme page size, not the host page
size. On many architectures these are both 4k, however on arm64 it is
possible to build a system with the host page size of 16k.

Use NVME_MPS_SHIFT to get the correct nvme page shift.

Reviewed by:    imp
Sponsored by:   Arm Ltd
Differential Revision:  https://reviews.freebsd.org/D55334

(cherry picked from commit bfb7c81f93b534f8c10928d80ea56c8177a6f39f)
DeltaFile
+1-1sbin/nvmecontrol/identify_ext.c
+1-11 files

HardenedBSD/src b608ec4sys/arm64/arm64 copyinout.S copyinout_ifunc.c, sys/conf files.arm64

arm64: Add MOPS implementations of copyin/copyout

Reimplement copyin() & copyout() as ifuncs.

Reviewed by:    andrew
Sponsored by:   Arm Ltd
Differential Revision:  https://reviews.freebsd.org/D54947

(cherry picked from commit 1224347817c450596797ae6bcbfcc81927cb1f88)
DeltaFile
+52-6sys/arm64/arm64/copyinout.S
+50-0sys/arm64/arm64/copyinout_ifunc.c
+1-0sys/conf/files.arm64
+103-63 files

HardenedBSD/src 91ce7a1sys/dev/virtio/gpu virtio_gpu.c

vtgpu: Support virtio gpu on Parallels Desktop

The Parallels Desktop Virtio GPU implementation doesn't handle
enqueuing the VIRTIO_GPU_CMD_RESOURCE_ATTACH_BACKING request and
memory list together.

Work around this by splitting them before sending them to be enqueued.

Sponsored by:   Arm Ltd
Differential Revision:  https://reviews.freebsd.org/D55147

(cherry picked from commit 1ea0721e1a566fdb552b0a919c22667844a894d9)
DeltaFile
+38-13sys/dev/virtio/gpu/virtio_gpu.c
+38-131 files

HardenedBSD/src 44d6e17sys/arm64/arm64 machdep.c memcpy.S, sys/arm64/include cpu.h

arm64: Add MOPS implementations of memset(), memcpy() and memmove()

Enable the use of MOPS implementations of memset, memcpy and memmove within
the kernel. Fix pre-ifunc resolution uses of these functions.

Reported by:    andrew
Sponsored by:   Arm Ltd
Differential Revision:  https://reviews.freebsd.org/D55051

(cherry picked from commit 2ccbf06c0285ca1c06681e7212da8e7d1e87fe19)
DeltaFile
+36-2sys/arm64/arm64/machdep.c
+20-4sys/arm64/arm64/memcpy.S
+10-2sys/arm64/arm64/memset.S
+5-5sys/arm64/arm64/pmap.c
+6-1sys/arm64/include/cpu.h
+3-2sys/arm64/arm64/identcpu.c
+80-161 files not shown
+81-177 files

HardenedBSD/src c91d1desys/arm64/arm64 identcpu.c

arm64: Move creating the ID register views earlier

These are needed when enabling CPU features so should be processed
earlier in the boot.

Sponsored by:   Arm Ltd
Differential Revision:  https://reviews.freebsd.org/D55103

(cherry picked from commit 0ea31fe851344af022103fa81dcdf00ef0dddc1d)
DeltaFile
+26-13sys/arm64/arm64/identcpu.c
+26-131 files

HardenedBSD/src 7a70c9fsys/arm64/arm64 identcpu.c

arm64: Panic if the ID register isn't known

This will allow for callers to be simplified & not need to check the
return status.

Keep the return type for now so this can be MFCd without breaking the
KBI.

Sponsored by:   Arm Ltd
Differential Revision:  https://reviews.freebsd.org/D55104

(cherry picked from commit 3b0b6aa2cd05b516ecf4b72f9a3c2aadddf3c94e)
DeltaFile
+2-2sys/arm64/arm64/identcpu.c
+2-21 files