FreeBSD/src c74a4ceusr.sbin/uhsoctl uhsoctl.c

usr.sbin/uhsoctl: correct SIOCDIFADDR calls to use ifreq

The SIOCDIFADDR ioctl takes an ifreq structure object, not an ifaliasreq
structure object, as its argument.

The ifreq structure does not include a separate mask field and the
SIOCDIFADDR ioctl handler does not require a network mask as opposed to
the ifaliasreq structure and the SIOCAIFADDR ioctl. Given that
SIOCAIFADDR and SIOCDIFADDR ioctls significantly differ and use
different structures for ioctl arguments, remove ifaddr_add() and move
its logic handling these ioctls to ifaddr_add()'s callers.

Reviewed by:    brooks, jhb, oshogbo
Accepted by:    oshogbo (mentor)
Obtained from:  CheriBSD
Differential Revision: https://reviews.freebsd.org/D46019
DeltaFile
+33-35usr.sbin/uhsoctl/uhsoctl.c
+33-351 files

FreeBSD/src bc06c51sys/net if.c, sys/netinet in.c

netinet: correct SIOCDIFADDR{,_IN6} calls to use {,in6_}ifreq

The SIOCDIFADDR{,_IN6} ioctls take an ifreq structure object, not an
ifaliasreq/in_aliasreq/in6_aliasreq structure object, as their argument.
As opposed to ifaliasreq/in_aliasreq/in6_aliasreq used by
SIOCAIFADDR{,_IN6}, the ifreq/in6_ifreq structures used by the
SIOCDIFADDR{,_IN6} ioctls do not include a separate field for a
broadcast address and other values required to add an address to a
network interface with SIOCAIFADDR{,_IN6}.

Whilst this issue is not specific to CHERI-extended architectures, it
was first observed on CheriBSD running on Arm Morello. For example,
incorrect calls using the in6_aliasreq object result in CHERI capability
violations. A pointer to the ifra_addr field in in6_aliasreq cast to the
ifru_addr union member of in6_ifreq results in bounds being set to the
union's larger size. Such bounds exceed the bounds of of in6_aliasreq
object and the bounds-setting instruction clears a tag of the object's
capability.


    [5 lines not shown]
DeltaFile
+2-4sys/net/if.c
+2-4sys/netinet/in.c
+3-3sys/netlink/route/iface.c
+7-113 files

FreeBSD/src 2ab5515usr.sbin/ppp iface.c

usr.sbin/ppp: correct SIOCDIFADDR{,_IN6} calls to use {,in6_}ifreq

The SIOCDIFADDR{,_IN6} ioctls take an ifreq structure object, not an
ifaliasreq structure object, as their argument.

Reviewed by:    brooks, jhb, oshogbo
Approved by:    oshogbo (mentor)
Obtained from:  CheriBSD
Differential Revision: https://reviews.freebsd.org/D46018
DeltaFile
+14-36usr.sbin/ppp/iface.c
+14-361 files

FreeBSD/src bb8fa2esbin/nos-tun nos-tun.c

sbin/nos-tun: correct SIOCDIFADDR calls to use ifreq

The SIOCDIFADDR ioctl takes an ifreq structure object, not an ifaliasreq
structure object, as its argument.

Reviewed by:    brooks, jhb, oshogbo
Approved by:    oshogbo (mentor)
Obtained from:  CheriBSD
Differential Revision: https://reviews.freebsd.org/D46017
DeltaFile
+3-5sbin/nos-tun/nos-tun.c
+3-51 files

FreeBSD/src 5688843sys Makefile

sys: Index netlink/ files with the cscope target

Reviewed by:    oshogbo
Approved by:    oshogbo (mentor)
Differential Revision: https://reviews.freebsd.org/D45934
DeltaFile
+1-1sys/Makefile
+1-11 files

FreeBSD/src 644b7b5lib/libpfctl libpfctl.c libpfctl.h, sbin/pfctl pfctl.c

pf: convert DIOCGETADDRS to netlink

Sponsored by:   Rubicon Communications, LLC ("Netgate")
DeltaFile
+56-0sys/netpfil/pf/pf_nl.c
+44-0lib/libpfctl/libpfctl.c
+26-16sys/netpfil/pf/pf_ioctl.c
+2-0lib/libpfctl/libpfctl.h
+1-1sbin/pfctl/pfctl.c
+1-0sys/net/pfvar.h
+130-171 files not shown
+131-177 files

FreeBSD/src 9ae91f5lib/libpfctl libpfctl.c libpfctl.h, sbin/pfctl pfctl.c

pf: convert DIOCGETADDR to netlink

Sponsored by:   Rubicon Communications, LLC ("Netgate")
DeltaFile
+63-0lib/libpfctl/libpfctl.c
+35-26sys/netpfil/pf/pf_ioctl.c
+49-0sys/netpfil/pf/pf_nl.c
+3-8sbin/pfctl/pfctl.c
+2-0lib/libpfctl/libpfctl.h
+1-0sys/netpfil/pf/pf_nl.h
+153-341 files not shown
+154-347 files

FreeBSD/src f1c4ed1sys/dev/cxgbe/iw_cxgbe device.c

cxgbe/iw_cxgbe: Add a placeholder uld_restart.

MFC after:      1 month
Sponsored by:   Chelsio Communications
DeltaFile
+8-0sys/dev/cxgbe/iw_cxgbe/device.c
+8-01 files

FreeBSD/src c1c5248sys/dev/cxgbe offload.h, sys/dev/cxgbe/tom t4_tom.c t4_listen.c

cxgbe/t4_tom: Implement uld_stop and uld_restart for ULD_TOM.

This allows the adapter to be suspended or reset even when stateful TOE is
active, in some limited configurations.

The LLD has already stopped the adapter hardware and all its queues by the time
these ULD routines get called.  The general approach in t4_tom is to purge the
lookup tables immediately so that they are ready for operation by the time the
adapter resumes, and park all the resources left hanging by the stopped hardware
into separate "stranded" queues that can be dealt with at leisure.

Outstanding active opens, live connections, and synq entries (for connections in
the middle of the 3-way handshake) are all treated as if the hardware had
reported an abrupt error for the tid.  The servers/listeners are a bit different
in that no error is reported.  They're just noted as non-functional when the
hardware stops and are recreated by the driver during restart.

MFC after:      1 month
Sponsored by:   Chelsio Communications
DeltaFile
+264-50sys/dev/cxgbe/tom/t4_tom.c
+122-14sys/dev/cxgbe/tom/t4_listen.c
+16-3sys/dev/cxgbe/tom/t4_tom.h
+6-5sys/dev/cxgbe/tom/t4_connect.c
+1-0sys/dev/cxgbe/offload.h
+409-725 files

FreeBSD/src 283333csys/dev/cxgbe/tom t4_listen.c t4_tom.c

cxgbe/t4_tom: Track all synq entries in a per-adapter list.

Live tid entries in tid_tab are either full fledged connections or synq
entries.  toep_list tracks the connections already and this change adds
a synqe_list to track the synq entries.  These two lists can be used to
enumerate and iterate over all live tids.

MFC after:      1 week
Sponsored by:   Chelsio Communications
DeltaFile
+12-0sys/dev/cxgbe/tom/t4_listen.c
+2-0sys/dev/cxgbe/tom/t4_tom.c
+2-0sys/dev/cxgbe/tom/t4_tom.h
+16-03 files

FreeBSD/src cd93fdesys/dev/cxgbe t4_l2t.c t4_l2t.h, sys/dev/cxgbe/tom t4_tom_l2t.c

cxgbe(4): Stop and restart the L2T allocator with the LLD.

L2T entries are used by both filters and TOE and the L2T is shared
between the base driver (LLD) and the TOM ULD.  Add a flag to indicate
that the L2T is stopped, which means:
* t4_alloc_l2e and t4_l2t_alloc_switching will not allocate new entries.
* t4_tom will ignore all ARP/NDP updates from the kernel.
* Previously allocated L2T entries can still be freed.

MFC after:      1 month
Sponsored by:   Chelsio Communications
DeltaFile
+33-3sys/dev/cxgbe/t4_l2t.c
+7-0sys/dev/cxgbe/tom/t4_tom_l2t.c
+4-1sys/dev/cxgbe/t4_l2t.h
+3-1sys/dev/cxgbe/t4_main.c
+47-54 files

FreeBSD/src fd3aca5sys/dev/cxgbe t4_main.c offload.h

cxgbe(4): Stop and restart the atid allocator with the LLD.

atids are used by both filters and TOE and the atid table is in the base
driver (LLD).  New atids cannot be allocated when the allocator is
stopped but existing ones can still be freed.  It is expected that the
owners of outstanding atids will release them in their own stop
processing, before the adapter is restarted.

MFC after:      1 month
Sponsored by:   Chelsio Communications
DeltaFile
+32-1sys/dev/cxgbe/t4_main.c
+1-0sys/dev/cxgbe/offload.h
+33-12 files

FreeBSD/src 5241b21sys/dev/cxgbe t4_main.c adapter.h

cxgbe(4): Basic infrastructure for ULDs to participate in adapter reset.

The suspend/resume/reset implementation in the base driver (LLD)
currently works when only stateless features are in use.  This commit
adds basic infrastructure for stateful upper layer drivers (ULDs) to
participate in suspend/resume/reset.

* Add a uld_restart to indicate that the adapter has been restarted
  after a stop and the ULD should resume operations.
* Move the existing functionality in t4_suspend/t4_resume to stop_lld and
  restart_lld.  Use these and the new uld restart routines everywhere the
  adapter has to be stopped abruptly and restarted, namely:
  1. PCIE bus suspend/resume/reset methods invoked by the kernel.
  2. Manual internal-reset using driver sysctl.
  3. Automatic internal-reset on a fatal error.
* Implement an alternate internal-reset for use in VMs and for testing.

Typical reset sequence is:
stop_adapter(sc);

    [13 lines not shown]
DeltaFile
+187-159sys/dev/cxgbe/t4_main.c
+9-1sys/dev/cxgbe/adapter.h
+1-0sys/dev/cxgbe/offload.h
+197-1603 files

FreeBSD/src fad8955usr.sbin/ntp/ntpd leap-seconds

leap-seconds: Update to leap-seconds 3960057600 obtained from IERS

IERS is the canonical source of leap-seconds. IANA, NIST and USNO obtain
their leap-second updates from IERS.

This resolves an issue for IPv6-only hosts as IERS is not accessible
via IPv6, requiring IPv6-only host to rely on some other source,
above.

From this point forward we should fetch the file from IERS, the
organization responsible for deciding when to insert leap-seconds.

PR:             279413
Obtained from:  https://hpiers.obspm.fr/iers/bul/bulc/ntp/leap-seconds.list
Discussed with: imp

(cherry picked from commit 04b4dcf04fc345b29b78e5061768091648b8ee2a)
DeltaFile
+89-224usr.sbin/ntp/ntpd/leap-seconds
+89-2241 files

FreeBSD/src 176f848libexec/rc rc.conf

rc.conf: Leap-seconds sources: Add IANA back

11da791920ba switched Leap-seconds source from IANA to IERS, as IERS
is the canonoical source. The problem ist that IERS is not accessible
from IPv6 only networks. To work around this we must add IANA back in
order to provide IPv6-only users a source for leap-seconds fetch.

PR:             279413
Fixes:          11da791920ba

(cherry picked from commit 66f360515d2829d261c0ad7bd516e9dd18c2dd83)
DeltaFile
+1-1libexec/rc/rc.conf
+1-11 files

FreeBSD/src 12f2e95usr.sbin/ntp/ntpd leap-seconds

leap-seconds: Update to leap-seconds 3960057600 obtained from IERS

IERS is the canonical source of leap-seconds. IANA, NIST and USNO obtain
their leap-second updates from IERS.

This resolves an issue for IPv6-only hosts as IERS is not accessible
via IPv6, requiring IPv6-only host to rely on some other source,
above.

From this point forward we should fetch the file from IERS, the
organization responsible for deciding when to insert leap-seconds.

PR:             279413
Obtained from:  https://hpiers.obspm.fr/iers/bul/bulc/ntp/leap-seconds.list
Discussed with: imp

(cherry picked from commit 04b4dcf04fc345b29b78e5061768091648b8ee2a)
DeltaFile
+89-224usr.sbin/ntp/ntpd/leap-seconds
+89-2241 files

FreeBSD/src 13f9c4alibexec/rc rc.conf

rc.conf: Leap-seconds sources: Add IANA back

11da791920ba switched Leap-seconds source from IANA to IERS, as IERS
is the canonoical source. The problem ist that IERS is not accessible
from IPv6 only networks. To work around this we must add IANA back in
order to provide IPv6-only users a source for leap-seconds fetch.

PR:             279413
Fixes:          11da791920ba

(cherry picked from commit 66f360515d2829d261c0ad7bd516e9dd18c2dd83)
DeltaFile
+1-1libexec/rc/rc.conf
+1-11 files

FreeBSD/src f48bfa2sys/dev/axgbe if_axgbe_pci.c

axgbe: Remove a nonsensical use of kernel_sysctlbyname()

No functional change intended.

MFC after:      1 week

(cherry picked from commit d254651de392538fa7f5c0020093dde0ca06c614)
DeltaFile
+2-12sys/dev/axgbe/if_axgbe_pci.c
+2-121 files

FreeBSD/src a8a1633usr.bin/lockf/tests lockf_test.sh

lockf tests: Fix a race

The test launches lockf(1) in the background and races with it, so it
shouldn't be using atf_check to check that lockf won the race.

MFC after:      1 week

(cherry picked from commit 498b3b494b8b3e500e555a9653d950b9e25a2f1a)
DeltaFile
+3-1usr.bin/lockf/tests/lockf_test.sh
+3-11 files

FreeBSD/src dc1f4c3cddl/contrib/opensolaris/lib/libdtrace/common dt_module.c

libdtrace: Use designated initializers for modules ops tables

No functional change intended.

MFC after:      1 week
Sponsored by:   Innovate UK

(cherry picked from commit f6372351da07ae101d5a22a2bb2bdb2753da2b40)
DeltaFile
+8-8cddl/contrib/opensolaris/lib/libdtrace/common/dt_module.c
+8-81 files

FreeBSD/src 3985e96sys/net rtsock.c, sys/net/route route_debug.h

route: Wrap long lines

No functional change intended.

MFC after:      1 week
Sponsored by:   Klara, Inc.

(cherry picked from commit ec1b18c7353ad20d2d373e58931aeccfccd5599d)
DeltaFile
+23-13sys/net/route/route_debug.h
+3-1sys/net/rtsock.c
+26-142 files

FreeBSD/src 73ee190sys/netlink netlink_debug.h

netlink: Wrap long lines

No functional change intended.

MFC after:      1 week
Sponsored by:   Klara, Inc.

(cherry picked from commit e536b197c0cf5c245e0b65f1b73447d53f3656f2)
DeltaFile
+11-9sys/netlink/netlink_debug.h
+11-91 files

FreeBSD/src c1dd895tests/sys/kern sched_affinity.c

sched tests: Avoid underflow when maxcpuid == 0

MFC after:      1 week

(cherry picked from commit 5b98bd30686a358b2a20728a4a6b5cecb7e28dc9)
DeltaFile
+5-2tests/sys/kern/sched_affinity.c
+5-21 files

FreeBSD/src 239c9c6sys/dev/hptiop hptiop.c

hptiop: Use device_set_descf()

No functional change intended.

MFC after:      1 week

(cherry picked from commit 1c64b3aba3d0e2910ac52c18e3c240348eb3e36e)
DeltaFile
+2-4sys/dev/hptiop/hptiop.c
+2-41 files

FreeBSD/src 7d521f0sys/sys buf_ring.h

buf_ring: Make buf_ring.h amenable to userspace compilation

This will be useful for adding test cases.

Reviewed by:    andrew
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D45869

(cherry picked from commit a161269b2451140a45de2d0cae0dad84f9e7b439)
DeltaFile
+36-1sys/sys/buf_ring.h
+36-11 files

FreeBSD/src c664b78sys/fs/nfs nfsrvstate.h, sys/fs/nfsserver nfs_nfsdstate.c nfs_nfsdsocket.c

nfsd: Fix nfsrv_cleanclient so that it can be called with a mutex

On Feb. 28, a problem was reported on freebsd-stable@ where a
nfsd thread processing an ExchangeID operation was blocked for
a long time by another nfsd thread performing a copy_file_range.
This occurred because the copy_file_range was taking a long time,
but also because handling a clientID requires that all other nfsd
threads be blocked via an exclusive lock, as required by ExchangeID.

This patch adds two arguments to nfsv4_cleanclient() so that it
can optionally be called with a mutex held.  For this patch, the
first of these arguments is "false" and, as such, there is no
change in semantics.  However, this change will allow a future
commit to modify handling of the clientID so that it can be done
with a mutex held while other nfsd threads continue to process
NFS RPCs.

(cherry picked from commit a7de51068502ad1e2851d4a855ed28b27573bb36)
DeltaFile
+32-21sys/fs/nfsserver/nfs_nfsdstate.c
+1-1sys/fs/nfs/nfsrvstate.h
+1-1sys/fs/nfsserver/nfs_nfsdsocket.c
+34-233 files

FreeBSD/src 7ac2b39sys/fs/nfs nfsrvstate.h, sys/fs/nfsserver nfs_nfsdstate.c nfs_nfsdsocket.c

nfsd: Fix nfsrv_cleanclient so that it can be called with a mutex

On Feb. 28, a problem was reported on freebsd-stable@ where a
nfsd thread processing an ExchangeID operation was blocked for
a long time by another nfsd thread performing a copy_file_range.
This occurred because the copy_file_range was taking a long time,
but also because handling a clientID requires that all other nfsd
threads be blocked via an exclusive lock, as required by ExchangeID.

This patch adds two arguments to nfsv4_cleanclient() so that it
can optionally be called with a mutex held.  For this patch, the
first of these arguments is "false" and, as such, there is no
change in semantics.  However, this change will allow a future
commit to modify handling of the clientID so that it can be done
with a mutex held while other nfsd threads continue to process
NFS RPCs.

(cherry picked from commit a7de51068502ad1e2851d4a855ed28b27573bb36)
DeltaFile
+33-22sys/fs/nfsserver/nfs_nfsdstate.c
+1-1sys/fs/nfs/nfsrvstate.h
+1-1sys/fs/nfsserver/nfs_nfsdsocket.c
+35-243 files

FreeBSD/src 026cdaasys/fs/nfsclient nfs_clrpcops.c

nfscl: Scan readdir reply filenames for invalid characters

The NFS RFCs are pretty loose with respect to what characters
can be in a filename returned by a Readdir.  However, FreeBSD,
as a POSIX system will not handle imbedded '/' or nul characters
in file names.  Also, for NFSv4, the file names "." and ".."
are handcrafted on the client and should not be returned by a
NFSv4 server.

This patch scans for the above in filenames returned by Readdir and
ignores any entry returned by Readdir which has them in it.
Because an imbedded nul would be a string terminator, it was
not possible to code this check efficiently using string(3)
functions.

Reported by:    Apple Security Engineering and Architecture (SEAR)
MFC after:      1 week
DeltaFile
+110-27sys/fs/nfsclient/nfs_clrpcops.c
+110-271 files

FreeBSD/src 397c269contrib/llvm-project/llvm/lib/CodeGen CalcSpillWeights.cpp

Fix llvm register allocator for native/cross build differences

Work around an issue in LLVM's register allocator, which can cause
slightly different i386 object files, when produced by a native or cross
build of clang.

This adds another volatile qualifier to a float variable declaration in
the weightCalcHelper() function, which otherwise produces slightly
different float results on amd64 and i386 hosts. In turn, this can lead
to different (but equivalent) register choices, and thus non-identical
assembly code.

See https://github.com/llvm/llvm-project/issues/99396 for more details.

Note this is a temporary fix, meant to merge in time for 13.4. As soon
as upstream has a permanent solution we will import that.

PR:             276961
Reported by:    cperciva
MFC after:      3 days
DeltaFile
+6-1contrib/llvm-project/llvm/lib/CodeGen/CalcSpillWeights.cpp
+6-11 files

FreeBSD/src 6377230hostapd ctrl_iface.c config_file.c

wpa: Import hostapd 2.11 into wpa
DeltaFile
+5,864-0hostapd/ctrl_iface.c
+5,226-0hostapd/config_file.c
+3,383-0hostapd/hostapd.conf
+2,342-0hostapd/hostapd_cli.c
+1,404-0hostapd/Makefile
+1,358-0hostapd/ChangeLog
+19,577-033 files not shown
+25,901-039 files