All of lore.kernel.org
 help / color / mirror / Atom feed
From: Joshua Washington <joshwash@google.com>
To: netdev@vger.kernel.org
Cc: Joshua Washington <joshwash@google.com>,
	Harshitha Ramamurthy <hramamurthy@google.com>,
	 Andrew Lunn <andrew+netdev@lunn.ch>,
	"David S. Miller" <davem@davemloft.net>,
	 Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	 Jordan Rhee <jordanrhee@google.com>,
	Willem de Bruijn <willemb@google.com>,
	 Ankit Garg <nktgrg@google.com>,
	Tim Hostetler <thostet@google.com>,
	 Praveen Kaligineedi <pkaligineedi@google.com>,
	Jeroen de Borst <jeroendb@google.com>,
	 Stanislav Fomichev <sdf@fomichev.me>,
	linux-kernel@vger.kernel.org, bpf@vger.kernel.org,
	 stable@vger.kernel.org
Subject: [PATCH net 2/6] gve: fix XSK buffer leak when rings are stopped
Date: Fri, 14 Aug 2026 16:48:41 -0700	[thread overview]
Message-ID: <20260814234845.773189-3-joshwash@google.com> (raw)
In-Reply-To: <20260814234845.773189-1-joshwash@google.com>

GVE does not free XSK buffers when resetting ring state as a part of
stopping queues. This causes all XSK buffers which are posted to the
NIC to be leaked.

Free XSK buffers attached to an allocated buf_state when stopping rings.

Fixes: c1fffc5d66a7 ("gve: implement DQO RX datapath and control path for AF_XDP zero-copy")
Cc: stable@vger.kernel.org
Reviewed-by: Tim Hostetler <thostet@google.com>
Reviewed-by: Jordan Rhee <jordanrhee@google.com>
Signed-off-by: Joshua Washington <joshwash@google.com>
---
 drivers/net/ethernet/google/gve/gve_rx_dqo.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/net/ethernet/google/gve/gve_rx_dqo.c b/drivers/net/ethernet/google/gve/gve_rx_dqo.c
index db38bc645296..2c1ce23d1550 100644
--- a/drivers/net/ethernet/google/gve/gve_rx_dqo.c
+++ b/drivers/net/ethernet/google/gve/gve_rx_dqo.c
@@ -113,6 +113,12 @@ static void gve_rx_reset_ring_dqo(struct gve_priv *priv, int idx)
 				gve_free_to_page_pool(rx, bs, false);
 			else
 				gve_free_qpl_page_dqo(bs);
+
+			if (gve_buf_state_is_allocated(rx, bs) &&
+			    bs->xsk_buff) {
+				xsk_buff_free(bs->xsk_buff);
+				bs->xsk_buff = NULL;
+			}
 		}
 	}
 
-- 
2.55.0.691.gc56d675ccc-goog


  parent reply	other threads:[~2026-08-14 23:49 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-14 23:48 [PATCH net 0/6] gve: various XDP fixes Joshua Washington
2026-08-14 23:48 ` [PATCH net 1/6] gve: increment work_done for XDP and error packets Joshua Washington
2026-08-15 23:49   ` sashiko-bot
2026-08-14 23:48 ` Joshua Washington [this message]
2026-08-15 23:49   ` [PATCH net 2/6] gve: fix XSK buffer leak when rings are stopped sashiko-bot
2026-08-14 23:48 ` [PATCH net 3/6] gve: fix XSK buffer leak on error descriptor Joshua Washington
2026-08-15 23:49   ` sashiko-bot
2026-08-14 23:48 ` [PATCH net 4/6] gve: don't register xsk pool on pre-existing queues in RDA mode Joshua Washington
2026-08-15 23:49   ` sashiko-bot
2026-08-14 23:48 ` [PATCH net 5/6] gve: fix napi_disable deadlock when attempting to disable XSK pools Joshua Washington
2026-08-15 23:49   ` sashiko-bot
2026-08-14 23:48 ` [PATCH net 6/6] gve: fix NULL dereference from premature XSK pool DMA unmap Joshua Washington
2026-08-15 23:49   ` sashiko-bot
2026-08-16  5:29 ` [PATCH net 0/6] gve: various XDP fixes Joshua Washington

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260814234845.773189-3-joshwash@google.com \
    --to=joshwash@google.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=bpf@vger.kernel.org \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=hramamurthy@google.com \
    --cc=jeroendb@google.com \
    --cc=jordanrhee@google.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=nktgrg@google.com \
    --cc=pabeni@redhat.com \
    --cc=pkaligineedi@google.com \
    --cc=sdf@fomichev.me \
    --cc=stable@vger.kernel.org \
    --cc=thostet@google.com \
    --cc=willemb@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.