FreeBSD/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

FreeBSD/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

FreeBSD/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

FreeBSD/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

FreeBSD/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

FreeBSD/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

FreeBSD/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

FreeBSD/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

FreeBSD/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

FreeBSD/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

FreeBSD/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

FreeBSD/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

FreeBSD/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

FreeBSD/src 83c2710sys/dev/bnxt/bnxt_en bnxt_sysctl.c

bnxt_en: Fix the description of sysctl knob dev.bnxt.X.dcb.dcbx_cap

While here, update the description of dev.bnxt.X.dcb to more informative
words "Data Center Bridging".

Reviewed by:    markj
Fixes:  35b53f8c989f bnxt_en: Add PFC, ETS & App TLVs protocols support
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D48993

(cherry picked from commit 0bc672b38f1b224d5eaed35533cb6f6bfb3a5fa3)
DeltaFile
+2-2sys/dev/bnxt/bnxt_en/bnxt_sysctl.c
+2-21 files

FreeBSD/src acc2d47sys/dev/bnxt/bnxt_en bnxt_dcb.c bnxt.h

bnxt_en: Retrieve maximum of 128 APP TLVs

It appears that the maximum number of APP TLVs supported by the hardware
is 128 according to D45005. Well Daniel Porsch reported an issue PR284073
which shows that the number can exceed the limit, causing out of bound
write to on-stack allocated variable app[128] and the kernel panics.

Limit to 128 while retrieving APP TLVs.

PR:             284073
Reviewed by:    markj
Tested by:      Daniel Porsch <daniel.porsch at loopia.se>
Fixes:  35b53f8c989f bnxt_en: Add PFC, ETS & App TLVs protocols support
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D48589

(cherry picked from commit 3de231b4d956f7b9c22e31f75805030a417f7bf3)
DeltaFile
+10-7sys/dev/bnxt/bnxt_en/bnxt_dcb.c
+2-1sys/dev/bnxt/bnxt_en/bnxt.h
+1-1sys/dev/bnxt/bnxt_en/bnxt_sysctl.c
+1-0sys/dev/bnxt/bnxt_en/bnxt_mgmt.c
+14-94 files

FreeBSD/src 072303dsys/dev/bnxt/bnxt_en bnxt_sysctl.c

bnxt_en: Remove pointless NULL check for sysctl arg1

Those sysctl handlers have been guaranteed to have non-null softc. No
need for NULL check within sysctl handlers.

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/D48495

(cherry picked from commit 747fd2db538a85df84ae6ac1e58494295b4a65ee)
DeltaFile
+0-18sys/dev/bnxt/bnxt_en/bnxt_sysctl.c
+0-181 files

FreeBSD/src 69c05f4sys/netinet udp_usrreq.c

udp: make sendto(2) on unconnected UDP socket use public inpcb KPIs

UDP allows to sendto(2) on unconnected socket.  The original BSD devise
was that such action would create a temporary (for the duration of the
syscall) connection between our inpcb and remote addr:port specified in
sockaddr 'to' of the syscall.  This devise was broken in 2002 in
90162a4e87f0.  For more motivation on the removal of the temporary
connection see email [1].

Since the removal of the true temporary connection the sendto(2) on
unconnected socket has the following side effects:

1) After first sendto(2) the "unconnected" socket will receive datagrams
   destined to the selected port.
2) All subsequent sendto(2) calls will use the same source port.

Effectively, such sendto(2) acts like a bind(2) to INADDR_ANY:0.  Indeed,
if you do this:


    [25 lines not shown]
DeltaFile
+30-60sys/netinet/udp_usrreq.c
+30-601 files

FreeBSD/src ad77d31tests/sys/netinet broadcast.c Makefile

tests/netinet: add few tests for sending a broadcast packet

1) Set SO_BROADCAST and send to INADDR_BROADCAST.
2) Set SO_BROADCAST, set IP_ONESBCAST and cycle through broadcast capable
   interfaces sending a datagram on each.
3) Set SO_BROADCAST and send to local broadcast address.

For each test we bind a second socket to check whether the broadcast
is actually received.

Reviewed by:            markj
Differential Revision:  https://reviews.freebsd.org/D49040
DeltaFile
+192-0tests/sys/netinet/broadcast.c
+2-1tests/sys/netinet/Makefile
+194-12 files

FreeBSD/src 532106fsys/netinet ip_icmp.c in_jail.c

netinet: use in_broadcast() inline

There should be no functional change.

Reviewed by:            rrs, markj
Differential Revision:  https://reviews.freebsd.org/D49088
DeltaFile
+2-7sys/netinet/ip_icmp.c
+1-7sys/netinet/in_jail.c
+3-5sys/netinet/ip_fastfwd.c
+2-4sys/netinet/sctp_output.c
+2-4sys/netinet/sctp_pcb.c
+1-3sys/netinet/ip_input.c
+11-302 files not shown
+13-338 files

FreeBSD/src 3b281d1sys/netinet ip_output.c in.h

netinet: enforce broadcast mode for all-ones and all-zeroes destinations

When a socket has SO_BROADCAST set and destination address is INADDR_ANY
or INADDR_BROADCAST, the kernel shall pick up first broadcast capable
interface and broadcast the packet out of it.  Since this API is not
reliable on a machine with > 1 broadcast capable interfaces, all practical
software seems to use IP_ONESBCAST or other mechanisms to send broadcasts.
This has been broken at least since FreeBSD 6.0, see bug 99558.  Back then
the problem was in the fact that in_broadcast() check was always done
against the gateway address, not the destination address.  Later, with
90cc51a1ab4be, a second problem piled on top - we aren't checking for
INADDR_ANY and INADDR_BROADCAST at all.

Better late than never, fix that by checking destination address.

PR:                     99558
Reviewed by:            markj
Differential Revision:  https://reviews.freebsd.org/D49042
DeltaFile
+10-5sys/netinet/ip_output.c
+7-0sys/netinet/in.h
+17-52 files

FreeBSD/src 197fc4csys/netinet tcp_input.c ip_divert.c

netinet: rename in_broadcast() to in_ifnet_broadcast()

This aligns with existing in_ifaddr_broadcast() and aligns with other
simple functions or macros with bare "in_" prefix that operator just on
struct in_addr and nothing else, e.g. in_nullhost().  No functional
change.

Reviewed by:            markj
Differential Revision:  https://reviews.freebsd.org/D49041
DeltaFile
+3-3sys/netinet/tcp_input.c
+1-1sys/netinet/ip_divert.c
+1-1sys/netinet/sctp_os_bsd.h
+1-1sys/netinet/udp_usrreq.c
+1-1sys/netinet/in.c
+1-1sys/netinet/in.h
+8-81 files not shown
+9-97 files

FreeBSD/src 4b79443sys/kern kern_umtx.c

umtx: Fix a bug in do_lock_pp()

If the lock is unowned (i.e., owner == UMUTEX_CONTESTED), we might get a
spurious failure, and in that case we need to retry the loop.
Otherwise, the calling thread can end up sleeping forever.

The same problem exists in do_set_ceiling(), which open-codes
do_lock_pp(), so fix it there too.

Reviewed by:    olce
Reported by:    Daniel King <dmking at adacore.com>
MFC after:      2 weeks
Sponsored by:   Innovate UK
Differential Revision:  https://reviews.freebsd.org/D49031
DeltaFile
+8-0sys/kern/kern_umtx.c
+8-01 files

FreeBSD/src bb1dc6csys/fs/tmpfs tmpfs_subr.c, sys/kern uipc_shm.c

vm_page: define partial page invalidate

Two different functions in different files do the same thing - fill a
partial page with zeroes. Add that functionality to vm_page.c and
remove it elsewhere to avoid code duplication.

Reviewed by:    markj, kib
Differential Revision:  https://reviews.freebsd.org/D49096
DeltaFile
+51-0sys/vm/vm_page.c
+4-43sys/fs/tmpfs/tmpfs_subr.c
+4-43sys/kern/uipc_shm.c
+2-0sys/vm/vm_page.h
+61-864 files

FreeBSD/src 94ffbdbsys/arm/conf GENERIC.hints, sys/arm64/conf GENERIC.hints

sys: Empty hints files

Create empty hints files for these platforms. They don't normally need a
hints file, but people use them for device instance wiring. It's less
confusing if they always exist.

Sponsored by:           Netflix
Differential Revision:  https://reviews.freebsd.org/D49052
DeltaFile
+2-0sys/arm/conf/GENERIC.hints
+2-0sys/arm64/conf/GENERIC.hints
+2-0sys/riscv/conf/GENERIC.hints
+6-03 files

FreeBSD/src 2b14601sbin/nvmecontrol/modules/intel intel.c

nvmecontrol: Add more keys for CA page (Additional smart data)

Micron and Samsung also use this standard, though Micron is known to use
a few different keys. Add the ones that public information say are the
same among those the drives that have them.

There's others, but either they aren't publicly documented in datasheets
or nvme-cli code, or they vary betwen models and our code needs a fair
amount of rework needed.

Also print hex value for unknown keys. This allows scripts to more
easily pick bytes out for those keys who have values that are encoded by
packing multiple values into the 48-bit field.

Sponsored by:           Netflix
DeltaFile
+16-2sbin/nvmecontrol/modules/intel/intel.c
+16-21 files

FreeBSD/src 2eef41esys/fs/tmpfs tmpfs_subr.c, sys/kern uipc_shm.c

Revert "vm_page: define partial page invalidate"

A negative review arrived as this was being committed, so undo and
reevaluate.

This reverts commit 5611a38d818587b307e1fb110f72d2996c170035.
DeltaFile
+0-50sys/vm/vm_page.c
+43-4sys/fs/tmpfs/tmpfs_subr.c
+43-4sys/kern/uipc_shm.c
+0-2sys/vm/vm_page.h
+86-604 files

FreeBSD/src 5611a38sys/fs/tmpfs tmpfs_subr.c, sys/kern uipc_shm.c

vm_page: define partial page invalidate

Two different functions in different files do the same thing - fill a
partial page with zeroes. Add that functionality to vm_page.c and
remove it elsewhere to avoid code duplication.

Reviewed by:    kib
Differential Revision:  https://reviews.freebsd.org/D49096
DeltaFile
+50-0sys/vm/vm_page.c
+4-43sys/fs/tmpfs/tmpfs_subr.c
+4-43sys/kern/uipc_shm.c
+2-0sys/vm/vm_page.h
+60-864 files

FreeBSD/src 5bd7cf8. .cirrus.yml

Cirrus-CI: Bump image to (supported) 13.4

Sponsored by:   The FreeBSD Foundation
DeltaFile
+1-1.cirrus.yml
+1-11 files

FreeBSD/src 93b7f93release/scripts pkg-stage.sh

pkg-stage.sh: Remove kde entirely

The package set for FreeBSD 13.5 comes from the 2025Q1 branch, which
doesn't have the new x11/kde (aka KDE 6) port; but shipping x11/kde5
(which is still in the 2025Q1 branch) doesn't make much sense either
since a few weeks after the release that will no longer be available
in either "latest" or "quarterly" package sets.

Just remove KDE packages from the 13.5 DVD entirely; this also makes
the DVD image fit into 4.7 GB size limit of physical DVDs again.

Direct commit to releng/13.5.

With hat:       re
Approved by:    re (cperciva)
Fixes:  ee6c7bf50b93 ("pkg-stage.sh: kde5 -> kde")
Sponsored by:   Amazon
DeltaFile
+0-1release/scripts/pkg-stage.sh
+0-11 files

FreeBSD/src 860c84bsys/net pfvar.h, sys/netpfil/pf pf_ioctl.c pf.c

pf: Stop using net_epoch to synchronize access to eth rules

Commit 20c4899a8eea4 modified pf_test_eth_rule() to not acquire the
rules read lock, so pf_commit_eth() was changed to wait until the
now-inactive rules are no longer in use before freeing them.  In
particular, it uses the net_epoch to schedule callbacks once the
inactive rules are no longer visible to packet processing threads.

However, since commit 812839e5aaaf4, pf_test_eth_rule() acquires the
rules read lock, so this deferred action is unneeded.  This patch
reverts a portion of 20c4899a8eea4 such that we avoid using deferred
callbacks to free inactive rules.

The main motivation is performance: epoch_drain_callbacks() is quite
slow, especially on busy systems, and its use in the DIOCXBEGIN handler
in particular causes long stalls in relayd when reloading configuration.

Reviewed by:    kp
MFC after:      2 weeks

    [5 lines not shown]
DeltaFile
+3-29sys/netpfil/pf/pf_ioctl.c
+3-6sys/netpfil/pf/pf.c
+0-1sys/net/pfvar.h
+6-363 files