FreeBSD/src f8ddf74sys/dev/dwc dwc1000_dma.c

dwc: improve IPv4 transmit checksum offloading

This patch provides two improvements for TCP/IPv4 and UDP/IPv4
transmit checksum offloading:
(1) Use *CIC_SEG instead of *CIC_FULL, since FreeBSD always provides
    a pseudo header checksum.
(2) Don't make transmit IPv4 header checksum offloading a prerequisite
    for TCP/IPv4 or UDP/IPv4 transmit checksum offloading.
This is the root cause of PR 291696, since right now the epair
interface does not support transmit IPv4 header checksum offloading,
but TCP/IPv4 and UDP/IPv4 transmit checksum offloading.

PR:                     291696
Reviewed by:            Timo Voelker
Tested by:              Marek Benc
MFC after:              3 days
Differential Revision:  https://reviews.freebsd.org/D54395
DeltaFile
+7-14sys/dev/dwc/dwc1000_dma.c
+7-141 files

FreeBSD/src a01a4c0.github CODEOWNERS

CODEOWNERS: register interest in some infrastructure
DeltaFile
+3-1.github/CODEOWNERS
+3-11 files

FreeBSD/src d78291blib/virtual_oss Makefile.inc, lib/virtual_oss/bt Makefile

lib/virtual_oss: don't (over)link to libsamplerate

These plugins require samplerate.h due to virtual_oss's int.h including
it, but don't use any symbols directly so don't link to the library.

Centralize adding the include path.

Reviewed by:    christos
Sponsored by:   DARPA, AFRL
Differential Revision:  https://reviews.freebsd.org/D54705
DeltaFile
+1-3lib/virtual_oss/sndio/Makefile
+0-3lib/virtual_oss/null/Makefile
+1-2lib/virtual_oss/bt/Makefile
+0-3lib/virtual_oss/oss/Makefile
+2-0lib/virtual_oss/Makefile.inc
+4-115 files

FreeBSD/src 373c72alib/virtual_oss Makefile.inc, lib/virtual_oss/bt Makefile

virtual_oss: build system tidying

general:
 - find libsamplerate's headers in the temporary sysroot instead of
   digging in the source tree.
 - use LIBADD where possible

lib/virtual_oss:
 - centralize SHLIBDIR define
 - centralize include path for internal headers
 - don't try to find libsamplerate directly in .OBJDIR

No functional changes.

Reviewed by:    christos
Sponsored by:   DARPA, AFRL
Differential Revision:  https://reviews.freebsd.org/D54704
DeltaFile
+4-5usr.sbin/virtual_oss/virtual_oss/Makefile
+2-5lib/virtual_oss/bt/Makefile
+4-2lib/virtual_oss/Makefile.inc
+1-3lib/virtual_oss/null/Makefile
+1-3lib/virtual_oss/oss/Makefile
+1-3lib/virtual_oss/sndio/Makefile
+13-212 files not shown
+14-248 files

FreeBSD/src adab1ddlib/virtual_oss Makefile, usr.sbin/virtual_oss Makefile

virtual_oss: build commands/libs in parallel

Reviewed by:    christos
Sponsored by:   DARPA, AFRL
Differential Revision:  https://reviews.freebsd.org/D54703
DeltaFile
+2-0lib/virtual_oss/Makefile
+2-0usr.sbin/virtual_oss/Makefile
+4-02 files

FreeBSD/src 497a136lib/virtual_oss Makefile, usr.sbin/virtual_oss Makefile

virtual_oss: remove needless .include in intermediate Makefile

It doesn't define anything we use.

Reviewed by:    christos
Sponsored by:   DARPA, AFRL
Differential Revision:  https://reviews.freebsd.org/D54702
DeltaFile
+0-1lib/virtual_oss/Makefile
+0-1usr.sbin/virtual_oss/Makefile
+0-22 files

FreeBSD/src 484edabsys/net iflib.c

iflib: remove convoluted custom zeroing code

Replace a collection of aliasing violations and ifdefs with memset
(which now expands to __builtin_memset and should be quite reliably
inlined.)  The old code is hard to maintain as evidenced by the most
recent change to if_pkt_info_t updating the defines, but not the zeroing
code.

Reviewed by:    gallatin, erj
Effort:         CHERI upstreaming
Sponsored by:   Innovate UK
Fixes:          43d7ee540efe ("iflib: support for transmit side nic KTLS offload")
Differential Revision:  https://reviews.freebsd.org/D54605

(cherry picked from commit 31e7dc6b9a000b02353bfc41cbd897533287cda2)
DeltaFile
+5-60sys/net/iflib.c
+5-601 files

FreeBSD/src 296ebf7sys/net iflib.c

iflib: remove convoluted custom zeroing code

Replace a collection of aliasing violations and ifdefs with memset
(which now expands to __builtin_memset and should be quite reliably
inlined.)  The old code is hard to maintain as evidenced by the most
recent change to if_pkt_info_t updating the defines, but not the zeroing
code.

Reviewed by:    gallatin, erj
Effort:         CHERI upstreaming
Sponsored by:   Innovate UK
Fixes:          43d7ee540efe ("iflib: support for transmit side nic KTLS offload")
Differential Revision:  https://reviews.freebsd.org/D54605

(cherry picked from commit 31e7dc6b9a000b02353bfc41cbd897533287cda2)
DeltaFile
+5-60sys/net/iflib.c
+5-601 files

FreeBSD/src 22569a1sys/sys param.h

Bump __FreeBSD_version for MAC changes
DeltaFile
+1-1sys/sys/param.h
+1-11 files

FreeBSD/src c18631f. RELNOTES

RELNOTES: document the MAC/jail integration

Reviewed by:    jamie, markj
Differential Revision:  https://reviews.freebsd.org/D54737
DeltaFile
+7-0RELNOTES
+7-01 files

FreeBSD/src d141ee1sys/compat/linuxkpi/common/src linux_80211.c

LinuxKPI: 802.11: fix rx_nss with VHT

When fixing single-stream chipsets, like iwlwifi(4) AX101, we started
masking the announced with the hardware supported values.  This would
probably limit, e.g., rx_nss.  During these works we fixed a loop
checking from the highest nss=7 to lowest nss=0 (8..1) and would set
rx_nss if the stream was supported.  This left us with always setting
rx_nss on nss=0 to nss + 1 = 1.  Instead only update once when we hit
the first supported MCS value (highest number of supported streams).
Looking at the diff of the mentioned commit hash which gets fixed it
looks like even the old code was not correct either.

This only fixes the logic to calculate rx_nss.  This does not yet help
with modern drivers to actually update the value.  Code for this will
come in a later commit.

Sponsored by:   The FreeBSD Foundation
Fixes:          adb4901ac9ae

(cherry picked from commit 8494be1b5af7fe4f765532f802ac0a145e061d73)
DeltaFile
+2-1sys/compat/linuxkpi/common/src/linux_80211.c
+2-11 files

FreeBSD/src 6e2b552sys/compat/linuxkpi/common/src linux_80211.c

LinuxKPI: 802.11: assign sequence numbers to frames

While all native drivers were converted to call
ieee80211_output_seqno_assign() after changes to net80211 if needed,
LinuxKPI 802.11 was not fixed.  Add the missing call.
Given we are currently only supporting STA mode, we can provide
sequence numbers for all frames (mgmt/beacon would be a problem in
AP mode).

This greatly helps LinuxKPI based drivers other than iwlwifi(4).
If drivers do their own sequence numbers, they will overwrite what we
pre-set unless we would pass a txflag not to do so (beware the
consequences).

Sponsored by:   The FreeBSD Foundation
Fixes:          eabcd1773fa3, 785edcc2af5a

(cherry picked from commit 9cf85457b13bc7aa125388d63c82acf2b21e9e9e)
DeltaFile
+2-0sys/compat/linuxkpi/common/src/linux_80211.c
+2-01 files

FreeBSD/src 4d255absys/compat/linuxkpi/common/src linux_80211.c

LinuxKPI: 802.11: reset hdr after crypto in lkpi_80211_txq_tx_one()

When lkpi_80211_txq_tx_one() calls into the crypto offloading parts to
possibly make space in the headroom, the beginning of our frame moves.
We have to reset hdr after that call as otherwise later classifications
based on the hdr->frame_control will fail or cause wrong classificaiton
of packets.
This makes sure frames will either be directly sent using (*mo_tx)()
or use the correct tid for the correct queue.  This helps to get
rtwx8 packets flowing after BA was negotiated.

Sponsored by:   The FreeBSD Foundation
Fixes:          11db70b6057e4

(cherry picked from commit f0395993e1ea83705e0da6623843e7d5d03f7269)
DeltaFile
+2-0sys/compat/linuxkpi/common/src/linux_80211.c
+2-01 files

FreeBSD/src 6b9c0acshare/man/man4 linuxkpi_wlan.4, sys/compat/linuxkpi/common/src linux_80211.c linux_80211.h

LinuxKPI: 802.11: add compat.linuxkpi.80211.IF.dump_stas_queues

Extend the normal compat.linuxkpi.80211.IF.dump_stas sysctl by
queue information.  This was helpful for debugging various issues,
like selecting the outbound queue, stopping queues for BAR and helped
finding multiple bugs.

Sponsored by:   The FreeBSD Foundation

(cherry picked from commit 32ea8209825af594cbfa1fc654d45eb9a6aab528)
DeltaFile
+73-5sys/compat/linuxkpi/common/src/linux_80211.c
+8-1share/man/man4/linuxkpi_wlan.4
+4-0sys/compat/linuxkpi/common/src/linux_80211.h
+85-63 files

FreeBSD/src 605389esys/sys bitcount.h

sys/bitcount.h: add __const_bitcount<n>

Add a version of __const_bitcount<n> which can be used to get the
numbers at compile-time when __builtin_popcountg() is not available
(see sys/compat/linuxkpi/common/include/linux/bitops.h for LLVM before
19 and gcc before 14).

Obtained from:  https://reviews.freebsd.org/D50995#1174884 by obiwac
Sponsored by:   The FreeBSD Foundation
Reviewed by:    brooks, emaste
Differential Revision: https://reviews.freebsd.org/D54301

(cherry picked from commit 27aa23cee81088b0ffa974eec9f03c654c36438e)
DeltaFile
+22-0sys/sys/bitcount.h
+22-01 files

FreeBSD/src 9755a80sys/compat/linuxkpi/common/include/linux bitops.h

LinuxKPI: bitcount fix builds with gcc and older llvm

LLVM before 19 and gcc before 14 do not support __builtin_popcountg().
Use __const_bitcount<n> from sys/bitcount.h as a replacement in these
cases.  This should still allow drm-kmod to build where the size needs
to be known at compile-time.

Remove the conditional for gcc around the iwlwifi modules build,
which was collateral damage in all this.

Sponsored by:   The FreeBSD Foundation
Fixes:          7cbc4d875971, 5e0a4859f28a
Reviewed by:    brooks, emaste (without the sys/modules/Makefile change)
Differential Revision: https://reviews.freebsd.org/D54297

(cherry picked from commit 34892a8e30055000352d9612ad985be550c82bea)
DeltaFile
+8-0sys/compat/linuxkpi/common/include/linux/bitops.h
+8-01 files

FreeBSD/src 4b5b8d6release/powerpc mkisoimages.sh

powerpc: fix release image building for Apple partitions

awk changed somewhere between 14 and 15 and it stopped accepting
a hexadecimal number as its input - it will always return 0.
This results in a very badly written apple boot block.

So just remove it; do the math in shell.

PR:             kern/292341
Differential Revision:  https://reviews.freebsd.org/D54639
Reviewed by:    imp
MFC after:      1 week

(cherry picked from commit 7afa03963c448a14b1735a10eaf84941b0b74862)
DeltaFile
+1-1release/powerpc/mkisoimages.sh
+1-11 files

FreeBSD/src 1e8c287share/man/man4 mac.4, usr.sbin/jail jail.8

jail: document the mac.label parameter

In particular, we should provide a hint about mac.conf(5), since libjail
will just use the mac_prepare_type(3) API to provide a reasonably sane
interface for system administrators.  Progammers wanting to fetch an
arbitrary MAC label would need to bypass libjail and use jail_get(2)
directly with their own prepared `struct mac`.

Differential Revision:  https://reviews.freebsd.org/D54067
DeltaFile
+12-1usr.sbin/jail/jail.8
+3-1share/man/man4/mac.4
+15-22 files

FreeBSD/src db3b39flib/libjail jail.c

libjail: extend struct handlers to included MAC labels

MAC label handling is a little special; to avoid being too disruptive,
we allocate a `mac_t *` here for the value so that we can mac_prepare()
or mac_from_text() into.  As a result, we need:

 - A custom free() handler to avoid leaking the *jp_value
 - A custom jailparam_get() handler to mac_prepare() the mac_t and
    populate the iove properly, so that the kernel doesn't have to
    do something funky like copyin, dereference, copyin again.
 - A custom jailparam_set() handler to similarly populate the iovec
    properly.

Reviewed by:    jamie
Differential Revision:  https://reviews.freebsd.org/D53960
DeltaFile
+189-3lib/libjail/jail.c
+189-31 files

FreeBSD/src 1af8d56lib/libjail jail.c

libjail: start refactoring struct ioctl support

Instead of ad-hoc comparisons against the struct type in a few places,
start to abstract out an interface for dealing with struct types.  For
now, this just means that we have some special jailparam_import and
jailparam_export handling for the ip addr types, but in the next commit
we'll extend it further to support MAC labels.

Reviewed by:    jamie
Differential Revision:  https://reviews.freebsd.org/D53959
DeltaFile
+149-57lib/libjail/jail.c
+149-571 files

FreeBSD/src bd55cbbsys/kern kern_jail.c, sys/security/mac mac_syscalls.c mac_syscalls.h

kern: add a mac.label jail parameter

Have it take a `struct mac` and we'll paper over the difference for
jail(8)/jls(8) in libjail(3).  The mac_syscalls.h model is taken from
mac_set_proc_*() that were previously done.

Reviewed by:    olce
Differential Revision:  https://reviews.freebsd.org/D53958
DeltaFile
+154-0sys/security/mac/mac_syscalls.c
+51-1sys/kern/kern_jail.c
+10-0sys/security/mac/mac_syscalls.h
+215-13 files

FreeBSD/src 92b7366sys/security/mac mac_internal.h

mac: add macros for 5-argument SDT probes

A last-minute change to the jail MAC entry points in D53954 is going to
pass the jail_[gs]et(2) flags to mac_prison_check_[gs]et() so that a
policy can, e.g., reject or allow a change if the intent is to
immediately attach, or disallow some fetching of dying jails.

Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D54658
DeltaFile
+13-5sys/security/mac/mac_internal.h
+13-51 files

FreeBSD/src 626fe12sys/security/mac mac_syscalls.c

kern: mac: pull mac_label_copyin_string out

A future commit to the area will further our jail integration and add
a use for this: the struct mac itself was already copied in as part of
vfs_buildopts(), so we only need to copyin the strings.

We add an explicit flag argument because the jail operation will need to
do it while holding the prison lock.

Reviewed by:    olce
Differential Revision:  https://reviews.freebsd.org/D53957
DeltaFile
+30-18sys/security/mac/mac_syscalls.c
+30-181 files

FreeBSD/src 11d6ea4sys/kern kern_jail.c, sys/security/mac mac_prison.c mac_policy.h

kern: mac: add a MAC label to struct prison

Reviewed by:    olce
Differential Revision:  https://reviews.freebsd.org/D53953
DeltaFile
+144-0sys/security/mac/mac_prison.c
+26-0sys/kern/kern_jail.c
+20-0sys/security/mac/mac_policy.h
+9-0sys/security/mac/mac_internal.h
+6-0sys/security/mac/mac_framework.h
+1-0sys/security/mac/mac_framework.c
+206-02 files not shown
+208-08 files

FreeBSD/src 31c2728sys/security/mac mac_syscalls.c mac_prison.c, sys/security/mac_stub mac_stub.c

mac_set_fd(3): add support for jail descriptors

We'll still add an old-fashioned jail param to configure jail MAC
labels, but for testing it's really easy to grab a jaildesc and use
that.

Reviewed by:    jamie, olce
Differential Revision:  https://reviews.freebsd.org/D53956
DeltaFile
+44-0sys/security/mac/mac_syscalls.c
+26-2sys/security/mac/mac_prison.c
+11-0sys/security/mac_test/mac_test.c
+5-0sys/security/mac/mac_internal.h
+3-0sys/security/mac/mac_policy.h
+1-0sys/security/mac_stub/mac_stub.c
+90-26 files

FreeBSD/src d7a517esys/kern kern_jaildesc.c, sys/sys jaildesc.h

jaildesc: add an accessor for the struct prison in a jaildesc

We'll subsequently use this in the MAC framework to get a struct prison
when we already have the struct file in question, rather than an fd.

Reviewed by:    jamie, olce
Differential Revision:  https://reviews.freebsd.org/D53955
DeltaFile
+56-21sys/kern/kern_jaildesc.c
+1-0sys/sys/jaildesc.h
+57-212 files

FreeBSD/src 8254b0dsys/kern kern_jail.c, sys/security/mac mac_prison.c mac_policy.h

kern: mac: add various jail MAC hooks

This adds the following hooks:
 - mpo_prison_check_attach: check for subject capability to attach to
    a given jail
 - mpo_prison_check_create: check for subject capability to create a
    jail with the given option set
 - mpo_prison_check_get: check for subject capability to fetch the
    given parameters for a jail
 - mpo_prison_check_set: check for subject capability to set the
    given parameters for a jail
 - mpo_prison_check_remove: check for subject capability to remove the
    jail

check_get wouldn't typically be a privileged operation, but is included
to give MAC policies a wider range of capabilities at a relatively low
cost.  We also add two more for the purpose of label propagation:
 - mpo_prison_created: surface the creation of a jail so that one can
    do propagation to, e.g., the root vnode or any mounts

    [28 lines not shown]
DeltaFile
+161-0sys/security/mac_test/mac_test.c
+104-22sys/kern/kern_jail.c
+87-0sys/security/mac/mac_prison.c
+83-0sys/security/mac_stub/mac_stub.c
+25-0sys/security/mac/mac_policy.h
+12-0sys/security/mac/mac_framework.h
+472-221 files not shown
+474-227 files

FreeBSD/src 4fc11c9sys/fs/nfs nfs.h nfs_var.h, sys/fs/nfsserver nfs_nfsdport.c nfs_nfsdserv.c

nfsd: Fix handling of attributes during Open/Create/Exclusive_41

When an NFSv4.n client specifies settings for attributes other
mode during a Open/Create/Exclusive_41, these other attributes
were not being set.

This patch resolves the problem by calling nfsrv_fixsattr()
after the VOP_CREATE() call in nfsvno_open() for this case.

There is no extant NFSv4.n client that currently does this,
as far as I know.

MFC after:      2 weeks
DeltaFile
+38-8sys/fs/nfsserver/nfs_nfsdport.c
+8-5sys/fs/nfsserver/nfs_nfsdserv.c
+3-3sys/fs/nfsserver/nfs_nfsdsubs.c
+5-0sys/fs/nfs/nfs.h
+1-1sys/fs/nfs/nfs_var.h
+2-0sys/fs/nfs/nfsdport.h
+57-176 files

FreeBSD/src 51786cdsys/kern uipc_domain.c

sockets: remove unused pr_sosend_notsupp(), pr_soreceive_notsupp()
DeltaFile
+0-16sys/kern/uipc_domain.c
+0-161 files

FreeBSD/src 77f453etests/sys/net/if_ovpn if_ovpn.sh

tests/if_ovpn: add missing cleanup to the multihome6 test

Fixes:  0bfcfb3cb1cbfa383cbd24eff39d39f143eb63ba
DeltaFile
+2-0tests/sys/net/if_ovpn/if_ovpn.sh
+2-01 files