HardenedBSD/src 9a263c5sys/compat/linuxkpi/common/include/linux skbuff.h, sys/net if_infiniband.c

Merge remote-tracking branch 'origin/hardened/current/master' into hardened/current/cross-dso-cfi
DeltaFile
+166-119sys/compat/linuxkpi/common/include/linux/skbuff.h
+125-18usr.sbin/usbconfig/dump.c
+52-5sys/net/if_infiniband.c
+14-6usr.sbin/usbconfig/usbconfig.c
+5-1usr.sbin/usbconfig/usbconfig.8
+3-2usr.sbin/usbconfig/dump.h
+365-1511 files not shown
+366-1527 files

HardenedBSD/src 780f8c4sys/compat/linuxkpi/common/include/linux skbuff.h, sys/net if_infiniband.c

Merge branch 'freebsd/current/main' into hardened/current/master
DeltaFile
+166-119sys/compat/linuxkpi/common/include/linux/skbuff.h
+125-18usr.sbin/usbconfig/dump.c
+52-5sys/net/if_infiniband.c
+14-6usr.sbin/usbconfig/usbconfig.c
+5-1usr.sbin/usbconfig/usbconfig.8
+3-2usr.sbin/usbconfig/dump.h
+365-1511 files not shown
+366-1527 files

HardenedBSD/src c66308dusr.sbin/usbconfig dump.c usbconfig.c

usbconfig: add -l option to dump_device_desc for single line output

Like pciconf -l add a -l to dump_device_desc for usbconfig which will
fold most fields into a single line.  We do filter out some we think
will not be interesting in this case.

While mangling with string output in ways not always anticipated when
the program was initially written this should help to parse the
available devices for programs like fwget(8).  While I had this in
mind for other bits for a while I got prompted by D48678 to finally
do it.

Sponsored by:   The FreebSD Foundation
MFC after:      3 days
Reviewed by:    bapt (LGTM), ziaee (man)
Differential Revision: https://reviews.freebsd.org/D48974
DeltaFile
+125-18usr.sbin/usbconfig/dump.c
+14-6usr.sbin/usbconfig/usbconfig.c
+5-1usr.sbin/usbconfig/usbconfig.8
+3-2usr.sbin/usbconfig/dump.h
+147-274 files

HardenedBSD/src 8d079c6sys/net if_infiniband.c

if_infininband: Support BPF write for broadcast frames

To support DHCP for IPoIB links, DHCP clients and servers require the
ability to transmit link-layer broadcasts on the IB interfaces. BPF
provides the mechanism for doing this.

This change updates the if_infiniband driver to be capable of accepting
link-layer broadcast requests via BPF using Ethernet formatted frames
(the driver currently registers with BPF as DLT_EN10MB). Only Broadcast
frames can reliably be interpreted using the Ethernet header format so
detect unicast and multicast frames are rejected if passed in using the
Ethernet format. This doesn't impact the ability to support native
unicast, broadcast or multicast frames if native infiniband header
support is added to BPF at a later date.

Further the above, this commit also addresses an issue in the existing
code that can result in separation of part of the packet header from the
rest of the payload if a BPF write was attempted. This was caused by
mbuf preallocation of the infiniband header length regardless of length

    [7 lines not shown]
DeltaFile
+52-5sys/net/if_infiniband.c
+52-51 files

HardenedBSD/src 2ab4a41sys/compat/linuxkpi/common/include/linux skbuff.h, sys/compat/linuxkpi/common/src linux_skbuff.c

LinuxKPI: skbuff: add synchronization primitives and missing bits

Make a pass over skbuff.h:
- implement some missing bits,
- sprinkle some const,
- add locking and read/write_once calls as needed to provide
  synchronization as expected by Linux,
- fix some typos,
- remove return from void functions,
- adjust tracing macros.

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
PR:             283903 (rtw88 skb leak)
Tested by:      Guillaume Outters (guillaume-freebsd outters.eu)
Differential Revision: https://reviews.freebsd.org/D49101
DeltaFile
+166-119sys/compat/linuxkpi/common/include/linux/skbuff.h
+1-1sys/compat/linuxkpi/common/src/linux_skbuff.c
+167-1202 files

HardenedBSD/src 1ab7497sys/netinet in_pcb.c in_pcb_var.h, tests/sys/netinet so_reuseport_lb_test.c

Merge remote-tracking branch 'origin/hardened/current/master' into hardened/current/cross-dso-cfi
DeltaFile
+46-0tests/sys/netinet/so_reuseport_lb_test.c
+6-1sys/netinet/in_pcb.c
+1-0sys/netinet/in_pcb_var.h
+53-13 files

HardenedBSD/src 037a60dsys/netinet in_pcb.c in_pcb_var.h, tests/sys/netinet so_reuseport_lb_test.c

Merge branch 'freebsd/current/main' into hardened/current/master
DeltaFile
+46-0tests/sys/netinet/so_reuseport_lb_test.c
+6-1sys/netinet/in_pcb.c
+1-0sys/netinet/in_pcb_var.h
+53-13 files

HardenedBSD/src 8b3d2c1sys/netinet in_pcb.c in_pcb_var.h, tests/sys/netinet so_reuseport_lb_test.c

inpcb: Fix reuseport lbgroup array resizing

in_pcblisten() moves an inpcb from the per-group list into the array, at
which point it becomes visible to inpcb lookups in the datapath.  It
assumes that there is space in the array for this, but that's not
guaranteed, since in_pcbinslbgrouphash() doesn't reserve space in the
array if the inpcb isn't associated with a listening socket.

We could resize the array in in_pcblisten(), but that would introduce a
failure case where there currently is none.  Instead, keep track of the
number of pending inpcbs as well, and modify in_pcbinslbgrouphash() to
reserve space for each pending (i.e., not-yet-listening) inpcb.

Add a regression test.

Reviewed by:    glebius
Reported by:    netchild
Fixes:          7cbb6b6e28db ("inpcb: Close some SO_REUSEPORT_LB races, part 2")
Differential Revision:  https://reviews.freebsd.org/D49100
DeltaFile
+46-0tests/sys/netinet/so_reuseport_lb_test.c
+6-1sys/netinet/in_pcb.c
+1-0sys/netinet/in_pcb_var.h
+53-13 files

HardenedBSD/src 448d659contrib/kyua/engine scheduler.cpp scheduler_test.cpp, contrib/kyua/integration cmd_test_test.sh

Merge remote-tracking branch 'origin/hardened/current/master' into hardened/current/cross-dso-cfi
DeltaFile
+43-0contrib/kyua/integration/cmd_test_test.sh
+7-3contrib/kyua/integration/helpers/config.cpp
+3-0contrib/kyua/engine/scheduler.cpp
+1-0contrib/kyua/engine/scheduler_test.cpp
+54-34 files

HardenedBSD/src 7d22742contrib/kyua/engine scheduler.cpp scheduler_test.cpp, contrib/kyua/integration cmd_test_test.sh

Merge branch 'freebsd/current/main' into hardened/current/master
DeltaFile
+43-0contrib/kyua/integration/cmd_test_test.sh
+7-3contrib/kyua/integration/helpers/config.cpp
+3-0contrib/kyua/engine/scheduler.cpp
+1-0contrib/kyua/engine/scheduler_test.cpp
+54-34 files

HardenedBSD/src 51a8eb6contrib/kyua/engine scheduler.cpp scheduler_test.cpp, contrib/kyua/integration cmd_test_test.sh

kyua: Pass unprivileged user config prop to ATF using all known names

Kyua and ATF speak different naming styles. In this case, the
unprivileged user property can be named with underscore on the Kyua
side, and with a hyphen on the ATF side. Sometimes it is not obvious
which style should be used in which situation. For instance, a test case
may require this configuration property being set using require.config.
Also, a test case may want to read the property using something like
atf_tc_get_config_var(). Which names should be used in these cases?
From the perspective of the original code, it is expected to be this:
    require.config unprivileged-user
    atf_tc_get_config_var(tc, "unprivileged-user")

But, as long as Kyua is the main interface, its users expect to work
with kyua.conf(5), which says that it must be named as unprivileged_user
(with underscore). As a result, test authors tend to do this instead:
    require.config unprivileged_user
    atf_tc_get_config_var(tc, "unprivileged_user")


    [8 lines not shown]
DeltaFile
+43-0contrib/kyua/integration/cmd_test_test.sh
+7-3contrib/kyua/integration/helpers/config.cpp
+3-0contrib/kyua/engine/scheduler.cpp
+1-0contrib/kyua/engine/scheduler_test.cpp
+54-34 files

HardenedBSD/src 1fe97e0sys/compat/linuxkpi/common/include/linux nl80211.h, sys/compat/linuxkpi/common/include/net cfg80211.h mac80211.h

Merge remote-tracking branch 'origin/hardened/current/master' into hardened/current/cross-dso-cfi
DeltaFile
+33-9sys/compat/linuxkpi/common/src/linux_80211.c
+18-21sys/compat/linuxkpi/common/include/net/cfg80211.h
+21-17tests/sys/netinet/carp.sh
+4-2sys/compat/linuxkpi/common/include/net/mac80211.h
+4-2sys/compat/linuxkpi/common/include/linux/nl80211.h
+2-2sys/netinet/ip_carp.c
+82-536 files

HardenedBSD/src 6496f7asys/compat/linuxkpi/common/include/linux nl80211.h, sys/compat/linuxkpi/common/include/net cfg80211.h mac80211.h

Merge branch 'freebsd/current/main' into hardened/current/master
DeltaFile
+33-9sys/compat/linuxkpi/common/src/linux_80211.c
+18-21sys/compat/linuxkpi/common/include/net/cfg80211.h
+21-17tests/sys/netinet/carp.sh
+4-2sys/compat/linuxkpi/common/include/net/mac80211.h
+4-2sys/compat/linuxkpi/common/include/linux/nl80211.h
+2-2sys/netinet/ip_carp.c
+82-536 files

HardenedBSD/src 151aa1elib/libc/sys statfs.2

Merge branch 'freebsd/14-stable/main' into hardened/14-stable/master
DeltaFile
+63-46lib/libc/sys/statfs.2
+63-461 files

HardenedBSD/src 65c573esys/compat/linuxkpi/common/src linux_80211.c

LinuxKPI: 802.11: fix locking in lkpi_ic_ampdu_rx_stop()

net80211 has inconsistent locking when calling into (*ic_ampdu_rx_stop)().
Make use of 054c5ddf587a7 and conditionally check if the caller
locked or not and if locked temporary drop the lock to avoid sleeping
on a non-sleepaable lock during the downcall into the driver.

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
DeltaFile
+6-2sys/compat/linuxkpi/common/src/linux_80211.c
+6-21 files

HardenedBSD/src b693991lib/libc/sys statfs.2

statfs.2: document missing user-visible MNT flags

(cherry picked from commit e951247a983daf7814d06e9e49bdd503ceaa0b68)
DeltaFile
+18-0lib/libc/sys/statfs.2
+18-01 files

HardenedBSD/src 28b1a5alib/libc/sys statfs.2

statfs.2: order MNT flags alphabetically

(cherry picked from commit 0738cd9766a570e085831f6241387baa35cd64a3)
DeltaFile
+45-45lib/libc/sys/statfs.2
+45-451 files

HardenedBSD/src 743cd4clib/libc/sys statfs.2

statfs.2: remove dead comment

(cherry picked from commit 13b92ae9655deb22c3ad89f1e90e26f2f1da9961)
DeltaFile
+0-2lib/libc/sys/statfs.2
+0-21 files

HardenedBSD/src efa0994lib/libc/sys statfs.2

statfs.2: uncomment and describe MNT_IGNORE

(cherry picked from commit 270542d95d0d931ebdd369f4f78871828502d486)
DeltaFile
+3-2lib/libc/sys/statfs.2
+3-21 files

HardenedBSD/src 72ee3d5sys/compat/linuxkpi/common/include/net mac80211.h

LinuxKPI: 802.11: add condition to TODO in ieee80211_sta_recalc_aggregates

ieee80211_sta_recalc_aggregates() shows up in TODO traces but there is
nothing we have to do there until we have active links (MLO support).
Make the TODO conditional for a time when we will get there.

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
DeltaFile
+4-2sys/compat/linuxkpi/common/include/net/mac80211.h
+4-21 files

HardenedBSD/src a6994e2sys/compat/linuxkpi/common/include/net cfg80211.h

LinuxKPI: rather than manually defining a value use the net80211 define

Define cfg80211 IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_MASK to
net80211 IEEE80211_VHTCAP_SUPP_CHAN_WIDTH_MASK.

We should likely at some point make a sweep and replace all the
values with the defines from the comments for the matching net80211
version.

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
DeltaFile
+2-2sys/compat/linuxkpi/common/include/net/cfg80211.h
+2-21 files

HardenedBSD/src 73cd1c5sys/compat/linuxkpi/common/src linux_80211.c

LinuxKPI: 802.11: add further checks for deflink.supp_rates[]

When setting the per-band supp_rates bitfield check for mandatory
rates only.  We cannot easily say at that point for 2Ghz whether
11g is supported so assume these days it is not pure-b.

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
DeltaFile
+24-4sys/compat/linuxkpi/common/src/linux_80211.c
+24-41 files

HardenedBSD/src 1f73e0esys/compat/linuxkpi/common/src linux_80211.c

LinuxKPI: 802.11: use net80211 macro instead of manual check

Use IEEE80211_CONF_VHT() instead of manually checking if hardware
supports VHT.

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
DeltaFile
+1-1sys/compat/linuxkpi/common/src/linux_80211.c
+1-11 files

HardenedBSD/src 1145072sys/compat/linuxkpi/common/include/linux nl80211.h, sys/compat/linuxkpi/common/include/net cfg80211.h

LinuxKPI: 802.11: improve cfg80211_chandef_create()

Implement cfg80211_chandef_create() to work with HT.  Update enum
with HT channel types.  When calling the function from LinuxKPI 802.11
code, pass in NL80211_CHAN_HT20 if HT is supported rather than NO_HT.

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
DeltaFile
+16-19sys/compat/linuxkpi/common/include/net/cfg80211.h
+4-2sys/compat/linuxkpi/common/include/linux/nl80211.h
+2-2sys/compat/linuxkpi/common/src/linux_80211.c
+22-233 files

HardenedBSD/src 1776633sys/netinet ip_carp.c

carp: Fix checking IPv4 multicast address

An IPv4 address stored in `struct in_addr` is in network byte order but
`IN_MULTICAST` wants host order.

PR:             284872
Reported by:    Steven Perreau
Reported by:    Brett Merrick <brett.merrick at itcollective.nz>
Reviewed by:    Franco Fichtner <franco at opnsense.org>, ae, kp, glebius
Tested by:      Steven Perreau
Fixes:          137818006de5 carp: support unicast
MFC after:      3 days
Differential Revision:  https://reviews.freebsd.org/D49053
DeltaFile
+2-2sys/netinet/ip_carp.c
+2-21 files

HardenedBSD/src 93fbdeftests/sys/netinet carp.sh

tests: carp: Update test case unicast_v4 to catch PR 284872

In the current test case unicast_v4, host one acts as a router, but it
uses if_bridge(4) to verify the reachability to CARP master.
Unfortunately, if_bridge(4) brings the two CARP hosts into the same
broadcast domain, thus with an unusual (undocumented) setup, one host
is in unicast mode but another one in multicast, or two hosts are both
in multicast mode, the test case can falsely report success.

Fix that by propagating route via routed(8).

PR 284872 shows that CARP(4) happens to send packets with multicast
destination when the unicast peer address is in the range x.x.x.224 ~
x.x.x.239. Update the peer address in test case to catch that bug.

PR:             284872
Reviewed by:    kp
MFC after:      3 days
Differential Revision:  https://reviews.freebsd.org/D49076
DeltaFile
+21-17tests/sys/netinet/carp.sh
+21-171 files

HardenedBSD/src c18a344sys/fs/tmpfs tmpfs_subr.c, sys/kern uipc_shm.c

Merge remote-tracking branch 'origin/hardened/current/master' into hardened/current/cross-dso-cfi
DeltaFile
+192-0tests/sys/netinet/broadcast.c
+31-61sys/netinet/udp_usrreq.c
+51-0sys/vm/vm_page.c
+4-43sys/fs/tmpfs/tmpfs_subr.c
+4-43sys/kern/uipc_shm.c
+10-5sys/netinet/ip_output.c
+292-15216 files not shown
+332-19422 files

HardenedBSD/src eb25f0csys/fs/tmpfs tmpfs_subr.c, sys/kern uipc_shm.c

Merge branch 'freebsd/current/main' into hardened/current/master
DeltaFile
+192-0tests/sys/netinet/broadcast.c
+31-61sys/netinet/udp_usrreq.c
+51-0sys/vm/vm_page.c
+4-43sys/kern/uipc_shm.c
+4-43sys/fs/tmpfs/tmpfs_subr.c
+10-5sys/netinet/ip_output.c
+292-15216 files not shown
+332-19422 files

HardenedBSD/src 855be8csys/dev/bnxt/bnxt_en bnxt_sysctl.c bnxt_dcb.c

Merge branch 'freebsd/14-stable/main' into hardened/14-stable/master
DeltaFile
+20-48sys/dev/bnxt/bnxt_en/bnxt_sysctl.c
+10-7sys/dev/bnxt/bnxt_en/bnxt_dcb.c
+2-1sys/dev/bnxt/bnxt_en/bnxt.h
+1-0sys/dev/bnxt/bnxt_en/bnxt_mgmt.c
+33-564 files

HardenedBSD/src 43339e7sys/dev/bnxt/bnxt_en bnxt_sysctl.c

bnxt_en: Improve sysctl handler bnxt_dcb_list_app()

Prefer sbuf_new_for_sysctl() over error-prone manually managed buffer.

No functional change intended.

Reviewed by:    markj
Tested by:      Daniel Porsch <daniel.porsch at loopia.se>
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D48496

(cherry picked from commit 91bae242bc54856c560557b5ba245df94d570e95)
DeltaFile
+17-27sys/dev/bnxt/bnxt_en/bnxt_sysctl.c
+17-271 files