diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2026-11-26 09:32:41 -0800 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2026-11-26 09:32:41 -0800 |
| commit | 9437ee8b6cf607e883b36e44bd755968daaebd48 (patch) | |
| tree | cc98a27940a488ac03e56adb00d6d3c5539ee0b2 /tools | |
| parent | df99e82b36ff3c243ec3a06afc0ccaa4866a5a41 (diff) | |
| parent | e1055cbfd6eb578417f3ce983cf44462e8465267 (diff) | |
Pull networking fixes from Paolo Abeni:
"Including fixes from WiFi, Bluetooth and CAN.
Current release - regressions:
- eth: mlx5e: TC, fix a NULL pointer write in the peer flow error path
Current release - new code bugs:
- xfrm: interface: drop non-IP packets before pskb_inet_may_pull()
- eth: b53: use the correct override register 2 Gbps bit
Previous releases - regressions:
- core:
- do not run out of frags in alloc_skb_with_frags()
- gso: cow head on tcp fraglist fallback to skb_segment
- ipv6:
- honor suppress_prefixlength in fib6_lookup()
- mcast: do not pass uninitialized bytes to dev_mc_add()
- tcp:
- don't clear saddr before ->put_port().
- initialize ir_rmt_addr and ir_loc_addr in cookie_v6_check()
- mptcp: fix dummy mapping of overlapping segments
- bluetooth:
- fix use-after-free in mgmt_powering_down()
- fix NULL pointer dereference on failed init
- wifi:
- iwlwifi: fix FW crashes on old devices and with 320 MHz channels
- ath10k: revert "stop unanswered temperature reads"
- rtw89: fix connection drop on RTL8851BE
- eth:
- gve: fix checksum state of HW-GRO packets
- mana: set a non-zero minimum interrupt moderation, fix TX timeouts
- brcm: fix link-local detection with a prepended tag
Previous releases - always broken:
- core:
- initialize sk_peer_lock in cloned sockets
- release netpoll dev_lock when NETDEV_PRE_UP vetoes an open
- gso: fall back to skb_segment when fraglist cannot satisfy checksum
- tcp: fix negative sk_forward_alloc after MSG_ZEROCOPY append
- udp: only quit inuse scan early on identical SO_REUSEPORT sockets
- ipv4: fix conntrack defrag forwarding after ip_frag_reinit()
- vsock/bpf: release sock lock while waiting for data in recvmsg,
fix deadlock
- mptcp: a bunch of fixes for send stalls after fallback and TFO
- can: avoid RTNL stalls in CAN_RAW, CAN_ISOTP and CAN_BCM
- eth:
- tun: bound the NAPI receive queue
- tg3: fix heap overflow in unbuffered NVRAM write path
- mlx5: DR, fix out-of-bounds write when sync to HW fails
- ionic: fix TX stalls on TSO skbs larger than the TX ring
- bcm4908: a bunch of TX/RX ring fixes
Misc:
- add Willem de Bruijn to networking maintainers"
* tag 'net-7.4-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (152 commits)
udp: only quit inuse scan early on identical SO_REUSEPORT sockets
net: dsa: tag_brcm: fix link-local detection with a prepended tag
tg3: Fix heap overflow in unbuffered NVRAM write path
tg3: Skip management FW version when APE firmware is not ready
tg3: Don't fail probe if 31-bit coherent DMA mask is unsupported
selftests: tls: add a poll test for a queued KeyUpdate
tls: don't hide a queued KeyUpdate from poll()
xfrm: interface: drop non-IP packets before pskb_inet_may_pull()
net/tcp-ao: fix reset key lookup for IPv4 segments on IPv6 listeners
tcp: fix negative sk_forward_alloc after MSG_ZEROCOPY append
tcp: Don't clear saddr before ->put_port().
vhost/net: Fix receive queue test in busy poll
ipv6: mcast: do not pass uninitialized bytes to dev_mc_add()
tipc: restore write readiness when a socket's group goes away
mptcp: gate diag sequence counters on CAP_NET_ADMIN
net: dsa: felix: fix NULL pointer dereference in felix_port_enable()
selftests: netfilter: cover IPv6 FIB prefix suppression
ipv6: Honor suppress_prefixlength in fib6_lookup()
ptp: vmclock: keep the device state until the last file is closed
tun: bound the NAPI receive queue
...
Diffstat (limited to 'tools')
| -rwxr-xr-x | tools/testing/selftests/drivers/net/stats.py | 25 | ||||
| -rw-r--r-- | tools/testing/selftests/net/af_unix/scm_pidfd.c | 51 | ||||
| -rwxr-xr-x | tools/testing/selftests/net/netfilter/nft_fib.sh | 90 | ||||
| -rw-r--r-- | tools/testing/selftests/net/tls.c | 40 |
4 files changed, 205 insertions, 1 deletions
diff --git a/tools/testing/selftests/drivers/net/stats.py b/tools/testing/selftests/drivers/net/stats.py index b08e4d48b15c..e61db30b5181 100755 --- a/tools/testing/selftests/drivers/net/stats.py +++ b/tools/testing/selftests/drivers/net/stats.py @@ -220,6 +220,28 @@ def check_down(cfg) -> None: netfam.qstats_get({"ifindex": cfg.ifindex, "scope": "queue"}, dump=True) +@ksft_disruptive +def check_down_ts_stats(cfg) -> None: + """Test timestamping stats are not impacted by ifdown""" + + req = {"header": {"dev-index": cfg.ifindex, "flags": {"stats"}}} + try: + stats = ethnl.tsinfo_get(req).get("stats") + except NlError as e: + if e.error == errno.EOPNOTSUPP: + raise KsftSkipEx("timestamping not supported by the device") from e + raise + if not stats: + raise KsftSkipEx("timestamping stats not supported by the device") + + ip(f"link set dev {cfg.dev['ifname']} down") + defer(ip, f"link set dev {cfg.dev['ifname']} up") + + stats2 = ethnl.tsinfo_get(req).get("stats", {}) + for k in stats: + ksft_ge(stats2[k], stats[k], comment=f"{k} went backwards on device down") + + def __run_inf_loop(body): body = body.strip() if body[-1] != ';': @@ -311,7 +333,8 @@ def main() -> None: with NetDrvEnv(__file__, queue_count=100) as cfg: ksft_run([check_pause, check_fec, check_fec_hist, pkt_byte_sum, - qstat_by_ifindex, check_down, procfs_hammer, + qstat_by_ifindex, check_down, check_down_ts_stats, + procfs_hammer, procfs_downup_hammer], args=(cfg, )) ksft_exit() diff --git a/tools/testing/selftests/net/af_unix/scm_pidfd.c b/tools/testing/selftests/net/af_unix/scm_pidfd.c index cbe53fab44fc..c26f055a1903 100644 --- a/tools/testing/selftests/net/af_unix/scm_pidfd.c +++ b/tools/testing/selftests/net/af_unix/scm_pidfd.c @@ -1155,4 +1155,55 @@ TEST(so_peerpidfd_thread) close(server); } +/* The lowest free file descriptor, where the next pidfd would land. */ +static int lowest_free_fd(int fd) +{ + int nfd; + + nfd = dup(fd); + if (nfd >= 0) + close(nfd); + return nfd; +} + +/* A short optlen must fail without installing a pidfd. */ +TEST(so_peerpidfd_short_optlen) +{ + const int optnames[] = { SO_PEERPIDFD, SO_PEERPIDFD_THREAD }; + int sv[2], i, free_fd, pidfd; + socklen_t len, optlen; + + ASSERT_EQ(0, socketpair(AF_UNIX, SOCK_STREAM, 0, sv)); + + for (i = 0; i < ARRAY_SIZE(optnames); i++) { + for (len = 0; len < sizeof(pidfd); len++) { + free_fd = lowest_free_fd(sv[0]); + ASSERT_LE(0, free_fd); + + pidfd = -1; + optlen = len; + ASSERT_EQ(-1, getsockopt(sv[0], SOL_SOCKET, optnames[i], + &pidfd, &optlen)); + ASSERT_EQ(EINVAL, errno); + EXPECT_EQ(len, optlen); + EXPECT_EQ(-1, pidfd); + + /* No pidfd was installed behind our back. */ + ASSERT_EQ(free_fd, lowest_free_fd(sv[0])); + } + + /* A full-sized buffer still gets the pidfd. */ + free_fd = lowest_free_fd(sv[0]); + optlen = sizeof(pidfd); + ASSERT_EQ(0, getsockopt(sv[0], SOL_SOCKET, optnames[i], + &pidfd, &optlen)); + EXPECT_EQ(sizeof(pidfd), optlen); + EXPECT_EQ(free_fd, pidfd); + close(pidfd); + } + + close(sv[0]); + close(sv[1]); +} + TEST_HARNESS_MAIN diff --git a/tools/testing/selftests/net/netfilter/nft_fib.sh b/tools/testing/selftests/net/netfilter/nft_fib.sh index 04544905c216..25e13197f057 100755 --- a/tools/testing/selftests/net/netfilter/nft_fib.sh +++ b/tools/testing/selftests/net/netfilter/nft_fib.sh @@ -202,6 +202,50 @@ check_fib_counter() { return 0 } +# Count probes matching the expected FIB result, then drop them. +test_fib_suppress() { + local label="$1" expected="$2" + local result="${3:-oifname}" error err=0 + + if ! ip netns exec "$nsrouter" nft -f /dev/stdin <<EOF +flush table ip6 filter +table ip6 filter { + chain prerouting { + type filter hook prerouting priority -1; + ip6 saddr dead:1::99 icmpv6 type echo-request \ + fib saddr . mark $result "$expected" counter drop + } +} +EOF + then + echo "FAIL: $label (could not load ruleset)" + return 1 + fi + ip netns exec "$ns1" ping -6 -c 1 -W 0.1 -q dead:1::1 > /dev/null 2>&1 + if [ "$result" = type ]; then + case "$expected" in + blackhole) error="Invalid argument" ;; + unreachable) error="No route to host" ;; + prohibit) error="Permission denied" ;; + esac + LC_ALL=C ip -net "$nsrouter" -6 route get dead:1::99 \ + from dead:1::1 2>&1 | + grep -Fxq "RTNETLINK answers: $error" || err=1 + else + ip -net "$nsrouter" -6 route get dead:1::99 from dead:1::1 | + grep -q "dev $expected " || err=1 + fi + if check_fib_type_counter_family ip6 1 "$nsrouter" prerouting \ + "$result" "$label" && + [ "$err" -eq 0 ]; then + echo "PASS: $label" + else + echo "FAIL: $label" + ret=1 + return 1 + fi +} + load_ruleset "$nsrouter" load_ruleset "$ns1" load_ruleset "$ns2" @@ -845,6 +889,52 @@ test_fib_type "default table" ip netns exec "$nsrouter" nft delete table ip filter ip netns exec "$nsrouter" nft delete table ip6 filter +# Keep the earlier IPv6 checks on the path without custom rules. +# The router's logging RPF rules have already been removed here. +if ip -net "$nsrouter" -6 rule add pref 100 to dead:1::99 table 128 \ + suppress_prefixlength 0; then + ip -net "$nsrouter" -6 route add table 128 default dev veth1 || exit 1 + ip -net "$nsrouter" -6 route add table 129 dead:1::/64 \ + dev veth0 || exit 1 + ip -net "$nsrouter" -6 rule add pref 101 to dead:1::99 \ + table 129 || exit 1 + ip netns exec "$nsrouter" nft add table ip6 filter || exit 1 + + test_fib_suppress "suppress default route" veth0 || ret=1 + ip -net "$nsrouter" -6 route add table 128 dead:1::/64 \ + dev veth1 || exit 1 + test_fib_suppress "retain non-default route" veth1 || ret=1 + ip -net "$nsrouter" -6 route del table 128 dead:1::/64 \ + dev veth1 || exit 1 + + for type in blackhole unreachable prohibit; do + ip -net "$nsrouter" -6 route replace "$type" default \ + table 128 || exit 1 + test_fib_suppress "retain $type" "$type" type || ret=1 + done + + if ip -net "$nsrouter" -6 nexthop add id 1 blackhole; then + ip -net "$nsrouter" -6 route replace default nhid 1 \ + table 128 || exit 1 + test_fib_suppress "retain blackhole nexthop" \ + blackhole type || ret=1 + ip -net "$nsrouter" -6 route del table 128 default + ip -net "$nsrouter" -6 nexthop del id 1 + else + echo "SKIP: blackhole nexthop objects unavailable" + [ "$ret" -eq 0 ] && ret=$ksft_skip + ip -net "$nsrouter" -6 route del table 128 default + fi + + ip -net "$nsrouter" -6 rule del pref 100 + ip -net "$nsrouter" -6 rule del pref 101 + ip -net "$nsrouter" -6 route flush table 129 + ip netns exec "$nsrouter" nft delete table ip6 filter +else + echo "SKIP: IPv6 prefix suppression unavailable" + [ "$ret" -eq 0 ] && ret=$ksft_skip +fi + test_fib_vrf exit $ret diff --git a/tools/testing/selftests/net/tls.c b/tools/testing/selftests/net/tls.c index bd2797f9f619..59e403b5f12c 100644 --- a/tools/testing/selftests/net/tls.c +++ b/tools/testing/selftests/net/tls.c @@ -2421,6 +2421,46 @@ TEST_F(tls, rekey_poll_delay) } } +TEST_F(tls, rekey_poll_queued) +{ + char const *test_str = "test_message"; + struct tls_crypto_info_keys tls12; + struct pollfd pfd = { }; + char buf[100]; + int send_len; + + if (self->notls) + SKIP(return, "no TLS support"); + + if (variant->tls_version != TLS_1_3_VERSION) + return; + + /* data followed by a KeyUpdate */ + send_len = strlen(test_str) + 1; + EXPECT_EQ(send(self->fd, test_str, send_len, 0), send_len); + tls_send_keyupdate(_metadata, self->fd); + + /* reading the data decrypts the KeyUpdate and leaves it queued */ + EXPECT_EQ(recv(self->cfd, buf, sizeof(buf), MSG_WAITALL), send_len); + EXPECT_EQ(memcmp(buf, test_str, send_len), 0); + + /* KeyUpdate hasn't been read, expect cfd to be readable */ + pfd.fd = self->cfd; + pfd.events = POLLIN; + EXPECT_EQ(poll(&pfd, 1, 0), 1); + + /* get KeyUpdate */ + tls_recv_keyupdate(_metadata, self->cfd, 0); + + /* update TX key and send with it */ + tls_crypto_info_init(variant->tls_version, variant->cipher_type, &tls12, 1); + EXPECT_EQ(setsockopt(self->fd, SOL_TLS, TLS_TX, &tls12, tls12.len), 0); + EXPECT_EQ(send(self->fd, test_str, send_len, 0), send_len); + + /* key hasn't been updated, expect cfd to be non-readable */ + EXPECT_EQ(poll(&pfd, 1, 0), 0); +} + struct raw_rec { unsigned int plain_len; unsigned char plain_data[100]; |
