[PATCH net v3 0/4] gve: Fixes for issues discovered via net selftests and Sashiko
From: Harshitha Ramamurthy
Date: Fri Oct 23 2026 - 16:49:29 EST
From: Pin-yen Lin <treapking@xxxxxxxxxx>
This patch series addresses several issues in the gve driver. All four of
these fixes were either uncovered by running the net selftests or
suggested by Sashiko in the previous version.
The series includes the following changes:
- Patch 1 introduces a spinlock (stats_lock) to robustly synchronize stats
queries (including ndo_get_stats64 and queue stats) against queue
teardown and restart, preventing UAF and out-of-bounds reads. This was
discovered by the drivers/net/stats.py selftest.
- Patch 2 fixes an issue where interface stats would go backwards when the
interface was brought down or its configuration was adjusted. This was
also discovered by the drivers/net/stats.py selftest.
- Patch 3 ensures the driver falls back to the default minimum ring size if
the corresponding device option values are exposed as 0. This prevents
userspace from configuring unexpectedly small ring sizes. This was
discovered by the drivers/net/ring_reconfig.py selftest.
- Patch 4 makes sure ethtool configuration modifications are done
synchronously before returning to the userspace. This was discovered by
the drivers/net/ping.py selftest.
Changes in v3:
- Link to v2: https://lore.kernel.org/netdev/20260425002450.163421-1-hramamurthy@xxxxxxxxxx/
- Protect all stats queries and queue lifecycle updates with a spinlock
(Sashiko)
- Drop u64_stats_sync for the base stats and use the spinlock instead
- Save base stats in gve_queues_mem_remove() and gve_rx_queue_stop()
- Drop unused rx_dropped and tx_dropped accumulation in
gve_add_base_stats()
- Fix the Fixes tag of patch 4
- Refined the commit messages
- Rebased to the latest net tree
Changes in v2:
- Add a NULL pointer check in gve_get_ring_err_stats() (Sashiko)
- Use local variable to prevent inflates from u64_stats_fetch_retry()
(Sashiko)
- Add u64_stats_fetch/begin to protect base stats (Sashiko)
Debarghya Kundu (1):
gve: Fix backward stats when interface goes down or configuration is
adjusted
Pin-yen Lin (3):
gve: Fix race between stats query and queue reconfig
gve: Block invalid ring sizes when device options are 0
gve: Fix link flap after ethtool ops
drivers/net/ethernet/google/gve/gve.h | 8 +
drivers/net/ethernet/google/gve/gve_adminq.c | 4 +-
drivers/net/ethernet/google/gve/gve_main.c | 179 ++++++++++++++-----
3 files changed, 148 insertions(+), 43 deletions(-)
base-commit: 734bef548a96e8774d6eef5dfa2026c6edc4e80b
--
2.56.0.257.gf7497c7d27-goog