From: Philipp Sudakas <filzador@gmail.com>
To: ronak.doshi@broadcom.com, bcm-kernel-feedback-list@broadcom.com
Cc: netdev@vger.kernel.org, bpf@vger.kernel.org,
andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@kernel.org,
kuba@kernel.org, pabeni@redhat.com, ast@kernel.org,
daniel@iogearbox.net, hawk@kernel.org, john.fastabend@gmail.com,
sdf@fomichev.me, u9012063@gmail.com,
Philipp Sudakas <filzador@gmail.com>
Subject: [PATCH net v2 1/5] vmxnet3: clear rx_ctx.skb after a data ring XDP verdict
Date: Mon, 23 Nov 2026 15:48:51 +0300 [thread overview]
Message-ID: <20261123124855.1021-2-filzador@gmail.com> (raw)
In-Reply-To: <20261123124855.1021-1-filzador@gmail.com>
For a completion from the rx data ring, vmxnet3_rq_rx_complete() sets
ctx->skb = rbi->skb in the sop block before running XDP on the data
ring copy. With XDP enabled, the ring 0 head buffer is
VMXNET3_RX_BUF_XDP and that union member holds a page_pool page, not
an skb. On XDP_PASS ctx->skb is replaced with the new skb, but on any
other verdict, XDP_DROP included, it keeps the page pointer.
The stale value then belongs to no frame. If the next completion is a
single descriptor with rcd->err set, vmxnet3_rx_error() passes it to
dev_kfree_skb_irq(). The ring buffer XDP path already clears ctx->skb
after a non-PASS verdict; do the same here.
The problem was found and analysed, and this patch drafted, with the
help of an AI coding assistant. It was reported by an automated
review of an earlier version of this series.
Fixes: 54f00cce1178 ("vmxnet3: Add XDP support.")
Signed-off-by: Philipp Sudakas <filzador@gmail.com>
---
drivers/net/vmxnet3/vmxnet3_drv.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/net/vmxnet3/vmxnet3_drv.c b/drivers/net/vmxnet3/vmxnet3_drv.c
index f8df83f..e8be95c 100644
--- a/drivers/net/vmxnet3/vmxnet3_drv.c
+++ b/drivers/net/vmxnet3/vmxnet3_drv.c
@@ -1742,6 +1742,7 @@ skip_xdp:
ctx->skb = skb_xdp_pass;
goto sop_done;
}
+ ctx->skb = NULL;
need_flush |= act == XDP_REDIRECT;
goto rcd_done;
--
2.47.3
next prev parent reply other threads:[~2026-11-23 12:49 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-23 12:48 [PATCH net v2 0/5] vmxnet3: fix native XDP crash on oversized frames and XDP loss on reset Philipp Sudakas
2026-11-23 12:48 ` Philipp Sudakas [this message]
2026-11-23 12:48 ` [PATCH net v2 2/5] vmxnet3: keep the previous XDP program when attaching fails Philipp Sudakas
2026-11-23 12:48 ` [PATCH net v2 3/5] vmxnet3: limit the XDP MTU to the rx head buffer size Philipp Sudakas
2026-11-23 12:48 ` [PATCH net v2 4/5] vmxnet3: drop XDP frames that do not fit in one rx buffer Philipp Sudakas
2026-11-23 12:48 ` [PATCH net v2 5/5] vmxnet3: keep the XDP program across device resets Philipp Sudakas
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=20261123124855.1021-2-filzador@gmail.com \
--to=filzador@gmail.com \
--cc=andrew+netdev@lunn.ch \
--cc=ast@kernel.org \
--cc=bcm-kernel-feedback-list@broadcom.com \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=davem@davemloft.net \
--cc=edumazet@kernel.org \
--cc=hawk@kernel.org \
--cc=john.fastabend@gmail.com \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=ronak.doshi@broadcom.com \
--cc=sdf@fomichev.me \
--cc=u9012063@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox