HardenedBSD/src 5a22d13contrib/llvm-project/openmp/runtime/src z_Linux_util.cpp kmp_settings.cpp, share/man/man4 smsc.4

Merge branch 'freebsd/current/main' into hardened/current/master
DeltaFile
+6-6share/man/man4/smsc.4
+4-5sys/compat/linuxkpi/common/include/linux/io.h
+3-3contrib/llvm-project/openmp/runtime/src/z_Linux_util.cpp
+2-2sys/dev/usb/net/if_smsc.c
+2-0contrib/llvm-project/openmp/runtime/src/kmp_settings.cpp
+1-1sys/dev/nvme/nvme.h
+18-176 files

HardenedBSD/src ebcfab9sys/dev/nvme nvme.h

nvme: Explicitly align struct nvme_command on an 8 byte boundary

This was already true for most architectures due to uint64_t structure
members.  However, i386 is special in that it only requires 4 byte
alignment for uint64_t.  As a result, casts from struct nvme_command
to struct nvmf_fabric_cmd were raising a "cast increases alignment"
warning on i386.  Explicitly aligning struct nvme_command pacifies
this warning on i386.

Reported by:    rscheff
Sponsored by:   Chelsio Communications
DeltaFile
+1-1sys/dev/nvme/nvme.h
+1-11 files

HardenedBSD/src 2ae0f5asys/compat/linuxkpi/common/include/linux io.h

linuxkpi: Make arch_io_*_memtype_wc amd64-only

Linux only implements these functions on x86.  They return 0 on other
architectures.  The FreeBSD implementation calls PHYS_TO_DMAP but this
panics on i386 because it does not have a direct map so return 0 on i386
as well for now.  These functions are only used by graphics/drm-*-kmod
to mark the VRAM aperture write-combining but this is also accomplished
by a call to vm_phys_fictitious_reg_range so this change is sufficient
to fix drm-*-kmod on i386 for FreeBSD 14.1.

Reviewed by:    kib
MFC after:      3 days
Differential Revision:  https://reviews.freebsd.org/D45125
DeltaFile
+4-5sys/compat/linuxkpi/common/include/linux/io.h
+4-51 files

HardenedBSD/src 22b3e78contrib/llvm-project/openmp/runtime/src kmp_settings.cpp

Merge commit 73bb8d9d92f6 from llvm-project (by Jonathan Peyton):

  [OpenMP] Fix child processes to use affinity_none (#91391)

  When a child process is forked with OpenMP already initialized, the
  child process resets its affinity mask and sets proc-bind-var to false
  so that the entire original affinity mask is used. This patch corrects
  an issue with the affinity initialization code setting affinity to
  compact instead of none for this special case of forked children.

  The test trying to catch this only testing explicit setting of
  KMP_AFFINITY=none. Add test run for no KMP_AFFINITY setting.

  Fixes: #91098

This should fix OpenMP processes sometimes getting stuck on a single CPU
core.

PR:             278845

    [2 lines not shown]
DeltaFile
+2-0contrib/llvm-project/openmp/runtime/src/kmp_settings.cpp
+2-01 files

HardenedBSD/src da15ed2contrib/llvm-project/openmp/runtime/src z_Linux_util.cpp

Merge commit 5300a6731e98 from llvm-project (by Jonathan Peyton):

  [OpenMP] Fix re-locking hang found in issue 86684 (#88539)

  This was initially reported here (including stacktraces):
  https://stackoverflow.com/questions/78183545/does-compiling-imagick-with-openmp-enabled-in-freebsd-13-2-cause-sched-yield

  If `__kmp_register_library_startup()` detects that another instance of
  the library is present, `__kmp_is_address_mapped()` is eventually
  called. which uses `kmpc_alloc()` to allocate memory. This function
  calls `__kmp_entry_thread()` to access the thread-local memory pool,
  which is a bad idea during initialization. This macro internally calls
  `__kmp_get_global_thread_id_reg()` which sets the bootstrap lock at the
  beginning (before calling `__kmp_register_library_startup()`).

  The fix is to use `KMP_INTERNAL_MALLOC()`/`KMP_INTERNAL_FREE()` instead
  of `kmpc_malloc()`/`kmpc_free()`. `KMP_INTERNAL_MALLOC` and
  `KMP_INTERNAL_FREE` do not use any bootstrap locks. They just translate
  to `malloc()`/`free()` and are meant to be used during library

    [11 lines not shown]
DeltaFile
+3-3contrib/llvm-project/openmp/runtime/src/z_Linux_util.cpp
+3-31 files

HardenedBSD/src 7ef6ce5share/man/man4 smsc.4, sys/dev/usb/net if_smsc.c

smsc(4): update to mention Microchip

Microchip Technology acquired SMSC in 2012, and all current products
and datasheets refer to the devices supported by this driver as
Microchip parts.  Mention SMSC in a parenthetical comment to explain
the driver's name.

Reviewed by:    imp
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D45115
DeltaFile
+6-6share/man/man4/smsc.4
+2-2sys/dev/usb/net/if_smsc.c
+8-82 files

HardenedBSD/src 6f34ceflib/libthr/thread thr_syscalls.c, sys/amd64/vmm vmm_dev.c

Merge branch 'freebsd/current/main' into hardened/current/master
DeltaFile
+15-14sys/arm64/vmm/vmm_dev.c
+5-20lib/libthr/thread/thr_syscalls.c
+7-8sys/amd64/vmm/vmm_dev.c
+9-1sys/netinet/tcp_sack.c
+5-3usr.bin/netstat/inet.c
+4-1sys/netinet/tcp_output.c
+45-478 files not shown
+55-5814 files

HardenedBSD/src 6c8519dsys/kern vfs_vnops.c, sys/netgraph ng_pipe.c

Merge branch 'freebsd/14-stable/main' into hardened/14-stable/master
DeltaFile
+38-38usr.bin/ctags/C.c
+48-25sys/netgraph/ng_pipe.c
+21-16sys/sys/sdt.h
+11-11usr.bin/ctags/ctags.c
+12-4sys/kern/vfs_vnops.c
+6-6usr.bin/ctags/fortran.c
+136-10014 files not shown
+164-12920 files

HardenedBSD/src 5d62025usr.sbin/bhyve gdb.c

bhyve: Do not define GDB_LOG

This had been added for debugging and shouldn't have been committed.

Fixes:          f81cdf24ba54 ("bhyve: Add support for XML register definitions")
MFC after:      3 days
DeltaFile
+0-1usr.sbin/bhyve/gdb.c
+0-11 files

HardenedBSD/src e333364sys/amd64/vmm vmm_dev.c, sys/arm64/vmm vmm_dev.c

vmm: Start reconciling amd64 and arm64 copies of vmm_dev.c

Most of the code in vmm_dev.c and vmm.c can and should be shared between
amd64 and arm64 (and eventually riscv) rather than being duplicated.  To
the end of adding a shared implementation in sys/dev/vmm, this patch
eliminates most of the differences between the two copies of vmm_dev.c.

- Remove an unneeded cdefs.h include.
- Simplify the amd64 implementation of vcpu_unlock_one().
- Simplify the arm64 implementation of vcpu_lock_one().
- Pass buffer sizes to alloc_memseg() and get_memseg() on arm64.  On
  amd64 this is needed for compat ioctls, but these functions should be
  merged.
- Make devmem_mmap_single() stricter on arm64.

Reviewed by:    corvink, jhb
Differential Revision:  https://reviews.freebsd.org/D44995
DeltaFile
+15-14sys/arm64/vmm/vmm_dev.c
+7-8sys/amd64/vmm/vmm_dev.c
+22-222 files

HardenedBSD/src ffbaa45usr.sbin/bsdinstall/scripts config

bsdinstall: Stop loading cryptodev for ZFS installations

- zfs depends on the crypto module, not cryptodev, and most arm64 kernel
  configs include std.dev, which includes "device crypto" anyway.
- This config works around a problem with kldxref lacking cross-target
  support, but that has since been fixed.
- Loading cryptodev creates /dev/crypto, which gives unprivileged users
  access to the kernel's opencrypto framework.  Very few applications
  need it, so we're needlessly increasing the kernel's surface area.

Thus, stop auto-loading cryptodev.

Reviewed by:    kevans, allanjude, des
Differential Revision:  https://reviews.freebsd.org/D45127
DeltaFile
+0-3usr.sbin/bsdinstall/scripts/config
+0-31 files

HardenedBSD/src 2a32b54contrib/ofed/libibverbs libibverbs.map

ofed: don't expose symbols twice

ibv_init_wq and ibv_cleanup_wq are made visible with the
default_symver which puts them in the IBVERBS_1.1 ABI.  Don't
try to expose them as IBVERBS_PRIVATE_14 symbols as GNU ld
complains with --no-undefined-symbol.

Reviewed by:    kib
Differential Revision:  https://reviews.freebsd.org/D45090
DeltaFile
+0-2contrib/ofed/libibverbs/libibverbs.map
+0-21 files

HardenedBSD/src eb5fd01tests/sys/vm/soxstack soxstack.c

soxstack: slience 32-bit gcc warning

Modern GCC complains when casting pointers to integers of a different
size (even a larger one).  Switch from uint64_t to uintptr_t which will
always be the right size for a stack address instead of maybe being too
big.

Reviewed by:    dchagin, emaste
Differential Revision:  https://reviews.freebsd.org/D45087
DeltaFile
+2-2tests/sys/vm/soxstack/soxstack.c
+2-21 files

HardenedBSD/src ec2b6b1lib/libthr/thread thr_syscalls.c thr_private.h

libthr: avoid varargs in fcntl and openat interposers

Align these signatures with the ones in syscalls.master (and thus
libsys.h).  There's no reason to do va_args twice and in some ABIs
(e.g,, CheriABI) you can't access fixed arguments as varargs if you
weren't called with varargs signature.

Reviewed by:    imp, kib, jhibbits
Obtained from:  CheriBSD
Differential Revision:  https://reviews.freebsd.org/D45126
DeltaFile
+5-20lib/libthr/thread/thr_syscalls.c
+2-2lib/libthr/thread/thr_private.h
+7-222 files

HardenedBSD/src 50af25esys/netgraph ng_pipe.c

ng_pipe: Do not panic when memory allocations fail

Signed-off-by: Martin Vahlensieck <git at academicsolutions.ch>

Reviewed by:    markj
MFC after:      2 weeks
Pull Request:   https://github.com/freebsd/freebsd-src/pull/1181

(cherry picked from commit d44c78074d8738db67a2fa6bf07b630c61eee6ab)
DeltaFile
+30-15sys/netgraph/ng_pipe.c
+30-151 files

HardenedBSD/src f4ab464sys/netgraph ng_pipe.c

ng_pipe: Replace deprecated random() with prng32_bounded()

Signed-off-by: Martin Vahlensieck <git at academicsolutions.ch>

MFC after:      2 weeks
Reviewed by:    markj
Pull Request:   https://github.com/freebsd/freebsd-src/pull/1181

(cherry picked from commit a3ecf8c7863683e53c77a17f96ab7012352265b9)
DeltaFile
+3-2sys/netgraph/ng_pipe.c
+3-21 files

HardenedBSD/src a709ac6sys/netgraph ng_pipe.c

ng_pipe: Fix whitespace

Signed-off-by: Martin Vahlensieck <git at academicsolutions.ch>

Reviewed by:    markj
MFC after:      2 weeks
Pull Request:   https://github.com/freebsd/freebsd-src/pull/1181

(cherry picked from commit 8512311fb5004444f43701eb122b6d77c76d7564)
DeltaFile
+8-8sys/netgraph/ng_pipe.c
+8-81 files

HardenedBSD/src f55be6dcontrib/netbsd-tests/fs/tmpfs t_times.sh

tmpfs tests: Remove an xfail annotation

This test passes after commit 08f3d5b60cdf ("copy_file_range: Call
vn_rdwr() at least once").

PR:             274615
MFC after:      1 month

(cherry picked from commit 8eb21b4ff0082a707517f805cf14616f91d9218e)
DeltaFile
+0-2contrib/netbsd-tests/fs/tmpfs/t_times.sh
+0-21 files

HardenedBSD/src e3b27ccsys/kern vfs_vnops.c

copy_file_range: Call vn_rdwr() at least once

This ensures that we invoke VOP_READ on the input file even if it's
empty, which in turn helps ensure that filesystems update the atime of
the file.

PR:             274615
Reviewed by:    olce, rmacklem, kib
MFC after:      1 month
Differential Revision:  https://reviews.freebsd.org/D43524

(cherry picked from commit 08f3d5b60cdfff434e391d96cdffc5a90c550b07)
DeltaFile
+12-4sys/kern/vfs_vnops.c
+12-41 files

HardenedBSD/src a3ca254sys/netgraph ng_pipe.c

ng_pipe: Remove node when all hooks are disconnected

This is the behavior described in the man page.

Signed-off-by: Martin Vahlensieck <git at academicsolutions.ch>

Discussed with: glebius
Reviewed by:    markj
MFC after:      2 weeks
Pull Request:   https://github.com/freebsd/freebsd-src/pull/1181

(cherry picked from commit bb2ab7a374b9d81f8368acc506c9700af20a22d6)
DeltaFile
+7-0sys/netgraph/ng_pipe.c
+7-01 files

HardenedBSD/src 95cb702sys/arm/include armreg.h

arm: Remove duplicate definitions in armreg.h

No functional change intended.

MFC after:      1 week

(cherry picked from commit 4a5e2ddbd8943baf7add831ab835594ac60f94d1)
DeltaFile
+0-2sys/arm/include/armreg.h
+0-21 files

HardenedBSD/src 7b65987sys/sys sdt.h

sdt: Add macros which expand to probe and provider structure names

No functional change intended.

MFC after:      1 week

(cherry picked from commit 4afce4473db4f51acd034333b8506294b4fb61e6)
DeltaFile
+21-16sys/sys/sdt.h
+21-161 files

HardenedBSD/src ebc5b3busr.bin/ctags C.c ctags.c

ctags: Use C99 bool instead of defining our own

Use stdbool.h definitions instead of defining non-standard ones.

Signed-off-by: Collin Funk <collin.funk1 at gmail.com>

Reviewed by:    markj
MFC after:      2 weeks
Pull Request:   https://github.com/freebsd/freebsd-src/pull/1107

(cherry picked from commit 87b0195ace1a71a1a07244890be3aaef72e1ffcd)
DeltaFile
+38-38usr.bin/ctags/C.c
+11-11usr.bin/ctags/ctags.c
+6-6usr.bin/ctags/fortran.c
+5-6usr.bin/ctags/ctags.h
+5-5usr.bin/ctags/yacc.c
+4-4usr.bin/ctags/lisp.c
+69-701 files not shown
+70-717 files

HardenedBSD/src 3f6515csys/dev/iicbus if_ic.c, sys/dev/wg if_wg.c

bpf: Make BPF interop consistent with if_loop

The pseudo_AF_HDRCMPLT check is already being done in if_loop and
just needed to be ported over to if_ic, if_wg, if_disc, if_gif,
if_gre, if_me, if_tuntap and ng_iface.  This is needed in order to
allow these interfaces to work properly with e.g., tcpreplay.

PR:             256587
Reviewed by:    markj
MFC after:      2 weeks
Pull Request:   https://github.com/freebsd/freebsd-src/pull/876

(cherry picked from commit 2cb0fce24d64039090dc9243cdf0715ee80c91b1)
DeltaFile
+2-2sys/dev/iicbus/if_ic.c
+2-1sys/net/if_me.c
+2-1sys/dev/wg/if_wg.c
+2-1sys/net/if_gif.c
+2-1sys/net/if_gre.c
+1-1sys/net/if_tuntap.c
+11-72 files not shown
+13-98 files

HardenedBSD/src 2a9aae9sys/netinet tcp_output.c tcp_var.h, usr.bin/netstat inet.c

tcp: add counter to track when SACK loss recovery uses TSO

Add a counter to track how frequently SACK has transmitted
more than one MSS using TSO. Instances when this will be
beneficial is the use of PRR, or when ACK thinning due to
GRO/LRO or ACK discards by the network are present.

Reviewed By:            tuexen, #transport
Sponsored by:           NetApp, Inc.
Differential Revision:  https://reviews.freebsd.org/D45070
DeltaFile
+5-3usr.bin/netstat/inet.c
+3-0sys/netinet/tcp_output.c
+2-1sys/netinet/tcp_var.h
+1-0sys/netinet/in_kdtrace.h
+1-0sys/netinet/in_kdtrace.c
+12-45 files

HardenedBSD/src dcdfe44sys/netinet tcp_sack.c tcp_var.h

tcp: add sysctl to allow/disallow TSO during SACK loss recovery

Introduce net.inet.tcp.sack.tso for future use when TSO is ready
to be used during loss recovery.

Reviewed By:            tuexen, #transport
Sponsored by:           NetApp, Inc.
Differential Revision:  https://reviews.freebsd.org/D45068
DeltaFile
+5-0sys/netinet/tcp_sack.c
+2-0sys/netinet/tcp_var.h
+1-1sys/netinet/tcp_output.c
+8-13 files

HardenedBSD/src 670f0efsbin/ifconfig carp.c ifconfig.8, sys/netinet ip_carp.c ip_carp.h

Merge branch 'freebsd/current/main' into hardened/current/master
DeltaFile
+724-202sys/netinet/ip_carp.c
+97-1tests/sys/netinet/carp.sh
+57-11sbin/ifconfig/carp.c
+51-4sys/netinet/ip_carp.h
+15-1sbin/ifconfig/ifconfig.8
+14-0tests/sys/netinet/carp.py
+958-21910 files not shown
+995-22216 files

HardenedBSD/src f1de345release Makefile.mirrors

Merge branch 'freebsd/14-stable/main' into hardened/14-stable/master
DeltaFile
+14-0release/Makefile.mirrors
+14-01 files

HardenedBSD/src cbf3575sys/netinet tcp_sack.c

tcp: filter small SACK blocks

While the SACK Scoreboard in the base stack limits
the number of holes by default to only 128 per connection
in order to prevent CPU load attacks by splitting SACKs,
filtering out SACK blocks of unusually small size can
further improve the actual processing of SACK loss recovery.

Reviewed By:            tuexen, #transport
Sponsored by:           NetApp, Inc.
Differential Revision:  https://reviews.freebsd.org/D45075
DeltaFile
+4-1sys/netinet/tcp_sack.c
+4-11 files

HardenedBSD/src 301ec2csys/netpfil/pf pf.c

pf: always mark states as unlinked before detaching them

Users have reported crashes in pf_test_state_udp() where at least one state key
is NULL.

That suggests that pf_detach_state() ran concurrently with pf_test_state_udp().
pf_test_state_udp() holds the state lock (aka the id lock), but
pf_detach_state() does not.
The intent is that detached states are not returned by STATE_LOOKUP/
pf_find_state(), as the state's timeout is set to PFTM_UNLINKED and thus
pf_find_state() does not find the state.

There are other paths to pf_detach_state() (outside of pf_unlink_state())
though, where we did not set the timeout to PFTM_UNLINKED. Fix those, and assert
that the timeout is set correctly when we enter pf_detach_state().

MFC after:      1 week
See also:       https://redmine.pfsense.org/issues/15413
Sponsored by:   Rubicon Communications, LLC ("Netgate")
Differential Revision:  https://reviews.freebsd.org/D45101
DeltaFile
+3-0sys/netpfil/pf/pf.c
+3-01 files