FreeBSD/src b5d570elib/libfetch common.c

libfetch: Gracefully skip unsupported protocols

If socket() fails because the address family or protocol is unsupported,
just continue with the next address.

MFC after:      1 week
Reviewed by:    imp
Differential Revision:  https://reviews.freebsd.org/D55407
DeltaFile
+5-1lib/libfetch/common.c
+5-11 files

FreeBSD/src afbdcd4lib/libfetch common.c

libfetch: Fail hard if interrupted while connecting

This fixes an issue where the first address that DNS returns is blocked
by a packet filter, so we hang for a while, then the user hits Ctrl-C,
interrupting connect(2), whereupon we move on to the next address, get
a connection, request the file, and return to fetch(1), which sees that
SIGINT was caught and bails.

Note that we make no attempt to enforce fetchTimeout in the connection
phase, and never have.  It's feasible, but non-trivial, so we'll leave
it as an exercise for future us.

PR:             293312
MFC after:      1 week
Reviewed by:    imp
Differential Revision:  https://reviews.freebsd.org/D55406
DeltaFile
+7-1lib/libfetch/common.c
+7-11 files

FreeBSD/src 1b7c4d2lib/libfetch common.c

libfetch: Clean up fetch_info usage

* Provide a wrapper for the common if (verbose) fetch_info(...) idiom.

* Replace remaining instances of fprintf(stderr, ...) with fetch_info().

* Fix a few style nits.

MFC after:      1 week
Reviewed by:    imp
Differential Revision:  https://reviews.freebsd.org/D55405
DeltaFile
+34-54lib/libfetch/common.c
+34-541 files

FreeBSD/src d1f1402lib/libnetbsd/sys cdefs.h

libnetbsd: import `__CTASSERT(..)` macros

These compile-time assert macros are similar to `Static_assert` on FreeBSD.

These macros are in use in newer versions of `contrib/netbsd-tests`.

Obtained from:  https://github.com/NetBSD/src (c26cc77b3a0b26b95a2)
MFC after:      1 week
DeltaFile
+16-0lib/libnetbsd/sys/cdefs.h
+16-01 files

FreeBSD/src e188655sys/netinet tcp_subr.c

tcp: improve validation of received TCP over UDP packets

Reviewed by:            glebius, pouria
MFC after:              3 days
Sponsored by:           Netflix, Inc.
Differential Revision:  https://reviews.freebsd.org/D55410
DeltaFile
+17-5sys/netinet/tcp_subr.c
+17-51 files

FreeBSD/src 1602f00sbin/nvmecontrol nvmecontrol.8 fabrics.c, sys/dev/nvmf nvmf.h

nvmf: Limit the default I/O queue size to 128 entries

Previously the size defaulted to the maximum supported size reported
by the remote host.  The value of 128 matches the default on Linux and
avoids excessive resource usage for I/O queues.

Sponsored by:   Chelsio Communications
DeltaFile
+3-3sbin/nvmecontrol/nvmecontrol.8
+2-1sys/dev/nvmf/nvmf.h
+2-1tools/tools/nvmf/nvmfdd/nvmfdd.c
+1-1sbin/nvmecontrol/fabrics.c
+8-64 files

FreeBSD/src 0788e7cusr.sbin/ctld nvmf.cc

ctld: Honor the default maximum I/O queue size for NVMeoF controllers

<dev/nvmf.h> exports a constant to set the default maximum I/O queue
size which is used by ctl(4) if an explicit size is not set.  This
value was chosen to match Linux's default, but it also avoids
excessive resource usage for I/O queues.

ctld was using the absolute maxium size as the default instead.

Sponsored by:   Chelsio Communications
DeltaFile
+1-4usr.sbin/ctld/nvmf.cc
+1-41 files

FreeBSD/src 102fed0share/man/man5 src.conf.5

src.conf.5: Fix "incompatibility" typo

MFC after:      3 days
Reviewed by:    ziaee
Signed-off-by:  Christos Longros <chris.longros at gmail.com>
Closes:         https://github.com/freebsd/freebsd-src/pull/2035
DeltaFile
+1-1share/man/man5/src.conf.5
+1-11 files

FreeBSD/src 49fa007tests/sys/netlink test_rtnl_gre.c

gre tests: Fix gcc warnings on gre netlink tests

Avoid using `snl_add_msg_attr_ip` for now and directly use
`snl_add_msg_attr_ip4` to silence gcc warnings.

Fixes: e1e18cc12e68
Differential Revision: https://reviews.freebsd.org/D54443
DeltaFile
+5-7tests/sys/netlink/test_rtnl_gre.c
+5-71 files

FreeBSD/src f16349flib/libsys/arm Makefile.sys

libsys/arm: include ARM EABI unwind bits into libsys

libsys required ARM EABI unwind symbols like __aeabi_unwind_cpp_pr0.
These symbols are normally provided by libc, but if a binary does
not link libc, the symbol ends up not being resolved.

Among other problems, this prevented gcc14 and newer from building
on arm.

Add the relevant symbols as hidden symbols into libsys to avoid this
problem.

(this patch was posted by jrtc27 who has asked me to move it along)

PR:             292539
Tested by:      fuz, Mark Millard <marklmi26-fbsd at yahoo.com>
Reviewed by:    mmel
Approved by:    markj (mentor)
MFC after:      1 week

    [3 lines not shown]
DeltaFile
+5-0lib/libsys/arm/Makefile.sys
+5-01 files

FreeBSD/src eac62e1lib/libc/arm/aeabi aeabi_unwind_cpp.c

libc/arm: use __builtin_trap() instead of abort() in aeabi_unwind stubs

This avoids a dependency on the abort symbol in libsys.

PR:             292539
Reviewed by:    mmel
Approved by:    markj (mentor)
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D55255

(cherry picked from commit 1782bc9a0a8da2d6aca31b7790981e1980c9e4b9)
DeltaFile
+6-6lib/libc/arm/aeabi/aeabi_unwind_cpp.c
+6-61 files

FreeBSD/src 499d0f0usr.sbin/bhyve/amd64 atkbdc.h

bhyve: Add SPDX-License-Identifier tag

Reviewed by: emaste
Sponsored by: The FreeBSD Foundation
DeltaFile
+2-0usr.sbin/bhyve/amd64/atkbdc.h
+2-01 files

FreeBSD/src 89d7b30sys/amd64/include cpufunc.h, sys/i386/include cpufunc.h

i386,amd64: Explicitly set ECX=0 in do_cpuid() to be future-proof

In principle, do_cpuid() should only be used for CPUID leaves without
sub-leaves.  Even accessing sub-leaf zero (ECX=0), one must use
cpuid_count(ax, 0) rather than cpuid(ax).

However, one might assume do_cpuid(ax) is equivalent to
cpuid_count(ax, 0), but the old do_cpuid() did not initialize ECX before
executing the CPUID instruction.  If ECX contained a non-zero value, the
instruction could return unexpected results, potentially leading to
subtle and hard-to-debug issues, especially in ported code.

To be future-proof and to help port code, adjust do_cpuid(ax) to be
cpuid_count(ax, 0) to explicitly set ECX=0.

It's believed that this change does not fix any real bugs in FreeBSD.

See also the DragonFly commit:
https://github.com/DragonFlyBSD/DragonFlyBSD/commit/0087a1d163488a57787a9a6431dd94070b1988d4

    [4 lines not shown]
DeltaFile
+6-20sys/i386/include/cpufunc.h
+6-8sys/amd64/include/cpufunc.h
+12-282 files

FreeBSD/src 836ac98usr.sbin/fstyp zfs.c ufs.c

fstyp: Add SPDX-License-Identifier tags

Reviewed by: emaste
Sponsored by: The FreeBSD Foundation
DeltaFile
+2-0usr.sbin/fstyp/zfs.c
+2-0usr.sbin/fstyp/ufs.c
+2-0usr.sbin/fstyp/ntfs.c
+2-0usr.sbin/fstyp/msdosfs.h
+2-0usr.sbin/fstyp/msdosfs.c
+2-0usr.sbin/fstyp/hfsplus.c
+12-011 files not shown
+34-017 files

FreeBSD/src f1b93fcsys/x86/cpufreq hwpstate_amd.c

hwpstate_amd(4): Fix punctuation in 'desired_performance' knob's description

To be consistent with that of the others.

No functional change.

Sponsored by:   The FreeBSD Foundation
DeltaFile
+1-1sys/x86/cpufreq/hwpstate_amd.c
+1-11 files

FreeBSD/src 80d32a6sys/x86/cpufreq hwpstate_amd.c

hwpstate_amd(4): CPPC: Switch the default to maximum performance

Set controls to maximum performance to avoid regressions now that CPPC
is activated by default and to match what the P-state support does.

Relnotes:       yes
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D55253
DeltaFile
+10-8sys/x86/cpufreq/hwpstate_amd.c
+10-81 files

FreeBSD/src 953b916sys/kern kern_cpu.c

cpufreq(4): cpufreq_levels_sysctl(): Remove always false NULL test

'sc->levels_buf' is initialized with malloc(M_WAITOK), so can never be
NULL.  Another sysctl handler function (cpufreq_curr_sysctl()) already
relies on that.

MFC after:      2 weeks
Sponsored by:   The FreeBSD Foundation
DeltaFile
+2-6sys/kern/kern_cpu.c
+2-61 files

FreeBSD/src b69a396sys/x86/cpufreq hwpstate_amd.c

hwpstate_amd(4): CPPC: Allow attaching even if CAPABILITY_1 cannot be read

If that MSR cannot be read, we fallback to defaults specified by the
ACPI specification, as we are already doing when the minimum and maximum
values in there look bogus.

Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D55252
DeltaFile
+28-17sys/x86/cpufreq/hwpstate_amd.c
+28-171 files

FreeBSD/src 7f36d7asys/x86/cpufreq hwpstate_amd.c

hwpstate_amd(4): Consistency of cached CPPC_REQUEST value

If writing to the CPPC_REQUEST MSR fails, make sure we do not set the
softc's 'cppc.request' field to the intended new value.  Both
set_cppc_request_cb() and enable_cppc_cb() were changed to this effect.

In case enable_cppc_cb() could not read CPPC_REQUEST, mark that through
a new softc flag, HWPFL_CPPC_REQUEST_NOT_READ, so that we do not keep
and use a wrong value when the content of CPPC_REQUEST is read/written
through sysctl(9) knobs, but instead retry reading the MSR (this is the
purpose of the new get_cppc_request() sub-function).

When setting CPPC_REQUEST has failed, distinguish the case where it
could not be read at all from the case where it could not be written, by
respectively returning EIO and EOPNOTSUPP in these cases.  The previous
return value of EFAULT was confusing as sysctl(3) documents it as
happening if the passed arguments are invalid.

While here, add some herald comment before sysctl_cppc_dump_handler()

    [5 lines not shown]
DeltaFile
+108-31sys/x86/cpufreq/hwpstate_amd.c
+108-311 files

FreeBSD/src 1635ba9tests/sys/netlink test_rtnl_gre.c

gre tests: Add required_kmods to gre netlink test

Fixes: e1e18cc12e68
Differential Revision: https://reviews.freebsd.org/D54443
DeltaFile
+1-0tests/sys/netlink/test_rtnl_gre.c
+1-01 files

FreeBSD/src ef1cde5sys/dev/asmc asmc.c

chore: asmc: use designated initializers in macros

This code cleanup makes it easier for human readers to understand what each
of the fields actually represents, as well as makes it easier to modify
what the macros actually do under the covers, without introducing
potential human errors.

No functional change intended.

MFC after:      1 week
DeltaFile
+33-18sys/dev/asmc/asmc.c
+33-181 files

FreeBSD/src 90edc16sys/dev/asmc asmc.c

asmc: use symbolic names with the MacPro3,1 model

Use `ASMC_LIGHT_FUNCS_DISABLED` and `ASMC_SMS_FUNCS_DISABLED` instead of
the unrolled versions of the macros.

This makes it easier to adjust the underlying macros/fields for
`struct asmc_model`.

No functional change intended.

MFC after:      1 week
DeltaFile
+2-2sys/dev/asmc/asmc.c
+2-21 files

FreeBSD/src 7b862cfsys/dev/asmc asmc.c

asmc: use `ASMC_FAN_FUNCS2` with the Macmini4,1

The Macmini4,1 model does not have "fansafespeed" support. This issue
typically manifests with messages like so:

```
asmc0: asmc_key_read for key F0Sf failed 10 times, giving up
```

Swap out `ASMC_FAN_FUNCS` with `ASMC_FAN_FUNCS2` to explicitly drop
"fansafespeed" checks in the driver for the model as it doesn't support
that hardware feature.

MFC after:      1 week
Reported by:    @probonopd
Closes:         https://github.com/helloSystem/ISO/issues/357
DeltaFile
+1-1sys/dev/asmc/asmc.c
+1-11 files

FreeBSD/src 15c33b6sys/netpfil/ipfilter/netinet fil.c

ipfilter: Fix possible overrun

The destination buffer is FR_GROUPLEN (16 bytes) in length. When
gname is created, the userspace utilities correctly use FR_GROUPLEN
as the buffer length. The kernel should also limit its copy operation to
FR_GROUPLEN bytes to avoid any user written code from exploiting this
vulnerability.

Reported by:    Ilja Van Sprundel <ivansprundel at ioactive.com>

(cherry picked from commit e40817302ebdf89df2f3bcd679fb7f2a18c244dc)
DeltaFile
+1-1sys/netpfil/ipfilter/netinet/fil.c
+1-11 files

FreeBSD/src bdf97b8sys/netpfil/ipfilter/netinet fil.c

ipfilter: Interface name must not extend beyond end of buffer

sifpidx (an interface name) cannot extend beyond the end of the
fr_names buffer.

We do the validation for fr_sifpidx here because it is a union that
contains an offset only when fr_sifpidx points to an interface name,
an offset into fr_names. The union is  an offset into fr_names in this
case only.

interr_tbl now becomes a static variable outside a function to facilitate
its use by two functions within fil.c

Note that sifpidx is only used in ipf_sync() which implments ipf -y.

Reported by:    Ilja Van Sprundel <ivansprundel at ioactive.com>
MFC after:      1 week

(cherry picked from commit 47fb51847fdea3f1cce841b5f2bbbcd6f8a04ee0)
DeltaFile
+21-2sys/netpfil/ipfilter/netinet/fil.c
+21-21 files

FreeBSD/src 6004313sys/netpfil/ipfilter/netinet fil.c

ipfilter: Interface name must not extend beyond end of buffer

sifpidx (an interface name) cannot extend beyond the end of the
fr_names buffer.

We do the validation for fr_sifpidx here because it is a union that
contains an offset only when fr_sifpidx points to an interface name,
an offset into fr_names. The union is  an offset into fr_names in this
case only.

interr_tbl now becomes a static variable outside a function to facilitate
its use by two functions within fil.c

Note that sifpidx is only used in ipf_sync() which implments ipf -y.

Reported by:    Ilja Van Sprundel <ivansprundel at ioactive.com>
MFC after:      1 week

(cherry picked from commit 47fb51847fdea3f1cce841b5f2bbbcd6f8a04ee0)
DeltaFile
+21-2sys/netpfil/ipfilter/netinet/fil.c
+21-21 files

FreeBSD/src 53e1019sys/netpfil/ipfilter/netinet fil.c

ipfilter: Fix possible overrun

The destination buffer is FR_GROUPLEN (16 bytes) in length. When
gname is created, the userspace utilities correctly use FR_GROUPLEN
as the buffer length. The kernel should also limit its copy operation to
FR_GROUPLEN bytes to avoid any user written code from exploiting this
vulnerability.

Reported by:    Ilja Van Sprundel <ivansprundel at ioactive.com>

(cherry picked from commit e40817302ebdf89df2f3bcd679fb7f2a18c244dc)
DeltaFile
+1-1sys/netpfil/ipfilter/netinet/fil.c
+1-11 files

FreeBSD/src afaf984sys/netpfil/ipfilter/netinet fil.c

ipfilter: Interface name must not extend beyond end of buffer

sifpidx (an interface name) cannot extend beyond the end of the
fr_names buffer.

We do the validation for fr_sifpidx here because it is a union that
contains an offset only when fr_sifpidx points to an interface name,
an offset into fr_names. The union is  an offset into fr_names in this
case only.

interr_tbl now becomes a static variable outside a function to facilitate
its use by two functions within fil.c

Note that sifpidx is only used in ipf_sync() which implments ipf -y.

Reported by:    Ilja Van Sprundel <ivansprundel at ioactive.com>
MFC after:      1 week

(cherry picked from commit 47fb51847fdea3f1cce841b5f2bbbcd6f8a04ee0)
DeltaFile
+21-2sys/netpfil/ipfilter/netinet/fil.c
+21-21 files

FreeBSD/src dda404esys/netpfil/ipfilter/netinet fil.c

ipfilter: Fix possible overrun

The destination buffer is FR_GROUPLEN (16 bytes) in length. When
gname is created, the userspace utilities correctly use FR_GROUPLEN
as the buffer length. The kernel should also limit its copy operation to
FR_GROUPLEN bytes to avoid any user written code from exploiting this
vulnerability.

Reported by:    Ilja Van Sprundel <ivansprundel at ioactive.com>

(cherry picked from commit e40817302ebdf89df2f3bcd679fb7f2a18c244dc)
DeltaFile
+1-1sys/netpfil/ipfilter/netinet/fil.c
+1-11 files

FreeBSD/src 0c49d9fsys/conf newvers.sh

14.3: Update to BETA3

Approved by:    re (implicit)
Sponsored by:   OpenSats Initiative
DeltaFile
+1-1sys/conf/newvers.sh
+1-11 files