With XDP enabled, rx ring 0 buffers are page_pool pages and the device is given a buffer length of MTU + 22 (skb_buf_size). The device still accepts somewhat longer frames (observed: up to MTU + 26 untagged, MTU + 30 with a VLAN tag) and splits them over two descriptors. vmxnet3_rq_rx_complete() runs XDP only for completions with both sop and eop set. A frame with sop but without eop falls through to the skb path, which uses rbi->skb although, for a VMXNET3_RX_BUF_XDP buffer, that union member holds the page. The result is a kernel BUG in skb_put(), or at BUG_ON(ctx->skb != NULL || rbi->skb == NULL): kernel BUG at net/core/skbuff.c:2637! RIP: 0010:skb_put+0x3c/0x40 Call Trace: vmxnet3_rq_rx_complete+0x893/0x12b0 [vmxnet3] vmxnet3_poll_rx_only+0x38/0xd0 [vmxnet3] __napi_poll+0x2b/0x160 net_rx_action+0x336/0x420 One frame of MTU + 23 to MTU + 26 bytes from any host on the same L2 segment is enough to crash a guest that has a native XDP program attached to a vmxnet3 interface. XDP on vmxnet3 is single-buffer, so drop such frames: count them in drop_total, reuse the head buffer and skip the body buffers, as the existing allocation failure path does. Count the dropped frame against the NAPI budget. The completions of one frame may span two polls, so start each poll with skip_page_frags set when no frame is in progress (rx_ctx.skb == NULL): a body buffer without a head can only belong to a dropped frame. The problem was found and analysed, and this patch drafted, with the help of an AI coding assistant. It was reproduced and tested on the reporter's lab systems as described in the cover letter. Fixes: 54f00cce1178 ("vmxnet3: Add XDP support.") Signed-off-by: Philipp Sudakas --- drivers/net/vmxnet3/vmxnet3_drv.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/drivers/net/vmxnet3/vmxnet3_drv.c b/drivers/net/vmxnet3/vmxnet3_drv.c index f8df83f..fb98eb7 100644 --- a/drivers/net/vmxnet3/vmxnet3_drv.c +++ b/drivers/net/vmxnet3/vmxnet3_drv.c @@ -1614,7 +1614,8 @@ vmxnet3_rq_rx_complete(struct vmxnet3_rx_queue *rq, adapter->rx_prod_offset, adapter->rx_prod2_offset }; u32 num_pkts = 0; - bool skip_page_frags = false; + /* A frame dropped at its head may continue in the next poll. */ + bool skip_page_frags = !rq->rx_ctx.skb; bool encap_lro = false; struct Vmxnet3_RxCompDesc *rcd; struct vmxnet3_rx_ctx *ctx = &rq->rx_ctx; @@ -1666,6 +1667,21 @@ vmxnet3_rq_rx_complete(struct vmxnet3_rx_queue *rq, goto rcd_done; } + if (rcd->sop && !rcd->eop && + rbi->buf_type == VMXNET3_RX_BUF_XDP && + !VMXNET3_RX_DATA_RING(adapter, rcd->rqID)) { + /* The frame did not fit one XDP buffer. XDP here is + * single-buffer and the head holds a page, not an skb: + * drop the frame, reuse the head, skip its body buffers. + * Count it against the budget like other XDP verdicts. + */ + rq->stats.drop_total++; + ctx->skb = NULL; + skip_page_frags = true; + num_pkts++; + goto rcd_done; + } + if (rcd->sop && rcd->eop && vmxnet3_xdp_enabled(adapter)) { struct sk_buff *skb_xdp_pass; int act; -- 2.47.3