Commit graph

1,480,983 commits

Author SHA1 Message Date
Jakub Kicinski
f225a7317c selftests: drv-net: split gro.py into one test per coalescing mode
gro.py runs its full set of cases three times over - against SW GRO,
HW GRO and LRO. It's our test with the longest runtime. The 318 cases
take 12m30s on mlx5 with a debug kernel.

Bumping the timeout for all tests feels wrong when we can so easily
split the GRO test by execution mode. Shorter runtime also helps retry
just the failing portion / mode (we retry failing tests to try to
detect flakes vs real failures).

Move the main logic to gro_lib.py and add one program per mode -
gro_sw.py, gro_hw.py and gro_lro.py, 102 cases each. Move PPPoE to
a dedicated test. It has been tacked onto the tests in an ugly way,
and it only runs against SW GRO anyway.

Note that unfortunately this will case a rename of all test cases.
The mode moves from the case name to the test name

  gro.py test.sw_ipv4_data_same

becomes

  gro_sw.py test.ipv4_data_same

Reviewed-by: Joe Damato <joe@dama.to>
Reviewed-by: Nimrod Oren <noren@nvidia.com>
Reviewed-by: Willem de Bruijn <willemb@google.com>
Link: https://patch.msgid.link/20260901200728.2063720-3-kuba@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-09-02 18:33:33 -07:00
Jakub Kicinski
889b0cca6b selftests: drv-net: hw: rename gro_hw.py to gro_stats.py
We need to free up the gro_hw.py name for the HW-GRO half of gro.py,
which we need to split by mode (sw / hw / lro). The file checks mostly
qstat counters, so name it after stats.

Reviewed-by: Joe Damato <joe@dama.to>
Reviewed-by: Nimrod Oren <noren@nvidia.com>
Reviewed-by: Willem de Bruijn <willemb@google.com>
Link: https://patch.msgid.link/20260901200728.2063720-2-kuba@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-09-02 18:33:33 -07:00
Krzysztof Kozlowski
577b53589d dt-bindings: net: fsl,fman-dtsec: Drop redundant pcs-handle-names dependency
The binding references ethernet-controller.yaml schema, which already
defines a dependency of pcs-handle-names on pcs-handle, thus duplicating
it here is redundant.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Link: https://patch.msgid.link/20260901061255.25734-2-krzysztof.kozlowski@oss.qualcomm.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-09-02 18:32:50 -07:00
Jakub Kicinski
8f051d2d06 Merge branch 'net-dsa-realtek-enable-rtl8365mb-power-supplies'
Oleksij Rempel says:

====================
net: dsa: realtek: enable RTL8365MB power supplies

The RTL8365MB family has several external power rails (analog, digital I/O
and PLL supplies) that on some boards are gated by regulators. Until now the
driver assumed they were always on, so it could not be used on designs that
keep these rails software-controlled.

This series adds a device-tree description for those supplies and enables
them in the driver before the chip is accessed:

The supplies are optional: boards that hard-wire the rails work unchanged
====================

Link: https://patch.msgid.link/20260831123637.666457-1-o.rempel@pengutronix.de
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-09-02 18:26:50 -07:00
Oleksij Rempel
bd6b764f08 net: dsa: realtek: rtl83xx: use dev_err_cast_probe() for reset GPIO
Replace the open-coded dev_err() + ERR_CAST() on the reset GPIO error
path with dev_err_cast_probe(), matching the reset controller above and
staying quiet on -EPROBE_DEFER.

Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
Reviewed-by: Luiz Angelo Daros de Luca <luizluca@gmail.com>
Link: https://patch.msgid.link/20260831123637.666457-4-o.rempel@pengutronix.de
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-09-02 18:26:48 -07:00
Ahmad Fatoum
f823644996 net: dsa: realtek: rtl83xx: add support for enabling supplies
The power supplies powering the IC may not necessarily be enabled by the
time the driver probes.  The binding describes the power rails, so enable
them at probe with devm_regulator_bulk_get_enable(), before the reset line
is requested and driven, so the chip is powered before its pins are driven.

Boards that do not describe these supplies fall back to dummy regulators
(with a "supply not found" warning) and keep working as before.

A board that describes supplies but no reset line still needs to wait for
the chip to boot before the first register access, so apply the existing
start delay in that case too.

Signed-off-by: Alvin Šipraga <alsi@bang-olufsen.dk>
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Co-developed-by: Oleksij Rempel <o.rempel@pengutronix.de>
Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
Reviewed-by: Linus Walleij <linusw@kernel.org>
Reviewed-by: Luiz Angelo Daros de Luca <luizluca@gmail.com>
Link: https://patch.msgid.link/20260831123637.666457-3-o.rempel@pengutronix.de
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-09-02 18:26:48 -07:00
Oleksij Rempel
f4d0254187 dt-bindings: net: dsa: realtek: add RTL8365MB power supplies
Document the RTL8365MB power rails as optional supplies. They are optional
because the rails are often always-on; some designs break them out for
granular hwmon monitoring and regulator control.

They are scoped to realtek,rtl8365mb: different Realtek switch families use
different power-rail naming schemes, so these rails do not apply to other
families such as realtek,rtl8366rb (VDDA/VDD_CORE/VDDIO/...).

Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
Reviewed-by: Linus Walleij <linusw@kernel.org>
Reviewed-by: Luiz Angelo Daros de Luca <luizluca@gmail.com>
Acked-by: Conor Dooley <conor.dooley@microchip.com>
Link: https://patch.msgid.link/20260831123637.666457-2-o.rempel@pengutronix.de
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-09-02 18:26:48 -07:00
Eric Dumazet
4187c29c2a net: optimize netif_is_l3_master() and netif_is_l3_slave()
IFF_L3MDEV_MASTER and IFF_L3MDEV_SLAVE flags are only set and used
by the VRF driver (CONFIG_NET_VRF).

netif_is_l3_master() and netif_is_l3_slave() are called in multiple
performance-critical fast paths (such as GRO, IP routing/FIB lookups,
TCP/UDP processing, etc.).

When CONFIG_NET_VRF is disabled, neither flag can ever be set on any
net_device.

Adding IS_ENABLED(CONFIG_NET_VRF) allows the compiler to optimize
these checks away as false at compile time, eliminating unnecessary
conditional branches in the fast path when VRF is not enabled.

scripts/bloat-o-meter shows a nice code size reduction on a kernel
built with CONFIG_NET_VRF=n (and CONFIG_NET_L3_MASTER_DEV=y):

add/remove: 2/5 grow/shrink: 18/71 up/down: 1593/-5642 (-4049)
Function                                     old     new   delta
ipip6_tunnel_lookup.constprop                  -     931    +931
tcp_v6_parse_md5_keys                       1607    1742    +135
ipip6_err                                    617     738    +121
bpf_lwt_xmit_reroute                        1492    1555     +63
ip6_pol_route                               1810    1843     +33
rt6_multipath_rebalance.part                1448    1480     +32
bpf_msg_pull_data                           1255    1287     +32
__unlikely_text_end                         3092    3124     +32
ipv6_add_addr                               2257    2287     +30
__ip4_datagram_connect                      1131    1158     +27
ip6_rt_cache_alloc                           476     500     +24
fib6_clean_tohost                            308     328     +20
sit_exit_rtnl_net                            461     477     +16
nf_nat_register_fn                           581     597     +16
ip6_forward                                 4573    4589     +16
inet_rtm_getroute                           2906    2922     +16
__pfx_ipip6_tunnel_lookup.constprop            -      16     +16
__ip_do_redirect                            2005    2021     +16
__bpf_skc_lookup                             449     464     +15
addrconf_add_dev                             134     136      +2
ip6_rcv_finish                               203     201      -2
icmp6_dev                                    159     153      -6
ipip6_tunnel_bind_dev                        419     409     -10
bpf_xdp_skc_lookup_tcp                       122     107     -15
bpf_tc_skc_lookup_tcp                        125     110     -15
rt6_nh_dump_exceptions                       243     227     -16
ip_mc_source                                1385    1369     -16
ip6_fragment                                2450    2434     -16
input_action_end_x                           278     262     -16
fib6_nh_age_exceptions.part                  822     806     -16
__pfx_ipip6_tunnel_lookup                     16       -     -16
__pfx_ip6_rt_get_dev_rcu                      16       -     -16
__addrconf_sysctl_register                   365     349     -16
bpf_xdp_sk_lookup_udp                        155     138     -17
bpf_xdp_sk_lookup_tcp                        155     138     -17
bpf_tc_sk_lookup_udp                         158     141     -17
bpf_tc_sk_lookup_tcp                         158     141     -17
addrconf_addr_gen                            339     322     -17
ip6_rcv_core                                2084    2066     -18
fib_nl2rule_locked                           517     499     -18
l3mdev_master_upper_ifindex_by_index_rcu      61      42     -19
ipip6_rcv                                   1960    1941     -19
addrconf_notify                             2563    2543     -20
l3mdev_fib_table_by_index                    304     282     -22
nf_nat_inet_fn                               777     754     -23
attach_rules                                 176     150     -26
ipv6_rcv                                     867     840     -27
ip_sublist_rcv                              1342    1315     -27
ip6_sublist_rcv                             1528    1501     -27
sit_tunnel_rcv                               498     470     -28
ndisc_send_redirect                         1474    1445     -29
ip_mr_input                                 1175    1143     -32
ip6_mr_input                                 627     595     -32
tcp_ao_add_cmd.cold                           33       -     -33
ip_error                                    1059    1023     -36
raw_sendmsg                                 5291    5253     -38
end_dt_vrf_core                              466     426     -40
ip_rcv                                       886     844     -42
ip_send_unicast_reply                       1487    1443     -44
udp_sendmsg                                 4135    4089     -46
delete_tempaddrs                             259     211     -48
udp6_gro_receive                            1142    1092     -50
udp4_lib_lookup_skb                          259     208     -51
l3mdev_fib_rule_match                        337     286     -51
ping_v4_sendmsg                             2692    2640     -52
tcp6_check_fraglist_gro                      341     288     -53
l3mdev_master_ifindex_rcu                     69      16     -53
ip6_dst_lookup_tail.constprop               1533    1480     -53
udp4_gro_receive                            1139    1085     -54
igmp_rcv                                    3215    3160     -55
ndisc_recv_ns                               1699    1642     -57
fib_netdev_event                             771     714     -57
l3mdev_link_scope_lookup                     124      65     -59
udp6_lib_lookup_skb                          173     113     -60
__ip_local_out                              1182    1120     -62
ipv6_frag_rcv                               3670    3601     -69
ip_route_output_key_hash_rcu                3024    2951     -73
__ip6_local_out                             1164    1091     -73
tcp_v6_send_response                        3056    2982     -74
rt6_fill_node                               4103    4027     -76
rawv6_sendmsg                               6225    6149     -76
l3mdev_fib_table_rcu                          92      16     -76
tcp4_gro_receive                            1375    1295     -80
ip6_xmit                                    2771    2690     -81
fib_select_path                             2190    2105     -85
tcp_v4_parse_md5_keys                       1160    1058    -102
ip_route_input_slow                         4471    4354    -117
ip6_pkt_drop.isra                            572     453    -119
l3mdev_update_flow                           516     360    -156
ip6_rt_get_dev_rcu                           182       -    -182
__ipv6_chk_addr_and_flags                    750     568    -182
ip_route_input_rcu.part                      941     743    -198
nf_confirm                                  1222     960    -262
ipv6_dev_get_saddr                          1321     918    -403
tcp_ao_add_cmd                              2643    2211    -432
ipip6_tunnel_lookup                         1004       -   -1004
Total: Before=33195512, After=33191463, chg -0.01%

Signed-off-by: Eric Dumazet <edumazet@google.com>
Link: https://patch.msgid.link/20260831154129.4048178-1-edumazet@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-09-02 18:20:36 -07:00
Jakub Kicinski
1c03d3ae5c Merge branch 'bonding-fix-tlb-load-tracking-overflow-on-high-speed-nics'
Hangbin Liu says:

====================
bonding: fix TLB load-tracking overflow on high-speed NICs

The bonding TLB (Transmit Load Balancing) mode tracks per-slave and
per-client transmit byte counts in u32 fields. At sustained throughput
above ~3.2 Gbit/s over the 10-second rebalance interval these counters
wrap, causing compute_gap() to produce incorrect gap values and
mis-select transmit slaves. Such speeds are routine on modern NICs
under heavy traffic.

This two-patch series fixes the overflow by widening the relevant
fields to u64.

Patch 1 converts the unbalanced_load counter to per-cpu state as a
preparatory step. The counter sits in the transmit hot path, so
converting it to per-cpu before widening avoids introducing cross-CPU
synchronization overhead for a u64. Also use a prev_total_unbalanced
to store the previous total load to avoid reset per-cpu data.

Patch 2 widens tx_bytes, load_history, load, and the per-cpu
unbalanced_load tx_bytes from u32 to u64. It adds u64_stats_sync
protection for the per-cpu counter to prevent tearing on 32-bit
architectures, and reworks compute_gap() to use s64 arithmetic with
READ_ONCE() on slave->speed.
====================

Link: https://patch.msgid.link/20260831-bond_overflow-v6-0-ffb0ed1f7268@kylinos.cn
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-09-02 18:17:56 -07:00
Hangbin Liu
4cef95f72b bonding: fix u32 overflow in compute_gap()
The TLB load-tracking fields tx_bytes, load_history, load, and
unbalanced_load are all u32. At sustained throughput above ~3.2 Gbit/s
over the 10-second rebalance interval the byte counters wrap, causing
compute_gap() to produce incorrect gap values and mis-select slaves.
Such speeds are common on modern NICs under heavy traffic.

Widen these fields to u64. Use u64_stats_sync to protect the per-cpu
unbalanced_load_stats against tearing on 32-bit architectures, and
div_u64() for the 64-bit divisions. The tx_bytes and load_history
are protected in spin_lock. Also protect the slave load writing in
bond_alb_monitor() with spin_lock in case of tear on 32-bit.

For compute_gap(), we still use s64 arithmetic throughout, so we can
preserve the existing calculation logic. This order of magnitude is
sufficiently large, there is no need to worry about overflow for now.

Detected by AI code review.

Cc: stable+noautosel@kernel.org # never worked
Reviewed-by: Nikolay Aleksandrov <razor@blackwall.org>
Signed-off-by: Hangbin Liu <liuhangbin@kylinos.cn>
Acked-by: Jay Vosburgh <jv@jvosburgh.net>
Link: https://patch.msgid.link/20260831-bond_overflow-v6-2-ffb0ed1f7268@kylinos.cn
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-09-02 18:17:47 -07:00
Hangbin Liu
e147615635 bonding: convert unbalanced_load to per-cpu state
A later patch widens the bonding TLB tx counters from u32 to u64. The
unbalanced_load counter sits in the transmit hot path, and cross-CPU
synchronization of a u64 would introduce measurable overhead. Convert
unbalanced_load to a per-cpu counter first so that the subsequent
widening only touches per-cpu data local to each CPU.

Introduce struct unbalanced_load_stats to hold the per-cpu counter,
and move the aggregation into a helper, reset_unbalanced_load(), which
sums all per-cpu instances. Use the delta of current total load vs
variable prev_total_unbalanced to calculate the loading.

Reviewed-by: Nikolay Aleksandrov <razor@blackwall.org>
Signed-off-by: Hangbin Liu <liuhangbin@kylinos.cn>
Acked-by: Jay Vosburgh <jv@jvosburgh.net>
Link: https://patch.msgid.link/20260831-bond_overflow-v6-1-ffb0ed1f7268@kylinos.cn
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-09-02 18:17:44 -07:00
Dexuan Cui
d0ec95a8a4 hv_netvsc: Advertise the SR-IOV capability for CoCo VMs
This basically reverts the Feb 2021 change:
commit 96854bbda2 ("hv_netvsc: Restrict configurations on isolated guests")

In Feb 2021, PCI device assignment for CoCo VMs on Hyper-V was not
supported: if the host offered a PCI VF NIC device to the VM, the VM
couldn't handle it properly, so the 2021 commit was made to tell the host
"I'm unable to handle SR-IOV NICs, so please don't offer a VF to me".
If the host offers a VF NIC to the VM anyway, the change to
netvsc_receive_inband() ignores the VF NIC.

Since Mar 2023, the VM is able to support PCI device assignment due to
commit 2c6ba42168 ("PCI: hv: Enable PCI pass-thru devices in Confidential VMs")
and related commits, so hv_netvsc can functionally work with a VF NIC, but
we haven't advertised the SR-IOV capability because the MANA NIC driver
(drivers/net/ethernet/microsoft/mana/) hadn't been hardened, so a
malicious MANA NIC might be able to attack the VM.

Recently, we have finished hardening the MANA driver, so we can safely
use the MANA NIC in a CoCo VM now. Note: currently the MANA driver in a
CoCo VM still uses bounce buffering (i.e. shared decrypted memory)
for DMA. In the future, it will be able to use private encrypted
memory for DMA with the help of TDISP.

Now, advertises the SR-IOV capability for CoCo VMs.

Note: for MANA to work properly for CoCo VMs, the following earlier
commits are also required:
commit 2e2a83b499 ("net: mana: Validate the packet length reported by the NIC")
commit c72a0f09c5 ("net: mana: Sync page pool RX frags for CPU")

Note: the host might offer a VF NIC device that's not MANA -- in that
case, if the corresponding VF NIC driver isn't hardened for CoCo VMs,
the driver should be blacklisted in CoCo VMs.

Signed-off-by: Dexuan Cui <decui@microsoft.com>
Reviewed-by: Haiyang Zhang <haiyangz@microsoft.com>
Reviewed-by: Michael Kelley <mhklinux@outlook.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2026-09-02 10:09:01 +01:00
Pengpeng Hou
c29b37ed7a net: fbnic: validate mailbox TLV extents
The mailbox path warns when a message claims more bytes than the descriptor
but still parses it. The attribute walkers also validate a child TLV before
proving that its declared span fits in the parent remainder.

Reject invalid mailbox message extents and bound each child attribute
before type-specific validation.

Cc: stable+noautosel@kernel.org # assumes malicious PCIe device
Signed-off-by: Pengpeng Hou <pengpeng@iscas.ac.cn>
Link: https://patch.msgid.link/20260830142516.38145-1-pengpeng@iscas.ac.cn
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-09-01 17:31:46 -07:00
Jakub Kicinski
0a1071aa32 Merge branch 'net-prepare-skb-extensions-for-reuse-across-scrubs'
Jakub Sitnicki says:

====================
net: Prepare skb extensions for reuse across scrubs

Following Florian's suggestion from the discussion in [1].

The skb extension allocator retains the extension's offset after the
extension is deleted. This, in theory, allows skb_ext_add() to reuse the
existing storage instead of appending another copy when an extension is
added again.  However, it also means that we can't rely on the offset as an
indicator that the extension is present.

Make the extension cleanup safe, even when the offset is already allocated
and set, by making the individual extension put helpers idempotent, so that
they can be called multiple times.

This is preparatory work to support skb extension chunk area reuse after
skb scrubbing, which would be needed to persist BPF metadata skb extension
across scrubs [2].

[1] https://lore.kernel.org/ao9UV9S7rUkyQ8jv@strlen.de
[2] https://lore.kernel.org/64365932-c765-472e-bf6c-b07c9ee25eaf@kernel.org
====================

Link: https://patch.msgid.link/20260831-skb-ext-prep-work-v1-0-ecc2a8542fd9@cloudflare.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-09-01 17:11:29 -07:00
Jakub Sitnicki
dbe45b209e net: Make skb_ext_put_mctp() idempotent
The MCTP flow extension can be released either when it is deleted from an
skb or when the last skb holding the extension block is freed. Handle the
release in __skb_ext_del(), which is currently missing, and make
skb_ext_put_mctp() safe to call from both paths.

This will let __skb_ext_put() release the MCTP key without checking whether
the extension is present first, which is needed if we want to reuse skb_ext
chunks area after skb scrubbing.

Suggested-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Jakub Sitnicki <jakub@cloudflare.com>
Acked-by: Jeremy Kerr <jk@codeconstruct.com.au>
Link: https://patch.msgid.link/20260831-skb-ext-prep-work-v1-2-ecc2a8542fd9@cloudflare.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-09-01 17:11:26 -07:00
Jakub Sitnicki
d7470cba6d net: Make skb_ext_put_sp() idempotent
The sec_path extension can be released either when it is deleted from an
skb or when the last skb holding the extension block is freed. Make
skb_ext_put_sp() safe to call from both paths by returning when
sec_path->len is zero and clearing it after dropping the XFRM state
references.

This will let __skb_ext_put() release the sec_path without checking whether
the extension is present first, which is needed if we want to reuse skb_ext
chunks area after skb scrubbing.

Signed-off-by: Jakub Sitnicki <jakub@cloudflare.com>
Link: https://patch.msgid.link/20260831-skb-ext-prep-work-v1-1-ecc2a8542fd9@cloudflare.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-09-01 17:11:26 -07:00
Paolo Abeni
c8ea08ba34 Merge branch 'netlink-specs-rt-link-ipv6-devconf-updates'
says:

====================
netlink: specs: rt-link: ipv6 devconf updates

This series updates the doc-string for ifla-inet6-conf, and adds
two missing ipv6-devconf enum values as identified by Sashiko
during review of v1.

v1: https://lore.kernel.org/20260824103816.40040-1-ast@fiberby.net
====================

Link: https://patch.msgid.link/20260831093458.472180-1-ast@fiberby.net
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
2026-09-01 15:22:21 +02:00
Asbjørn Sloth Tønnesen
f952040d70 netlink: specs: rt-link: add force-forwarding
Add missing enum member force-forwarding to ipv6-devconf.

In commit f24987ef69 ("ipv6: add `force_forwarding` sysctl to
enable per-interface forwarding"), the DEVCONF_* enum was extended
with DEVCONF_FORCE_FORWARDING, however Gabriel forgot to add it
to the spec.

This pre-existing issue was detected by Sashiko, when reviewing the
first patch in this series.

Link: https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20260824103816.40040-1-ast%40fiberby.net
Signed-off-by: Asbjørn Sloth Tønnesen <ast@fiberby.net>
Reviewed-by: Fernando Fernandez Mancera <fmancera@suse.de>
Reviewed-by: Gabriel Goller <g.goller@proxmox.com>
Link: https://patch.msgid.link/20260831093458.472180-4-ast@fiberby.net
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
2026-09-01 15:22:05 +02:00
Asbjørn Sloth Tønnesen
2b0aecb7b2 netlink: specs: rt-link: add accept-ra-min-lft
Add missing enum member accept-ra-min-lft to ipv6-devconf.

In commit 1671bcfd76 ("net: add sysctl accept_ra_min_rtr_lft")
the DEVCONF_* enum was extended with DEVCONF_ACCEPT_RA_MIN_RTR_LFT.

It was renamed to DEVCONF_ACCEPT_RA_MIN_LFT in commit 5027d54a9c
("net: change accept_ra_min_rtr_lft to affect all RA lifetimes").

Shortly thereafter, this spec was introduced in commit b2f63d904e
("doc/netlink: Add spec for rt link messages").

This pre-existing issue was detected by Sashiko, when reviewing the
first patch in this series.

Link: https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20260824103816.40040-1-ast%40fiberby.net
Signed-off-by: Asbjørn Sloth Tønnesen <ast@fiberby.net>
Reviewed-by: Fernando Fernandez Mancera <fmancera@suse.de>
Link: https://patch.msgid.link/20260831093458.472180-3-ast@fiberby.net
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
2026-09-01 15:22:05 +02:00
Asbjørn Sloth Tønnesen
5e63ade190 netlink: specs: rt-link: update ipv6 devconf doc
devconf is even odder than described in commit 720447bd0b
("netlink: specs: rt-link: remove implicit structs from devconf"),
where both IPv4 and IPv6 are described in an identical way:
"u32 indexed by ipv?-devconf - 1 on output, on input it's a nest".

There are two issues with that line for IPv6:

1) The subtraction is an IPv4 specific quirk, to avoid having an unused
   u32 at index 0, thus saving 4 bytes per net device being dumped:

   - In include/uapi/linux/ip.h the IPV4_DEVCONF_* enum begins with
     IPV4_DEVCONF_FORWARDING = 1, so the enum starts at 1, which is
     the reason for the subtraction in the IPv4 variant.

   - In include/uapi/linux/ipv6.h the DEVCONF_* enum begins with
     DEVCONF_FORWARDING = 0, so subtraction would underflow.

   - ipv6_store_devconf() in net/ipv6/addrconf.c also doesn't do the
     subtraction in the output path.

2) Setting IPv6 devconf through Netlink is not yet supported, as
   IFLA_INET6_CONF is not handled in inet6_set_link_af().

Reviewed-by: Fernando Fernandez Mancera <fmancera@suse.de>
Signed-off-by: Asbjørn Sloth Tønnesen <ast@fiberby.net>
Link: https://patch.msgid.link/20260831093458.472180-2-ast@fiberby.net
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
2026-09-01 15:22:05 +02:00
Maxime Chevallier
85ca3292d7 net: stmmac: Remove ARP offload code
dwmac can do ARP offloading, where the HW replies to incoming ARP
requests. This requires multiple steps to work well :
 - Program the local IP address in a dedicated register
 - Enable ARP offloading

This is halfway implemented in stmmac, as it's only ever used by
selftests, and these selftests are failing on at least 2 platforms :
stm32mp1, and jh7110.

There have been some attempts in the past to support this feature, but
this never made it upstream. Let's just remove the test and that code,
until someone actually wants that to work. We should likely have a
proper API for that so that drivers can use it.

Let's also not mention ARP offload in the stmmac documentation.

Leave the defines in place and the capability detection, this doesn't
hurt and gives some information about how the IP is synthesized.

Signed-off-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
Reviewed-by: Nicolai Buchwitz <nb@tipi-net.de>
Link: https://patch.msgid.link/20260831071351.354255-1-maxime.chevallier@bootlin.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
2026-09-01 15:14:43 +02:00
ZhaoJinming
25c1f61110 net: stmmac: stop DMA before freeing descriptors on open
In __stmmac_open() and stmmac_xdp_open(), the DMA engine is started
before stmmac_request_irq() is called.  If the IRQ request fails, the
clean-up paths free the DMA descriptor rings via dma_free_coherent()
without stopping the DMA engine first.

With the DMA engine still running, hardware may continue to access the
descriptor ring memory after it has been freed.  Add stmmac_stop_all_dma()
to both error paths, matching the teardown order in __stmmac_release().

Cc: stable+noautosel@kernel.org # untested fix to unlikely driver error path
Signed-off-by: ZhaoJinming <zhaojinming@uniontech.com>
Link: https://patch.msgid.link/32EB352EB66D74E7+20260827025415.2684733-1-zhaojinming@uniontech.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-08-31 17:10:40 -07:00
Jakub Kicinski
1bb784eb6e Merge branch 'net-phy-fix-cleanup-after-probe-failure'
Xuanqiang Luo says:

====================
net: phy: fix cleanup after probe failure

phy_probe() initializes the PHY driver, ports, SFP upstream, and LEDs in
stages. Its error paths do not always release only the resources acquired
at each stage. It can also mark the PHY ready before all setup succeeds.

Port setup also leaves SFP cleanup split between phy_sfp_probe(),
phy_setup_ports(), and phy_probe(), and default port setup ignores errors
from attaching the port to the PHY driver.

This series makes each initialization layer own its cleanup and propagates
setup failures to the caller.

Patch 1 splits the phy_probe() cleanup by initialization stage.

Patch 2 makes SFP and port setup unwind their resources in the required
order.

Patch 3 sets PHY_READY only after LED setup succeeds.

Patch 4 calls the PHY driver remove callback after later probe failures.

Patch 5 propagates errors from default port setup.

Patch 6 prevents a double-free after partial LED trigger registration.
====================

Link: https://patch.msgid.link/20260823035600.188864-1-xuanqiang.luo@linux.dev
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-08-30 17:01:11 -07:00
Xuanqiang Luo
f7f619ecda net: phy: avoid double-free after LED trigger registration failure
phy_led_triggers_register() frees phy_led_triggers when a speed trigger
registration fails, but leaves the pointer set to the freed allocation
before clearing phy_num_led_triggers.

phy_probe() ignores the registration error. If a later probe step fails,
its error path calls phy_led_triggers_unregister(); normal teardown during
an unbind or MDIO bus removal calls the same helper from phy_remove().
In either case, the trigger count is zero, so the per-trigger unregister
loop is skipped, but the dangling pointer is still freed unconditionally.

Clear the pointer when partial registration cleanup frees the array, and
make phy_led_triggers_unregister() free the array only when its pointer is
non-NULL.

Signed-off-by: Xuanqiang Luo <luoxuanqiang@kylinos.cn>
Link: https://patch.msgid.link/20260823035600.188864-7-xuanqiang.luo@linux.dev
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-08-30 17:01:07 -07:00
Xuanqiang Luo
48378efebb net: phy: propagate errors from default port setup
phy_default_setup_single_port() ignores errors from phy_add_port() and
always reports success. If a PHY driver attach_mdi_port() callback fails,
the phy_port is leaked and PHY probing continues without the expected
default port.

Destroy the port and return the error.

Reviewed-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
Signed-off-by: Xuanqiang Luo <luoxuanqiang@kylinos.cn>
Link: https://patch.msgid.link/20260823035600.188864-6-xuanqiang.luo@linux.dev
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-08-30 17:01:04 -07:00
Xuanqiang Luo
afd5aecd3c net: phy: call driver remove when core initialization fails
phy_probe() may fail while querying features or completing other core
initialization after the PHY driver probe callback has succeeded. The
driver core does not run the remove path after a probe error, so
resources that the PHY driver releases in its remove callback are
leaked.

Call the PHY driver remove callback on these failures.

Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Xuanqiang Luo <luoxuanqiang@kylinos.cn>
Link: https://patch.msgid.link/20260823035600.188864-5-xuanqiang.luo@linux.dev
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-08-30 17:01:01 -07:00
Xuanqiang Luo
52dd7eb1a3 net: phy: set PHY_READY after LED setup
phy_probe() sets PHY_READY before calling of_phy_leds(). If LED setup
fails, the error path releases the initialized resources while the PHY
state remains READY even though probing failed.

Set PHY_READY only after LED setup succeeds.

Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Xuanqiang Luo <luoxuanqiang@kylinos.cn>
Link: https://patch.msgid.link/20260823035600.188864-4-xuanqiang.luo@linux.dev
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-08-30 17:00:59 -07:00
Xuanqiang Luo
f558204abc net: phy: unregister SFP upstream before port cleanup
Commit 4497f50286 ("net: phy: Clean the phy_ports after unregistering
the downstream SFP bus") established that an SFP upstream must be
unregistered before its phy_ports are destroyed because SFP callbacks
may access these ports.

phy_setup_ports() does not follow this order when a later port setup
step fails after phy_sfp_probe() succeeds. It destroys the SFP phy_port
and leaves phy_probe() to unregister the upstream later, creating a race
between port destruction and SFP upstream callbacks.

The error unwind is also split across three functions. If
phy_setup_sfp_port() fails, phy_sfp_probe() leaves the upstream
registered and relies on phy_probe() to remove it after
phy_setup_ports() returns.

Make each layer unwind the resources it successfully set up. Unregister
only the upstream in phy_sfp_probe() when SFP port setup fails, since
the failed port has already been destroyed. Add phy_sfp_release() for a
successful SFP probe, and make phy_setup_ports() use it before cleaning
up the remaining ports. Once phy_setup_ports() has rolled back all port
setup, make phy_probe() skip this cleanup.

Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Xuanqiang Luo <luoxuanqiang@kylinos.cn>
Link: https://patch.msgid.link/20260823035600.188864-3-xuanqiang.luo@linux.dev
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-08-30 17:00:56 -07:00
Xuanqiang Luo
b6d201d971 net: phy: split phy_probe() error paths
phy_probe() uses one cleanup path for failures at every initialization
stage. This runs cleanup for resources that have not been initialized.

After a successful probe and remove, phy_led_triggers_unregister() can
leave phy_num_led_triggers non-zero after freeing the trigger array. If a
subsequent probe fails before LED trigger registration, the common error
path calls phy_led_triggers_unregister() with a NULL array and stale count,
causing a NULL dereference.

Split the cleanup by initialization stage so each failure path unwinds only
the resources that may have been initialized. Unregister LED triggers
before releasing the SFP upstream and ports, because the LED triggers are
initialized after those resources and must be unwound first.

Signed-off-by: Xuanqiang Luo <luoxuanqiang@kylinos.cn>
Link: https://patch.msgid.link/20260823035600.188864-2-xuanqiang.luo@linux.dev
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-08-30 17:00:53 -07:00
Linus Torvalds
1b78070aae Including fixes from Bluetooth, IPSec and Netfilter.
Current release - fix to a fix:
 
  - netfilter: ipset: remove need to allocate memory on delete operations
 
 Current release - regressions:
 
  - macb: drop CONFIG_OF #if block, fix build
 
 Previous releases - always broken:
 
  - stream of fixes for SCTP continues
 
  - inet: frags: strip GSO state from fragments before reassembly
 
  - virtio-net: ensure that TCP packets don't overflow gso_segs
 
  - tcp-ao: fix use-after-free of current_key on reconnect to another peer
 
  - page_pool: remove zone/policy GFP flags when allocating XArray entries
 
  - Bluetooth: L2CAP: reject accept queue add unless BT_LISTEN
 
  - tls: device: fix out-of-bounds write in tls_append_frag()
 
  - eth: bnxt:
    - ring the doorbell when SW USO exits early, avoid packets stuck in Tx
    - gate TPH enablement behind BNXT_SUPPORTS_QUEUE_API check, avoid users
      of older NICs seeing non-actionable warning messages
 
  - eth: qede: fix NULL pointer dereference in TPA fragment processing
 
 Signed-off-by: Jakub Kicinski <kuba@kernel.org>
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEE6jPA+I1ugmIBA4hXMUZtbf5SIrsFAmqQojwACgkQMUZtbf5S
 Irv2kg//anC58qIya/Tx3BZkpPgtbS+ki0bqb+J0a8axbItgSGEdclVtiLJn/ex0
 zz9AR4Pt2DSbSUHPa7nRpdMQ2x7ZmNwNR2zqs1xClgOm5QD/2JAc53Pv81GaEKa4
 O4A4TDJZfyTDsk6c0cjI3yz9uMqBt2U6pyAT6JMBIPy7/MgV+as0ETAWQlezL0sF
 ZnXVg9tM3hG/8a3M88+/S1VODVJYLMucXS6pD1mqlry01SUj91elEXKiac5vCaHI
 DAZaiCOmv4WV3hs7941VijPchLO64L0J+0qjGRpXiPJXQEAn4XU8QX/YNc1njgZH
 tmjRWEEtLoBFcLRDUPAK9niuB5F9N3/6nnydLPLu16+exKQuCB8Bh78YHLmlrJIW
 utY5ek7GtPOl31M9a5TdEGLUg5wPHSO62FhiBmTiIG4PKQym616TmOHbYJWBqFry
 EPNtZ1vEJoPFNOsT1VdeD4DKVBq2UDnj/3fnphUhfvU5z+dEDdIn03+kQykwmVQT
 kTuMaW4/zxR3VFjHalsI+4bvhFOEmu+/KZE07aKKm99jssDsewQHGXgYJkCPWQUk
 gpnN8IVNw16ex9sfrvqje6/tshiPJJn9y/b/nGt5mq9ofgwXGmpzCPwcDgyzZKQ5
 y+zVPJ0/XILHAHOBxdCklim5xiaPDYKdEI+zcEXrx/g6FraZZuI=
 =1DXR
 -----END PGP SIGNATURE-----

Merge tag 'net-7.3-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net

Pull networking fixes from Jakub Kicinski:
 "Including fixes from Bluetooth, IPSec and Netfilter.

  Current release - fix to a fix:

   - netfilter: ipset: remove need to allocate memory on delete operations

  Current release - regressions:

   - macb: drop CONFIG_OF #if block, fix build

  Previous releases - always broken:

   - stream of fixes for SCTP continues

   - inet: frags: strip GSO state from fragments before reassembly

   - virtio-net: ensure that TCP packets don't overflow gso_segs

   - tcp-ao: fix use-after-free of current_key on reconnect to another
     peer

   - page_pool: remove zone/policy GFP flags when allocating XArray
     entries

   - Bluetooth: L2CAP: reject accept queue add unless BT_LISTEN

   - tls: device: fix out-of-bounds write in tls_append_frag()

   - eth: bnxt:
      - ring the doorbell when SW USO exits early, avoid packets stuck
        in Tx
      - gate TPH enablement behind BNXT_SUPPORTS_QUEUE_API check, avoid
        users of older NICs seeing non-actionable warning messages

   - eth: qede: fix NULL pointer dereference in TPA fragment processing"

* tag 'net-7.3-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (216 commits)
  inet: frags: strip GSO state from fragments before reassembly
  net/sched: sch_htb: limit htb_classify inner-class filter hops
  selftests/net: packetdrill: add tcp_urg_ptr_retransmit
  tcp: fix corruption of urgent data on multi-segment retransmit
  usb: atm: usbatm: fix invalid ci_range initialization
  net: fec: only stop PTP if it was initialized
  slip: remove slip_hangup() to fix use-after-free in slip_receive_buf()
  net: bridge: mcast: fix use-after-free of a master VLAN's multicast context
  net/sched: bound qdisc_pkt_len to prevent qdisc soft lockup
  net: dsa: mxl862xx: enable assisted learning on CPU port
  net: stmmac: restore NET_IP_ALIGN in the RX DMA offset
  net: stmmac: drop gso_enabled_types and rely on netdev features
  net: stmmac: selftests: Don't test flow control for small rx fifos
  net: stmmac: selftests: Account for the UC filter list for filtering tests
  net: stmmac: dwxgmac: Account for the primary MAC address for UC filtering
  net: stmmac: dwmac4: Account for the primary MAC address for UC filtering
  net: stmmac: dwmac1000: Account for the primary MAC address for UC filtering
  net: stmmac: selftests: Check multiple MMC counters
  selftests: net: Fix slow configurations in big_tcp_tunnels.sh
  selftests: net: Lower threshold with csum offload off in big_tcp_tunnels.sh
  ...
2026-08-27 13:53:43 -07:00
Jakub Kicinski
4a9d62a877 netfilter pull request 26-08-27
-----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEjF9xRqF1emXiQiqU1w0aZmrPKyEFAmqQRZIACgkQ1w0aZmrP
 KyGDXw/9G1jVJaet7bUaiAkQRIFgyarOE7VZXtUcKpxXfRBBghWfyEN3AO9VTuVj
 /tQBwZUGWZnSrBOaLlTS95xD7A3TX+iQ9aMagiH6tVXGDRq3tQFxZim4BP7drdl8
 R6DV1VwwHHQSeb3vMTcXPCK/W1RtMrhdkJOe8olxHp7KAfrnJl7YANdwT508PAh3
 D4Wn0NWQrneEfwe31p7weMQy+w9sh5qSPb3petdwI7an9gCwhiovEtkF0X0EfkbK
 OMorNc/dx56cabwI+U0y2LGn+4lJTz8U5+Z9S/KI1+x/vo1pkeeyEN5jdq9Jcuf/
 Y7q08n1DbBrbbXehfe0u22ttVaENarf7SJhduw4nEOw4oIngfET/FNMbcfsj1uw4
 CvRwL5hV+waI2taOdw4M1MJh0W3qU/IN+dhhigcseAacneoGULOWT9+rynNM/yKe
 cfxmtFU7TFbp9L9tX6/NR1rs6Bv7oAFv98sjsGsdyhxsIZONm/KhX+CYNKfkOZmV
 o8x198CR68Vb+aQTJFL6wJuX9lntMoXjazBYKQxGnzoShywsIKnOKHkvcRMofyT0
 pgzXxlt9W94fnWmxwLoCdhedQjipb0GwG4pSm425nLz8GHOX+Gh+2oFayfzC6kvB
 Gj41ozdfM1VQ0SI6fRr+GA2zQNIBzAQTtwT9y6VVK10ZFyR0fwU=
 =Wak/
 -----END PGP SIGNATURE-----

Merge tag 'nf-26-08-27' of git://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf

Pablo Neira Ayuso says:

====================
Netfilter fixes for net

The following patchset contains Netfilter fixes for net:

1) Use DEBUG_NET_WARN_ON_ONCE() instead of WARN_ON() from the tproxy
   datapath, a recent bug found a way to reach WARN_ON from datapath
   due to insufficient validation of xt_TPROTO checkentry.
   From Fernando F. Mancera.

2) Similar to previous patch to replace WARN_ON_ONCE by
   DEBUG_NET_WARN_ON_ONCE() for connlimit. Not known issue, but
   since this patch has been around for a while, let's merge it.
   Also from Fernando.

3) Move nf_tables harware offload commit path after chain blob
   and audit to reduce chances of leaving the hardware in
   inconsistent state.

4) Add missing vzeroupper to nf_tables pipapo AVX2 to address
   performace degradation to later user of SSE code,
   from Eric Biggers.

5) Remove pr_debug() in x_tables extensions, a recent bogus found a
   way to print a unsanitized string in xt_IDLETIMER, many of these
   pr_debug() calls are there for historical reasons.

6) Use pr_info_ratelimited() in x_tables .checkentry.

7) Fix an imbalance in module refcount due to incorrect override
   expression logic with sets. Remove unnecessary clone in control
   plane, use the existing expressions provided by set or dynset
   expression. Release override expressions only.

8) Tigthen nf_tables device name removal, it is possible to remove
   prefix strings with exact device name. From Fernando F. Mancera.

9) Set on the set dead bit earlier, otherwise it is possible to
   call .commit on deleted sets. This also addresses the
   re-introduction of a bug.

* tag 'nf-26-08-27' of git://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf:
  netfilter: nf_tables: remove leftover set_update_list
  netfilter: nf_tables: set on dead bit when performing early element removal
  netfilter: nf_tables: skip double clone set expressions on element insert
  netfilter: x_tables: replace pr_{info,err}() by pr_info_ratelimited()
  netfilter: x_tables: remove pr_debug
  netfilter: nft_set_pipapo_avx2: add missing vzeroupper
  netfilter: nf_tables: move hardware offload step after building the chain blob
  netfilter: conncount: use DEBUG_NET_WARN_ON_ONCE on reaching count limit
  netfilter: tproxy: use DEBUG_NET_WARN_ON_ONCE for protocol fallbacks
====================

Link: https://patch.msgid.link/20260827141733.423453-1-pablo@netfilter.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-08-27 13:13:18 -07:00
Linus Torvalds
3ba13f5e71 Devicetree fixes for v7.3, part 1:
- Fix possible out-of-bounds access in of_alias_scan()
 
 - Fix refcount leak in of_irq_get_affinity()
 
 - Add Qualcomm SPMI PMIC haptics input which is already referenced
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEktVUI4SxYhzZyEuo+vtdtY28YcMFAmqQfDwACgkQ+vtdtY28
 YcNnZA//TU5OaPuR+cqEdxGUagr1kDhjwfKkOde2h6d1b73f8FWL3r6/vM1ThKVK
 e0RVIcFg39ZYHoNMGUp/LSZUTy8jWUpGbTCCivszPvvFfocLwv9k/FU5LDFtpInl
 jBA02byU4GLWSgDi1DOTaok17HfM6PtFKlilqk/NYGP7WnajknCe+45WglHMMWg/
 SXNZeLGQXC7OZtuqgzqNJqWWzeT+8V0Xl+M8tZk4zljghGkXo0vJ4c7TPNRGY5Gh
 e9NPtTyMjJL7y92jKUWb5JTX8W8Wu+uttq6e8q38gkO9lcK0iNVKU5zZNKRMhrlC
 7500fS9IG5BLV5Fu1eJ8s+LLlBMim1QUjZW9N6+577kVXFi5mfrBkqI5xzUZcn5f
 p5zdyJUT9PeLAVXBotC3ZwWxrKqr6e41OXmSjdch4WoyXVmgcVi0qBgO+fVc92au
 Csfj7/Z/B0jC5YuVQu9qJshXeeCQuTJLluL+/t4jNykSmdjc5cw4Kvom9yrvmlDv
 yBYObHu7cLaRzPd6y7qq2BMk7eEztF7ebQj75SantdYT94NJQq9zaSoQc7vA3w5R
 GiLNu0+K6ZHKoGjn32gIJhvgMq/xK//XXFkK+dKqRZD5s4nZ5oNSR8rj19P4JRo8
 LM+hi5f3f5Xpi7efgXmQGRR0eKyOHV/7oTm5o/BapeuAgaJuEqA=
 =5Xnn
 -----END PGP SIGNATURE-----

Merge tag 'devicetree-fixes-for-7.3-1' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux

Pull devicetree fixes from Rob Herring:

 - Fix possible out-of-bounds access in of_alias_scan()

 - Fix refcount leak in of_irq_get_affinity()

 - Add Qualcomm SPMI PMIC haptics input which is already referenced

* tag 'devicetree-fixes-for-7.3-1' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux:
  of: fix out-of-bounds read in of_alias_scan() stem parser
  of/irq: Fix device node refcount leak in of_irq_get_affinity()
  dt-bindings: input: Add Qualcomm SPMI PMIC haptics
2026-08-27 12:53:43 -07:00
Xinyang Ge
d5dc1e69fd inet: frags: strip GSO state from fragments before reassembly
A virtio_net_hdr (tun/tap, or AF_PACKET with PACKET_VNET_HDR) can mark
an IPv4 or IPv6 fragment as GSO; nothing relates gso_type to frag_off.
inet_frag_reasm_prepare()/inet_frag_reasm_finish() keep the first
fragment's skb as the head of the reassembled datagram, including its
shinfo->gso_size/gso_type/gso_segs, and chain the remaining fragments
on frag_list with whatever linear/paged layout they arrived with.

After ip_defrag() (ip_local_deliver(), nf_defrag_ipv4, ...) the
reassembled skb therefore still claims to be GSO (SKB_GSO_DODGY), and
the next software segmentation point - udp_rcv_segment() on local
delivery, validate_xmit_skb(), or the ip_finish_output_gso() slow
path - hands it to skb_segment(). skb_segment()'s frag_list walk
assumes GRO-shaped input and hits one of its BUG_ON()s. Two writes to
a tap by an unprivileged user in its own userns are enough:

  kernel BUG at net/core/skbuff.c:4899!
  Oops: invalid opcode: 0000 [#1] SMP KASAN NOPTI
  CPU: 0 UID: 1000 PID: 82 Comm: poc Not tainted 7.2.0-pentest+ #2
  RIP: 0010:skb_segment+0x20ca/0x48b0
  Call Trace:
   <TASK>
   __udp_gso_segment+0x29a/0x27d0
   udp4_ufo_fragment+0x458/0x6c0
   inet_gso_segment+0x429/0x1340
   skb_mac_gso_segment+0x233/0x4f0
   __skb_gso_segment+0x308/0x660
   udp_queue_rcv_skb+0x440/0xad0
   udp_unicast_rcv_skb+0xc7/0x2c0
   udp_rcv+0x16ce/0x2260
   ip_protocol_deliver_rcu+0x197/0x2d0
   ip_local_deliver+0x430/0x690
   ip_rcv+0x16f/0x1f0
   __netif_receive_skb_one_core+0x15e/0x1c0
   __netif_receive_skb+0x1e/0x110
   netif_receive_skb+0xf6/0x5c0
   tun_rx_batched.isra.0+0x3ab/0x790
   tun_get_user+0x17c3/0x3550
   tun_chr_write_iter+0xba/0x1b0
   vfs_write+0x646/0x1130
   </TASK>
  Kernel panic - not syncing: Fatal exception in interrupt

This runs with BH disabled, so it is a panic rather than an oops. The
same is reachable with CAP_NET_RAW in a netns where a defrag point
precedes a GSO point, and from a guest whose VMM forwards
virtio_net_hdr to a tap. The SKB_GSO_DODGY frag_list checks added by
commit 3dcbdb134f ("net: gso: Fix skb_segment splat when splitting
gso_size mangled skb having linear-headed frag_list") and by
commit 9e4b7a99a0 ("net: gso: fix panic on frag_list with mixed head
alloc types") do not cover it: page-backed heads skip them, and kmalloc
heads skip them when gso_size == skb_headlen(head), which the sender
controls.

An skb entering a frag queue is an IP fragment by definition and
cannot legitimately carry GSO state: GRO does not merge fragments and
the stack segments before it fragments, so only untrusted sources are
affected. This has been reachable since
commit f43798c276 ("tun: Allow GSO using virtio_net_hdr"), the first
path that let userspace attach GSO metadata to an IP fragment. Reset
the GSO fields of every fragment as it is queued, in
inet_frag_queue_insert(), which IPv4, IPv6, nf_conntrack_reasm and
6lowpan reassembly share; then neither the head nor the frag_list
members of the reassembled skb carry them (the members matter too:
the ip_do_fragment()/ip6_fragment() fast paths send them out as they
are). The head may remain CHECKSUM_PARTIAL; that is already accepted
on receive and resolved by skb_checksum_help() in
ip_do_fragment()/ip6_fragment() on forward.

Tested on top of net.git (dc4b95b8fe), x86_64: the tap reproducer
above, two further IPv4 frag_list geometries that reach
BUG_ON(i >= nfrags) and BUG_ON(!list_skb->head_frag), and an IPv6
fragment-header variant (udp6_ufo_fragment()) each panic the unpatched
kernel; with this patch all four datagrams are delivered intact and
nothing is logged.

Fixes: f43798c276 ("tun: Allow GSO using virtio_net_hdr")
Cc: stable@kernel.org
Suggested-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: Xinyang Ge <xinyang@anthropic.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Link: https://patch.msgid.link/937926e509f2acd8e0e66520dc2b30fd6b4d1687.1787839506.git.pabeni@redhat.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-08-27 12:52:10 -07:00
Jamal Hadi Salim
729c4896ab net/sched: sch_htb: limit htb_classify inner-class filter hops
htb_classify() follows each filter-selected inner class by switching
to cl->filter_list, but never bounds the number of hops. A filter on
an inner class can point back to itself or to another inner class that
points back, creating an infinite loop in the packet classification
path with the qdisc lock held and BH disabled — a soft lockup / panic
from a single packet.

Bound the traversal with a hop counter and drop the packet with a
rate-limited warning once the bound is exceeded. The counter is
incremented at the point the inner filter chain is picked up, after the
TC_ACT_* switch has consumed the classifier verdict, so a terminal
TC_ACT_QUEUED/STOLEN/TRAP on the last permitted chain still sets *qerr
to __NET_XMIT_STOLEN and the packet is not charged as a drop by this
qdisc or its parent.

The bound is TC_HTB_MAXDEPTH, taken from HTB's own parameters rather than
from the qdisc hierarchy depth limit. Class levels run from 0 to
TC_HTB_MAXDEPTH - 1, so a traversal that strictly descends in level can
take at most TC_HTB_MAXDEPTH hops. That descent is what a sane
configuration does, but it is assumed here rather than enforced:
htb_find() resolves a classid against every class in the qdisc, so a
filter may equally select a sibling or an ancestor. The normal
root -> inner -> leaf path takes a single hop, so the bound does not
affect legitimate classification.

htb_classify() can now return NULL irrespective of CONFIG_NET_CLS_ACT,
whereas previously every NULL return sat inside that ifdef. The NULL
handler in htb_enqueue() therefore cannot stay conditional either, so
drop the ifdef around it. This matches hfsc_enqueue(), which has always
handled a NULL class unconditionally. Without it, a kernel built
without actions would dereference a NULL class instead of dropping.

Conditions to recreate the bug:
- CONFIG_NET_SCHED, CONFIG_NET_SCH_HTB, CONFIG_NET_CLS_U32,
  CONFIG_LOCKUP_DETECTOR.
- Create an HTB qdisc on a device (e.g. lo), add an inner class
  1:1 with a leaf child 1:10, install a root u32 filter selecting
  1:1, and an inner-class u32 filter on 1:1 also selecting 1:1.
- Send one packet (ping). On the unfixed kernel the classify loop
  spins with the qdisc lock held; with softlockup_panic=1 it panics.
- Reachable from unprivileged user via unshare -Urn (CAP_NET_ADMIN).

Fixes: 1da177e4c3 ("Linux-2.6.12-rc2")
Reported-by: Vega <vega@nebusec.ai>
Co-developed-by: Victor Nogueira <victor@mojatatu.com>
Signed-off-by: Victor Nogueira <victor@mojatatu.com>
Signed-off-by: Jamal Hadi Salim <jhs@mojatatu.com>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Link: https://patch.msgid.link/20260826143339.271935-1-victor@mojatatu.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-08-27 12:47:58 -07:00
Jiayuan Chen
6a7e91f890 selftests/net: packetdrill: add tcp_urg_ptr_retransmit
Drive a connection into urgent mode and force a multi-segment retransmit,
checking that each retransmitted segment keeps its own urg_ptr.

The test asserts the fixed behaviour: the hole is retransmitted as two
independent skbs, each with its own urg_ptr (5001 and 4001) and no PSH.
An unpatched kernel instead sends one super-skb whose GSO split copies
urg_ptr onto the second segment and also sets PSH there, so on an unpatched
kernel the mismatch shows up on the PSH bit (actual P.U ... urg 5001) before
the urg_ptr:

	tcp_urg_ptr_retransmit.pkt:63: live packet field tcp_psh:
		expected: 0 (0x0) vs actual: 1 (0x1)
	script packet:  .U 1001:2001(1000) ack 1
	actual packet:  P.U 1001:2001(1000) ack 1 win 1050

After the fix the retransmit carries a per-segment urg_ptr and the test
passes.

Signed-off-by: Jiayuan Chen <jiayuan.chen@linux.dev>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Link: https://patch.msgid.link/20260826141145.67823-2-jiayuan.chen@linux.dev
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-08-27 12:47:34 -07:00
Jiayuan Chen
ce2b807f42 tcp: fix corruption of urgent data on multi-segment retransmit
On the normal xmit path, while in urgent mode we refuse to build a
multi-segment TSO packet, so every segment gets its own urg_ptr:

	/* tcp_write_xmit() */
	limit = mss_now;
	if (tso_segs > 1 && !tcp_urg_mode(tp))
		limit = tcp_mss_split_point(...);

The retransmit path has no such guard. __tcp_retransmit_skb() builds a
segs > 1 skb and hands it to the GSO layer, which only advances th->seq
per segment and copies urg_ptr verbatim:

	/* __tcp_retransmit_skb() */
	len = cur_mss * segs;		/* segs > 1, no urg_mode check */
	...
	/* tcp_gso_segment(): bumps seq only, urg_ptr is copied */

urg_ptr is an offset from the segment's own seq, so a copied value points
at a different place on each segment. The receiver rebuilds the absolute
urgent seq as seg.seq + urg_ptr, so it walks a moving urgent point instead
of the one OOB byte:

	seg1  seq 1     urg_ptr 5001 -> urgent @ 5001   (ok)
	seg2  seq 1001  urg_ptr 5001 -> urgent @ 6001   (wrong, +MSS)
	seg3  seq 2001  urg_ptr 5001 -> urgent @ 7001   (wrong, +2*MSS)

The real OOB byte is never pointed at, so the receiver stops splicing it
out and delivers it as normal in-band data, corrupting the stream.

Guard the retransmit length like the xmit path: keep segs = 1 while in
urgent mode.

Fixes: 10d3be5692 ("tcp-tso: do not split TSO packets at retransmit time")
Signed-off-by: Jiayuan Chen <jiayuan.chen@linux.dev>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Link: https://patch.msgid.link/20260826141145.67823-1-jiayuan.chen@linux.dev
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-08-27 12:47:34 -07:00
Deepanshu Kartikey
a60fd8c6db usb: atm: usbatm: fix invalid ci_range initialization
syzbot reported a shift-out-of-bounds in __vcc_connect():

  UBSAN: shift-out-of-bounds in net/atm/common.c:382:32
  shift exponent -1 is negative
  CPU: 0 UID: 0 PID: 5987 Comm: syz.0.18 Not tainted syzkaller #0 PREEMPT(full)
  Hardware name: Google Compute Engine/Google Compute Engine, BIOS Google 08/05/2026
  Call Trace:
   <TASK>
   dump_stack_lvl+0xe8/0x150 lib/dump_stack.c:120
   ubsan_epilogue+0xa/0x30 lib/ubsan.c:233
   __ubsan_handle_shift_out_of_bounds+0x36d/0x400 lib/ubsan.c:494
   __vcc_connect+0x14b4/0x19c0 net/atm/common.c:382
   vcc_connect+0x328/0x8f0 net/atm/common.c:498
   pvc_bind+0x272/0x380 net/atm/pvc.c:52
   __sys_bind+0x2e3/0x410 net/socket.c:1976
   __x64_sys_bind+0x7a/0x90 net/socket.c:1979
   ...

ATM device ci_range fields (vpi_bits and vci_bits) represent the
number of bits supported for VPI and VCI addressing on the device.
net/atm/common.c directly uses these fields as bit shift counts:
  vpi >> dev->ci_range.vpi_bits
  vci >> dev->ci_range.vci_bits
  1 << vcc->dev->ci_range.vpi_bits
  1 << vcc->dev->ci_range.vci_bits

usbatm_atm_init() sets ci_range.vpi_bits and ci_range.vci_bits to
ATM_CI_MAX (-1), which is defined in <uapi/linux/atmdev.h> as a
sentinel value for userspace ATM_SETCIRANGE requests, not a valid bit
count. Shifting by -1 is undefined behavior and triggers UBSAN
warnings.

ATM UNI cell headers allow up to 8 bits for VPI (0..255) and 16 bits
for VCI (0..65535). Initialize vpi_bits to 8 and vci_bits to 16, as
done by solos-pci.

Fixes: c59bba75fa ("[PATCH] USB ATM: new usbatm core")
Reported-by: syzbot+6665d3db5fef15914802@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=6665d3db5fef15914802
Suggested-by: Eric Dumazet <edumazet@google.com>
Link: https://lore.kernel.org/all/20260824024620.23485-1-kartikey406@gmail.com/T/ [v1]
Signed-off-by: Deepanshu Kartikey <kartikey406@gmail.com>
Link: https://patch.msgid.link/20260826133258.8306-1-kartikey406@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-08-27 12:46:16 -07:00
bui duc phuc
dd890ae292 net: fec: only stop PTP if it was initialized
fec_ptp_init() is only called when fep->bufdesc_ex is available.
However, fec_probe() unconditionally calls fec_ptp_stop() on the
failed_init path, and fec_drv_remove() unconditionally calls
fec_ptp_stop() during device removal.

Check fep->bufdesc_ex before calling fec_ptp_stop() in both paths
to avoid stopping PTP when it was not initialized.

Fixes: 32cba57ba7 ("net: fec: introduce fec_ptp_stop and use in probe fail path")
Reviewed-by: Wei Fang <wei.fang@nxp.com>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
Link: https://patch.msgid.link/20260826103428.32807-1-phucduc.bui@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-08-27 12:41:14 -07:00
Eric Dumazet
23c53269f2 slip: remove slip_hangup() to fix use-after-free in slip_receive_buf()
Jaeyoung Chung and Eulgyu Kim reported a slab-use-after-free read
in slip_receive_buf() when racing against tty hangup.

tty_ldisc_hangup() calls ld->ops->hangup() while holding only
a read lock on tty->ldisc_sem (via tty_ldisc_ref()).
Because slip_hangup() simply called slip_close(), it ran concurrently
with reader functions such as slip_receive_buf().

slip_close() unregisters and frees the net device and its private
struct slip, causing concurrent reader threads in slip_receive_buf()
to dereference freed memory.

Line discipline close() is already guaranteed to be called under
the write lock of tty->ldisc_sem during hangup processing
(in tty_ldisc_reinit() or tty_ldisc_kill()).

Remove slip_hangup() so teardown is serialized cleanly by slip_close().

Fixes: 5342b77c41 ("slip: Clean up create and destroy")
Reported-by: Jaeyoung Chung <jjy600901@snu.ac.kr>
Reported-by: Eulgyu Kim <eulgyukim@snu.ac.kr>
Closes: https://lore.kernel.org/netdev/20260825150655.1450271-1-jjy600901@snu.ac.kr/
Cc: Qingfang Deng <qingfang.deng@linux.dev>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Link: https://patch.msgid.link/20260826105238.3323436-1-edumazet@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-08-27 12:38:27 -07:00
Linus Torvalds
9bb34313d9 spi: Fixes for v7.3
A couple of fixes that came in during the merge window, Geert fixed an
 uninitialised data bug in the amlogic-spisg driver which could crash and
 in the Loongson driver Li Jun hooked up the existing suspend operations
 more fully to fix hibernation.
 -----BEGIN PGP SIGNATURE-----
 
 iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmqQOiIACgkQJNaLcl1U
 h9Ctqgf/Z4nnPtUfZlh7ecod1NscPzlH/49BCTEK1+P17tP7c76FIKEM2ZBoJU7j
 MTJ6YkUzXkAp5uEyodLPqQiC6lr6XKTNGwO3Al4Mz4toLMbHdnKrb5xZHClmkyFh
 LjHcvHijZL17Gt72fa4He6UtGx0y0mZBEnbiOkQA3Z4eMgHrL3Knw8i8xmz7sqoU
 K5vbgkHFgv5o75WhCQRzNakDMlssq8e8Xy2U+sxLsepJoTVbFg4RT6l0S+7iHPrk
 05F/50dPbT/bd/jkFSji5ynpoLPEtBOle/vBLwbxwWzk0AOIxx2xhFVwXK6QEAMk
 7zmTsceKe0wWcQW+rRKi+d6SMFPxMQ==
 =IW97
 -----END PGP SIGNATURE-----

Merge tag 'spi-fix-v7.3-merge-window' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi

Pull spi fixes from Mark Brown:
 "A couple of fixes that came in during the merge window: Geert fixed an
  uninitialised data bug in the amlogic-spisg driver which could crash
  and in the Loongson driver Li Jun hooked up the existing suspend
  operations more fully to fix hibernation"

* tag 'spi-fix-v7.3-merge-window' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi:
  spi: loongson: pm: add .freeze .poweroff .thaw .restore
  spi: amlogic-spisg: Make sure clk_init_data is fully initialized
2026-08-27 12:38:05 -07:00
Norbert Szetei
50e5c6605c net: bridge: mcast: fix use-after-free of a master VLAN's multicast context
br_multicast_toggle_one_vlan() clears BR_VLFLAG_MCAST_ENABLED under
br->multicast_lock before stopping a VLAN's multicast context.  That is
the teardown handshake: lockless readers gate on the flag through
br_multicast_ctx_should_use() -> br_multicast_ctx_vlan_disabled(), so
once it is cleared under the lock no reader can arm the context again.

For a master VLAN the handshake never runs.  __vlan_del() clears
BRIDGE_VLAN_INFO_BRENTRY before calling br_vlan_put_master(), so
br_multicast_toggle_one_vlan(masterv, false) returns early on
!br_vlan_is_brentry(vlan): the flag stays set and br->multicast_lock is
never taken.  br_vlan_put_master() then drains the context in
br_multicast_ctx_deinit() and frees the VLAN through call_rcu(), while a
reader still inside rcu_read_lock() sees the context as enabled and
re-arms it.  The port and port-VLAN branch of the function has no
br_vlan_is_brentry() test and flips the flag under br->multicast_lock,
so it is not affected.

The reader is the bridge transmit path.  For a master VLAN
br_multicast_rcv() selects brmctx = &vlan->br_mcast_ctx with
pmctx = NULL, so IGMP sent to the bridge device re-arms the context's
timers after br_multicast_ctx_deinit() has already stopped them.

  BUG: KASAN: slab-use-after-free in detach_if_pending+0x412/0x4a0
  Write of size 8 at addr ffff88810ac39918 by task brmc/601
   __mod_timer+0x51a/0xc50
   br_multicast_host_join+0x25b/0x390
   __br_multicast_add_group+0x468/0x530
   br_ip4_multicast_add_group+0x1a0/0x260
   br_multicast_rcv+0x2cda/0x61e0
   br_dev_xmit+0x6c4/0x1540
  Allocated by task 610:
   br_vlan_add+0x111/0xb40
   br_vlan_info+0x370/0x3e0
  Freed by task 0:
   kfree+0x1a7/0x4f0
   rcu_core+0x7dc/0x10a0

Only test br_vlan_is_brentry() when enabling, like the
br_multicast_ctx_vlan_global_disabled() test next to it.  Disabling then
always clears BR_VLFLAG_MCAST_ENABLED under br->multicast_lock before
br_multicast_ctx_deinit() drains the context.

Fixes: 7b54aaaf53 ("net: bridge: multicast: add vlan state initialization and control")
Cc: stable@vger.kernel.org
Signed-off-by: Norbert Szetei <norbert@doyensec.com>
Acked-by: Nikolay Aleksandrov <razor@blackwall.org>
Link: https://patch.msgid.link/D400F6C7-543A-4B79-9E5B-D1D8974DE5C9@doyensec.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-08-27 12:35:03 -07:00
Linus Torvalds
6253a29206 regulator: Fix for v7.3
One fix here, for a race condition on startup in the tps65185 driver
 which is seen on actual boards - we need a delay after waking the chip
 before it is ready to talk to the host.
 -----BEGIN PGP SIGNATURE-----
 
 iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmqQOSwACgkQJNaLcl1U
 h9CrAAf9H7s1Nw5yB4SDI2TghqmY14G0Sr3EL4ajk0TnUEK6jGfsBVrjDeMMCCoI
 i/KIq2hSzCmguRJIeJbkAd1iOX3oLuQFZZelalDuMxe0jv96Nr4XjJegabqPpB2O
 iZzpR3mep3oST4SOj5BfjpifvgNdr1WkC1c/cR49+vd735UXUmw4YxNFA8iow5zL
 if77jZDvUOk9bOeGP4JXtV9WbGSjLeD5eTQopT0E7oiy5Fym+fc1alVht1nj0ylI
 YK/3DbVINxz3NoXV0VOYNIv92jAH8I7Pitw154D62tQLqvnD0Nzn8lMKj9lbTsz1
 TKHkh6nDyn96Oq3uauFb5JjTMHx1oQ==
 =k/VH
 -----END PGP SIGNATURE-----

Merge tag 'regulator-fix-v7.3-merge-window' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator

Pull regulator fix from Mark Brown:
 "One fix here, for a race condition on startup in the tps65185 driver
  which is seen on actual boards - we need a delay after waking the chip
  before it is ready to talk to the host"

* tag 'regulator-fix-v7.3-merge-window' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator:
  regulator: tps65185: wait for the IC to wake before the first I2C access
2026-08-27 12:21:56 -07:00
Linus Torvalds
7cec13314d dma-mapping fix for Linux 7.3
- integer overflow fix for kernel cmdline parser for DMA contiguous
 initialization code (Alexander Graf)
 -----BEGIN PGP SIGNATURE-----
 
 iHUEABYKAB0WIQSrngzkoBtlA8uaaJ+Jp1EFxbsSRAUCapAQqwAKCRCJp1EFxbsS
 RCScAQDLf7mcAq6YoJQ2YnUetzda+eGO9vvFPuNlmj5RdSfcgwD+L/+rSV17P7Sc
 d11981LdKsEnKWJMrZhRbWzI/Q+bnw0=
 =Owsi
 -----END PGP SIGNATURE-----

Merge tag 'dma-mapping-7.3-2026-08-27' of git://git.kernel.org/pub/scm/linux/kernel/git/mszyprowski/linux

Pull dma-mapping fix from Marek Szyprowski:

 - integer overflow fix for kernel cmdline parser for DMA contiguous
   initialization code (Alexander Graf)

* tag 'dma-mapping-7.3-2026-08-27' of git://git.kernel.org/pub/scm/linux/kernel/git/mszyprowski/linux:
  dma-contiguous: fix truncation of numa_cma / cma_pernuma sizes >= 2G
2026-08-27 12:14:19 -07:00
Jamal Hadi Salim
8f735d6438 net/sched: bound qdisc_pkt_len to prevent qdisc soft lockup
qdisc_get_stab() accepts a user-supplied size table, and
__qdisc_calculate_pkt_len() amplifies qdisc_pkt_len() through the
overhead, the size-table data (u16), and size_log (up to
STAB_SIZE_LOG_MAX). A crafted stab can therefore set qdisc_pkt_len()
to ~1 GiB for an ordinary skb. Per-flow deficit schedulers such as
DRR and ETS replenish one quantum per loop iteration; with a tiny
quantum (1) they spin billions of times under the qdisc lock,
producing a soft lockup / RCU stall as illustrated by vega@nebusec.ai.

Cap the final qdisc_pkt_len() to QDISC_PKT_LEN_MAX so the size-table
amplification cannot drive deficit schedulers into an unbounded loop.
A legitimate size table (e.g. qfq's overhead 999999999, which is
handled by dropping) is still accepted.

Introduce cap QDISC_PKT_LEN_MAX (1 << 20) = 1 MiB which is well above
any legitimate single-skb wire length: the largest current skb->len
is GSO_MAX_SIZE (524280), and an ATM-style size table (53/48 cell tax)
amplifies that to ~578 KB, both comfortably below 1 MiB. At the same
time, 1 MiB bounds the deficit refill loop to ~1M iterations per
packet with quantum=1, which completes in a few milliseconds well
under the demonstrated softlockup threshold (~10^9 iterations).

Conditions to recreate the bug:
- CONFIG_NET_SCHED=y, CONFIG_NET_SCH_DRR=y (or CONFIG_NET_SCH_ETS=y).
- Attach a DRR (or ETS) root qdisc with a crafted TCA_STAB that
  amplifies qdisc_pkt_len to ~1 GiB (e.g. size_log=15, data=[32768]).
- Add a class with a tiny quantum of 1 and send one small packet; the
  deficit loop spins billions of times under the qdisc lock and trips
  the softlockup detector (panic with kernel.softlockup_panic=1).
- Reachable as root or from an unprivileged user in a fresh user+net
  namespace (unshare -Urn) with namespace-local CAP_NET_ADMIN.

Fixes: 1da177e4c3 ("Linux-2.6.12-rc2")
Reported-by: vega@nebusec.ai
Tested-by: Victor Nogueira <victor@mojatatu.com>
Signed-off-by: Jamal Hadi Salim <jhs@mojatatu.com>
Link: https://patch.msgid.link/20260825081403.133992-1-jhs@mojatatu.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-08-27 12:12:36 -07:00
Edoardo Pinci
88c71cc0ad net: dsa: mxl862xx: enable assisted learning on CPU port
The MxL862xx driver enables FDB isolation but does not enable assisted
learning on the CPU port. Consequently, MAC addresses learned through a
physical switch port are not updated in hardware when the corresponding
station moves to a foreign bridge port, such as a Wi-Fi interface.

The stale hardware FDB entry continues directing return traffic toward
the original physical port. Traffic entering that same port is then
filtered instead of being forwarded to the CPU and software bridge. This
causes downstream unicast traffic, including DHCP OFFER and ACK packets,
to disappear after a client roams to a local wireless interface. The
client eventually considers the connection unusable and disconnects.

Enable assisted CPU-port learning so DSA installs foreign bridge FDB
entries on the CPU port. This keeps the hardware FDB synchronized with
the software bridge and allows return traffic to reach locally attached
Wi-Fi clients after roaming.

Tested on a BPI R4 PRO with a MxL862xx switch and a BE14000 WiFi interface.
- Without patch, wired uplink on lan6 port (mxl path)
  Wifi clients connect but roam away not getting DHCP offers
- Without patch, wired uplink on wan port (no mxl path)
  Wifi clients connect and roam successfully
- With this patch, uplink on lan6 (mxl path)
  Wifi clients connect and roam successfully

Fixes: 340bdf9846 ("net: dsa: mxl862xx: implement bridge offloading")
Signed-off-by: Edoardo Pinci <epinci@outlook.com>
Link: https://patch.msgid.link/DU0P251MB069949C6DEB4D1D51F31FE87C4A02@DU0P251MB0699.EURP251.PROD.OUTLOOK.COM
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-08-27 11:41:25 -07:00
Pascal Kneuper
23680bf5f8 net: stmmac: restore NET_IP_ALIGN in the RX DMA offset
Since the RX path was converted to zero-copy, the page pool page is handed
to the stack directly as the skb head, and the offset the DMA engine writes
at is what determines the alignment of the packet headers.

Before the conversion the payload was copied into an skb obtained from
napi_alloc_skb(), which reserves NET_SKB_PAD + NET_IP_ALIGN. The
conversion moved the headroom into stmmac_rx_offset() but did not carry
over NET_IP_ALIGN, so on architectures where NET_IP_ALIGN is 2 the IP
header now lands misaligned:

  64 (NET_SKB_PAD) + 14 (ethernet) + 20 (IP) = 98

Same for the XDP branch:

  256 (XDP_PACKET_HEADROOM) + 14 (ethernet) + 20 (IP) = 290

On ARM32 this is fatal, because ldm and ldrd trap on unaligned addresses
even when CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS is set.

Any received echo request panics the machine, e.g:

  Unhandled fault: alignment exception (0x001) at 0x81873062
  Internal error: : 1 [#1] SMP ARM
  Hardware name: Altera SOCFPGA Arria10
  PC is at icmp_echo+0x38/0xa8
  LR is at icmp_rcv+0x22c/0x370
  Call trace:
   icmp_echo from icmp_rcv+0x22c/0x370
   icmp_rcv from ip_protocol_deliver_rcu+0x2c/0x224
   ip_protocol_deliver_rcu from ip_local_deliver+0xc8/0x1a0
   ip_local_deliver from ip_sublist_rcv_finish+0x3c/0x50
   ip_sublist_rcv_finish from ip_list_rcv_finish+0x110/0x118
   ip_list_rcv_finish from ip_list_rcv+0xc8/0xdc
   ip_list_rcv from __netif_receive_skb_list_core+0x170/0x1c0
   ...
   napi_complete_done from stmmac_napi_poll_rx+0xcb0/0x1030
  Code: e24dd068 e59020a0 e28dc010 e0822001 (e8920003)
  Kernel panic - not syncing: Fatal exception in interrupt

The faulting instruction is the ldm of *icmp_hdr(skb) in icmp_echo().

Fix by adding NET_IP_ALIGN back to the RX offset, which restores the
alignment the stack used to get.

Note that commit a955318fe6 ("stmmac: align RX buffers") made a similar
change in 2021 and was reverted by commit 12d125b457 ("stmmac: Revert
"stmmac: align RX buffers"") because it caused packet corruption. That
patch raised the offset from 0 without adjusting the buffer size
accounting, so the DMA engine could arguably write past the end of the RX
buffers, though this was never root caused.
Commit df542f6693 ("net: stmmac: Switch to zero-copy in non-XDP RX
path") since derives the page pool allocation from stmmac_rx_offset(), so
the extra bytes are accounted for.

Fixes: df542f6693 ("net: stmmac: Switch to zero-copy in non-XDP RX path")
Cc: Daniel Baldin <DBaldin@dspace.de>
Signed-off-by: Pascal Kneuper <PKneuper@dspace.de>
Link: https://patch.msgid.link/20260824125014.47862-1-PKneuper@dspace.de
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-08-27 11:40:24 -07:00
Linus Torvalds
f7e3f4d9f4 Backlight for v7.3
- New Support & Features
   - Silergy SY7758: Add driver for the 6-channel high-efficiency LED driver
 
 - Improvements & Fixes
   - Awinic AW99706: Fix device tree property names to match the binding, consistently
     validate all property values, and honor the core blank state in `update_status()`
   - Kinetic KTD2801: Add missing dependency on `GPIOLIB` in Kconfig
   - Qualcomm WLED: Remove redundant `dev_err()` calls
 
 - Cleanups & Refactoring
   - Core: Use `sysfs_emit()` instead of `sprintf()` in sysfs show callbacks
   - Maintainers: Update Junjie Cao's email address for the Awinic AW99706 driver
 
 - Device Tree Binding Updates
   - Marvell 88PM860X: Add missing bracket in the example
   - Silergy SY7758: Document the 6-channel high-efficiency LED driver
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEdrbJNaO+IJqU8IdIUa+KL4f8d2EFAmqPE2oACgkQUa+KL4f8
 d2FmPA//dBm/TLnut7WnXl7gksJzn0HfvrMvEVAFBn1pfNOZapoXkspGkCQJpSrs
 5Y2jg+DlYehBK9SgRB/1T+nRimti5JgBRrUGB28AzXQk4WmkPcLrFREuXDweTZJZ
 HuAxMyEIBVFAfgQhvc7RiyWJtP6E4t0hqc98PQUzSG+duGLsUbb/cvhPlCTJTAxO
 WET9WOxwW9IhdA110N4rnDfio5sTD4hH4iE4hlXuQsBJFTpZzf+fsDWA8IPONmUR
 K4/9LK58QSES0SWnle9maZ4ibwePYaaPH5PQWtCIilhlddqpYAh/Xtl4N4mOFEiK
 FKdbZN/NBWeVbhj/Hpjxutyjvk5dF7mz2/DwuO2xKLpWppg1eGzfG5b4hW+fUPW2
 txmQcRN6Kazlskg0BCeIC6TOvEQeRmrR2OICh758ptRC/rfTG2pvV8rt7PzVplEp
 WPNbu/iRl+hzwrTssREwIeOQ1mLPRGhuXUnlB9nNX/AhcMVCoBgkdwA8Tf6ZPPIN
 dKTDshrJ4jjVuenBcjTA6WnLCcqywAtYpZfH8YSZafgDgK8BjtW6dapGFvP4XOLz
 Bnic9yJZpKelcuwOm2uj9cgbwenoAcrj9yr00iqgXrBPMEhVvkg9xbJUh+8D6yF0
 Vz/AjzlYcwEwpMbfHewyA2B50zu+BfjDiM6mTu0C8n50BYEx71s=
 =8Tc7
 -----END PGP SIGNATURE-----

Merge tag 'backlight-next-7.3' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/backlight

Pull backlight updates from Lee Jones:
 "New Support & Features:
   - Silergy SY7758: Add driver for the 6-channel high-efficiency LED
     driver

  Improvements & Fixes
   - Awinic AW99706: Fix device tree property names to match the
     binding, consistently validate all property values, and honor the
     core blank state in `update_status()`
   - Kinetic KTD2801: Add missing dependency on `GPIOLIB` in Kconfig
   - Qualcomm WLED: Remove redundant `dev_err()` calls

  Cleanups & Refactoring
   - Core: Use `sysfs_emit()` instead of `sprintf()` in sysfs show
     callbacks
   - Maintainers: Update Junjie Cao's email address for the Awinic
     AW99706 driver

  Device Tree Binding Updates
   - Marvell 88PM860X: Add missing bracket in the example
   - Silergy SY7758: Document the 6-channel high-efficiency LED driver"

* tag 'backlight-next-7.3' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/backlight:
  backlight: Use sysfs_emit() instead of sprintf()
  backlight: qcom-wled: Remove redundant dev_err()
  backlight: ktd2801: Fix unmet dependency on GPIOLIB
  backlight: aw99706: Honor the core blank state in update_status()
  backlight: aw99706: Validate all DT property values consistently
  backlight: aw99706: Fix DT property names to match binding
  dt-bindings: backlight: 88pm860x: Add missing bracket
  MAINTAINERS: Update my email address for the AW99706 backlight driver
  backlight: Add SY7758 6-channel High Efficiency LED Driver support
  dt-bindings: leds: backlight: Document the SY7758 6-channel High Efficiency LED Driver
2026-08-27 11:16:39 -07:00
Linus Torvalds
7cc2726d48 LEDs for v7.3
- New Support & Features
   - Core: Extend netdev trigger speeds up to 100G.
   - PWM Multicolor: Introduce default-intensity property.
   - Analog Devices LTC3220: Add support for 18 channel LED driver.
   - NXP PCA963x: Add multicolor LED class support.
 
 - Improvements & Fixes
   - GPIO: Clear error pointers for skipped LEDs.
   - Broadcom BCM63138: Use %pe to print pinctrl error instead of %ld.
   - ISSI IS31FL319x: Modernize device registration by using fwnode APIs.
   - NXP PCA9532: Fix inverted GPIO output polarity.
   - NXP PCA9532: Fix phantom device registration on missing hardware.
   - STMicroelectronics ST1202: Correct and extend hw_pattern documentation.
   - STMicroelectronics ST1202: Fix channel disable logic on zero brightness and ensure
     brightness changes are applied in active mode.
   - STMicroelectronics ST1202: Fix hardware pattern sequence programming, validate inputs,
     and correct pattern duration calculations.
   - STMicroelectronics ST1202: Validate LED reg property against channel count.
   - TI LP5860: Fix a potential double-unlock during device initialization and fix error
     handling path by using devm_mutex_init().
 
 - Cleanups & Refactoring
   - GPIO: Make legacy gpiolib interface optional.
 
 - Device Tree Binding Updates
   - Core: Add default-intensity property.
   - Core: Document "gpio" trigger.
   - Analog Devices LTC3220: Add DT binding for LTC3220 18 channel LED Driver.
   - Broadcom BCM6358: Convert to DT schema.
   - LaCie NS2: Convert to DT schema.
   - NXP PCA963x: Add multicolor LED support.
   - NXP PCA963x: Fix reg maximum for pca9635.
   - TI TPS65217: Convert backlight bindings to DT schema.
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEdrbJNaO+IJqU8IdIUa+KL4f8d2EFAmqPE1kACgkQUa+KL4f8
 d2G/sA/+JvJYo1XzwrV4+exEg62y083pNJgT+sfjXDkfq2wJ0Vqapms5DB1/8WW6
 KjWMO3om6IUW2Ao9Z8MU7R01fyssfylm0nlVZnrqJz/taLTyaV0/c31E2+QdZsBF
 0hWp+SfhMHOJHxLHRQl2uGDerx/je/b0WrxlZGmgRuNcIBm/RGp/MJR0yf6F3pNc
 LWExdXOD9ugG03BB2JzlEuIuHSgWwIxgNtm5v9Fv4gRTZRA9VWccDuMRHgH21Bwk
 pOP3gDBtxZmDUFWW+FE2ODdTZPXNwJ6u2dMpynuQs/IcM5TSBqsAmPlbF41cmLMC
 N3iMkf5BDBgkDCatjwzYadBCo8siHuNLvSLUghH0maX37cPQ1PoN28T8wD9nHVEJ
 SreF29nwXbzg31N2cD8e3McxqzY0VfYiDRK1ztjqXuN8RXweTIF4MUiFgHlcb+va
 LWONWbvLPZW+gu3knDAzSoMtBFPcH1obU99wxyYSpDHmjU7XIvKNzxBjNEYBupe3
 8+RizuDAoFIZaTz7omBccmF/NMLHqsr0l8oyL67V29FYp4nyZemyRmLE6N0vE0Zn
 vWBECaS8kwQwPKUxgreNObaviooreytgeC9H4KOcsLfEcHqKMYTDAOk5Y7SAVUtp
 6KC7CE/6nZK9bAsL97Qzww15mkEqT34ne7wYEg5RiPPo15VBToM=
 =Tm6g
 -----END PGP SIGNATURE-----

Merge tag 'leds-next-7.3' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/leds

Pull LED updates from Lee Jones:
 "New Support & Features:
   - Core: Extend netdev trigger speeds up to 100G
   - PWM Multicolor: Introduce default-intensity property
   - Analog Devices LTC3220: Add support for 18 channel LED driver
   - NXP PCA963x: Add multicolor LED class support

  Improvements & Fixes:
   - GPIO: Clear error pointers for skipped LEDs
   - Broadcom BCM63138: Use %pe to print pinctrl error instead of %ld
   - ISSI IS31FL319x: Modernize device registration by using fwnode APIs
   - NXP PCA9532: Fix inverted GPIO output polarity
   - NXP PCA9532: Fix phantom device registration on missing hardware
   - STMicroelectronics ST1202: Correct and extend hw_pattern
     documentation
   - STMicroelectronics ST1202: Fix channel disable logic on zero
     brightness and ensure brightness changes are applied in active mode
   - STMicroelectronics ST1202: Fix hardware pattern sequence
     programming, validate inputs, and correct pattern duration
     calculations
   - STMicroelectronics ST1202: Validate LED reg property against
     channel count
   - TI LP5860: Fix a potential double-unlock during device
     initialization and fix error handling path by using
     devm_mutex_init()

  Cleanups & Refactoring:
   - GPIO: Make legacy gpiolib interface optional

  Device Tree Binding Updates:
   - Core: Add default-intensity property
   - Core: Document "gpio" trigger
   - Analog Devices LTC3220: Add DT binding for LTC3220 18 channel LED
     driver
   - Broadcom BCM6358: Convert to DT schema
   - LaCie NS2: Convert to DT schema
   - NXP PCA963x: Add multicolor LED support
   - NXP PCA963x: Fix reg maximum for pca9635
   - TI TPS65217: Convert backlight bindings to DT schema"

* tag 'leds-next-7.3' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/leds: (29 commits)
  leds: is31fl319x: Modernize registration
  dt-bindings: leds: lacie,ns2-leds: Convert to DT schema
  leds: pca963x: Add multicolor LED class support
  dt-bindings: leds: nxp,pca963x: Add multicolor LED support
  dt-bindings: leds: nxp,pca963x: Fix reg maximum for pca9635
  leds: gpio: Clear error pointers for skipped LEDs
  dt-bindings: leds: backlight: Convert TPS65217 to DT schema
  leds: pca9532: Fix phantom device registration on missing hardware
  leds: gpio: Make legacy gpiolib interface optional
  leds: bcm63138: Use %pe to print pinctrl error instead of %ld
  dt-bindings: leds: Add default-intensity property
  leds: ltc3220: Add Support for LTC3220 18 channel LED Driver
  dt-bindings: leds: Add LTC3220 18 channel LED Driver
  dt-bindings: leds: bcm6358: Convert to DT schema
  dt-bindings: leds: Document "gpio" trigger
  leds: st1202: Correct and extend hw_pattern documentation
  leds: st1202: Validate LED reg property against channel count
  leds: st1202: Disable channel when brightness is set to zero
  leds: st1202: Fix brightness having no effect while pattern mode is active
  leds: st1202: Fix spurious pattern sequence start in setup
  ...
2026-08-27 11:05:51 -07:00
Lorenzo Bianconi
9c24a504a3 net: stmmac: drop gso_enabled_types and rely on netdev features
The gso_enabled_types field is used by stmmac_xmit() to decide whether a
GSO skb should be passed to stmmac_tso_xmit(). It is updated in
stmmac_set_features() based solely on NETIF_F_TSO, so disabling IPv4
TSO while keeping IPv6 TSO (NETIF_F_TSO6) enabled zeroes the mask. As a
result IPv6 GSO frames, which the networking stack still generates since
NETIF_F_TSO6 is enabled, fall through to the non-TSO xmit path where
they are not handled.

The networking stack already manages the GSO logic: a GSO skb is only
delivered to the driver when the matching offload feature (NETIF_F_TSO,
NETIF_F_TSO6 or NETIF_F_GSO_UDP_L4) is enabled, otherwise the frame is
segmented in software before reaching ndo_start_xmit().
stmmac_features_check() also validates each GSO frame against the TSO
hardware constraints and falls back to software GSO when they are not met.

Drop the gso_enabled_types field and rely on skb_is_gso() in
stmmac_xmit() instead, which correctly routes IPv6 GSO frames to the TSO
path when NETIF_F_TSO is disabled. This also removes the data race
between stmmac_set_gso_types(), called from the feature-set path, and
the lockless read of gso_enabled_types in stmmac_xmit().

Fixes: 2e4082e4b7 ("net: stmmac: simplify GSO/TSO test in stmmac_xmit()")
Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@oss.qualcomm.com>
Link: https://patch.msgid.link/20260824-stmmac-fix-tso6-features-v3-1-c73a7a4a0ec7@oss.qualcomm.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-08-27 11:05:34 -07:00
Jakub Kicinski
6fe66698b9 Merge branch 'net-stmmac-more-selftest-related-fixes'
Maxime Chevallier says:

====================
net: stmmac: More selftest related fixes

This series addresses some (but not all) issues found while running the
ethtool selftest on various stmmac platforms. As a reminder, ethtool
selftest are run with 'ethtool -t ethX', and for stmmac the goal is to test
hardware features and bugs from the IP integration in the platform.

I've been running this on :

 - Altera CycloneV (dwmac-socfpga, dwmac1000 IP, v3.70a)
 - NXP imx8mp (dwmac-imx, dwmac4, v5.10a)
 - Allwinner H2S (dwmac-sun8i, dwmac1000)
 - Amlogic S905X3 (dwmac-meson8b, dwmac1000, v3.70a)
 - STM32mp157a (dwmac-stm32, dwmac4, v4.20a)
 - SiFive JH7110 (dwmac-starfive, dwmac4, v5.20)

Here's the results before this series, noting that some bugs were already
fixed, some are ongoing (cf. the IP proto patch here [1])

[1] : https://lore.kernel.org/netdev/20260825211748.360935-1-maxime.chevallier@bootlin.com/

Tests are OK if return is 0 or -95 (-EOPNOTSUPP), tests are KO otherwise

Test                     imx   socfpga   sun8i   meson8b   stm32 starfive
MAC Loopback              0      0        0        0        0       0
MMC Counters              0      0        -95      -22      0       -22
EEE                       -95    -95      -95      -95      -95     -95
Hash Filter MC            0      0        -95      0        0       0
Perfect Filter UC         0      0        0        0        0       0
MC Filter                 0      0        -95      0        0       0
UC Filter                 0      0        -95      -22      0       0
Flow Control              -110   0        -110     0        0       -110
RSS                       -95    -95      -95      -95      -95     -95
VLAN Filtering            -110   -95      -95      -95      -110    -110
VLAN Filtering (perf)     -110   -95      -95      -95      -110    -110
Double VLAN Filter        -110   -95      -95      -95      -110    -110
Double VLAN Filter (perf) -110   -95      -95      -95      -110    -110
Flexible RX Parser        0      -95      -95      -95      -95     -95
SA Insertion (desc)       0      -95      -95      -95      0       0
SA Replacement (desc)     0      -95      -95      -95      0       0
SA Insertion (reg         0      -95      -95      -95      0       0
SA Replacement (reg)      0      -95      -95      -95      0       0
VLAN TX Insertion         -110   -95      -95      -95      -110    -110
SVLAN TX Insertion        -110   -95      -95      -95      -110    -95
L3 DA Filtering           0      -95      -95      -95      -95     -95
L3 SA Filtering           0      -95      -95      -95      -95     -95
L4 DA TCP Filtering       0      -95      -95      -95      -95     -95
L4 SA TCP Filtering       0      -95      -95      -95      -95     -95
L4 DA UDP Filtering       0      -95      -95      -95      -95     -95
L4 SA UDP Filtering       0      -95      -95      -95      -95     -95
ARP Offload               -95    -95      -95      -95      -110    -110
Jumbo Frame               0      0        0        0        0       0
Multichannel Jumbo        0      -95      -95      -95      -95     -95
Split Header             -95     -95      -95      -95      -95     -95
TBS (ETF Scheduler)      -95     -95      -95      -95      -95     -95

So, only sogfpga is all OK (in all fairness, it doesn't support much)

Several issues :

 - MMC test failing on starfive and meson8b, solved by patch 1

MMC counters maintained by the MAC are optional, which one is implemented
depends on how the IP is synthesized. On starfive and meson8b, the counter
used by the selftest to validate the MMC counters feature isn't implemented.

Solved by adding other counters in the validation step, kinda fragile as
this doesn't guarantee this will work on all platforms.

 - Flow control test failing on starfive, imx8mp, sun8i, solved by patch 6

Turns out these platforms actually never emit any Pause frame, as they don't
have enough room in their per-queue RX Fifo. They do correctly process RX
Pause frames. The fix isn't to change the advertised pauseparams, as the
pause negotiation process based on MAC capabilities doesn't allow us to
say we "just" support RX pause, so let's just not run the Pause tests if
the RX fifo is too small.

 - UC filter failing on meson8b, fixed by patches 2,3,4 and 5

This one is quite the rabbit hole, and is a combination of multiple issues.

 - Unicast filtering uses the same filter (perfect filter) to allow the
   primary MAC address and the secondary addresses (dev->uc) to flow
   through the interface. That means if we have say 64 slots in the
   perfect filter, only 63 can be used for the dev->uc list, as the first
   entry stores the MAC address. If the filter is full, we switch to UC
   promisc mode, were we let all UC frames flow. There's an off-by-one
   error in dwmac1000, dwmac4 and dwxgmac2.

 - The selftest itself needs an empty slot in the filter, so it has to
   check that sizeof(dev->uc) is $number_of_slots - 2 (one for primary
   MAC, one for the test). There's an off-by-two error in the selftest.

 - This leads to an interesting finding (not addressed by this series) :

   The size of the perfect filter isn't reported by the HW, so it comes
   from firmware (snps,perfect-filter-entries). A lot of platforms don't
   specify that in DT (e.g. imx8mp doesn't, it has 128 entries but the
   driver thinks there's only 1...). I've reached out to Synopsys to
   see if there's some sane default we could use on dwmac4, if anyone
   has a dwmac4 databook I'd appreciate if you could look this up, as I
   don't have access to them, I'm not a vendor... Otherwise, we'll have
   to patch all the .dtsi if we want to avoid going in UC promisc as
   soon as we add an entry in dev->uc.

After this series, socfpga, starfive and sun8i are all OK :)

Some issues are still out there, the VLAN filtering and tagging fails on
imx8mp and stm32 (so, dwmac4) butI haven't got there yet.

ARP offload doesn't work on stm32mp157a and starfive JH7110 either.
====================

Link: https://patch.msgid.link/20260826140500.616466-1-maxime.chevallier@bootlin.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-08-27 10:53:33 -07:00