Article View: linux.kernel.netdev
Article #20307[PATCH net 1/2] vmxnet3: drop XDP frames that do not fit in one rx buffer
From: Philipp Sudakas
Date: Sun, 22 Nov 2026 00:28
Date: Sun, 22 Nov 2026 00:28
81 lines
13765 bytes
13765 bytes
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:
<IRQ>
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 <filzador@gmail.com>
---
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
Technical Details
Message-ID:
<20261122002847.616-2-filzador@gmail.com>Path:
mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-368544-linux-kernel-netdev=dewy.ruReferences:
<20261122002847.616-1-filzador@gmail.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-368544-linux-kernel-netdev=dewy.ru
From: filzador@gmail.com (Philipp Sudakas)
Newsgroups: linux.kernel.netdev
Subject: [PATCH net 1/2] vmxnet3: drop XDP frames that do not fit in one rx buffer
Date: Sun, 22 Nov 2026 03:28:46 +0300
Organization: Usenet Network
Message-ID: <20261122002847.616-2-filzador@gmail.com>
References: <20261122002847.616-1-filzador@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
logging-data="3531175"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:Vfvv+pst3cLCQgfZ+FDLpghKO14= sha256:TLFbQQu7jCQAZr1DmyMPzG/kTgPGazUpVeW6G9RHd+c=
sha1:WN4Z7uRHLiRnEwXYJX24iUQEUk0= sha256:ueKfD85unxUJGyj1Lz+GfiMFXyWjJOvIESFlgawoha4=
List-ID: <netdev.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1])
by mail.dewy.ru (Postfix) with ESMTP id 90BE3115C4F; Sun, 22 Nov 2026 03:29:14 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -2.049
X-Spam-Status: No, score=-2.049 tagged_above=-9999 required=6.31
tests=[DCC_REPUT_70_89=0.1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1,
DKIM_VALID_AU=-0.1, FORGED_GMAIL_RCVD=1,
FREEMAIL_FORGED_FROMDOMAIN=0.001, FREEMAIL_FROM=0.001,
HEADER_FROM_DIFFERENT_DOMAINS=0.249, MAILING_LIST_MULTI=-1,
RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001]
autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key)
header.d=gmail.com
X-Received: from mail.dewy.ru ([127.0.0.1])
by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024)
with ESMTP id CHT2ePpS10Uk;
Sun, 22 Nov 2026 03:29:11 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-368544-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN>
X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=gmail.com
X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
by mail.dewy.ru (Postfix) with ESMTPS id 493C1115C17; Sun, 22 Nov 2026 03:29:02 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
by sea.lore.kernel.org (Postfix) with ESMTP id 2F76E3520F; Sun, 22 Nov 2026 00:29:01 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
t=1795307340;
b=RZIA+SZRq2X6wBrsNH9e3ZnWGAX0FWXhTnMgmzDJ80d33baZM5IeS9+cpW7B6Nfsdbjf
fZKiyuvcUJi4cLsj4GgoA5/wjDyZEJvA+18mqVCWulGNazV3x2apJH4WdPwNa8J5ARVST
6epXf5r3Rx88BcsCjDTJl9TYYMIGvL1NYWbXmlZ25HTCBSOWhSaNA7a5OuS9ecnupy5Wm
6tonCmEEwC9Wu6qKK9sAhLldnntbOz9TmI79yajH52z9gl694TzbkzUG2wN4hX6ef4+Ft
3Z39GIagWqJlHdpT8D+3jm9PkF0taFAdh/i9J+fVrK1de3PmduE7WD9o2a3VJC7L2FQ==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
a=rsa-sha256; c=relaxed/relaxed; t=1795307340;
h=X-Original-To:Received:DMARC-Filter:Received:DKIM-Signature:
X-Google-DKIM-Signature:X-Gm-Message-State:X-Gm-Gg:X-Received:
Received:From:To:Cc:Subject:Date:Message-ID:X-Mailer:In-Reply-To:
References:X-Mailing-List:List-Id:List-Post:List-Help:List-Subscribe:
List-Unsubscribe:List-Owner:Precedence:MIME-Version:
Content-Transfer-Encoding;
bh=J4rkI/3lcB0t873F/Ch5NZS7moBAkp3mZ08wbMwuyY8=;
b=l/SQvHoRQ6LsHbAHQpWhxVKojj4/q4MS6sKFjuJ2fc82Muy0O5CoahNGxW6HcKjwTpIV
sYD1W6ilR/SZmpEQHBAgBmRbROIUHiEigEWzQd0rU97AscnKl5ko4+xMZX2qBDR8hlzyH
s9ckJBB5HnQfNQBoXRlLCbWjRF20mRCpdjD9jl85bxE4EfcfM7rJZFDD6FJR9UFSTjUJH
2MsZUiVW2MWNzu2h07yk/NvfYtjgx+Bqm3SF2JUyCMnlJdUKm/HInNrl9dZwbsqXgQjmE
9I8CyjQ/Q1BZQf8trQzmgpcIJJoDwAjmEG2feiiJLVMtKpo8w29bOWa+gIsfZI9nT6g==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org;
dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=E5RSggNY;
dmarc=pass header.from=gmail.com;
spf=pass smtp.mailfrom=gmail.com;
arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-Received: from localhost.localdomain (localhost [127.0.0.1])
by smtp.subspace.kernel.org (Postfix) with ESMTP id 96969606A335;
Sun, 22 Nov 2026 00:29:00 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=E5RSggNY
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.221.42
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
t=1795307339;
b=cYIDr8TTjax77MLAp+VNqjqWK7KYQh4t2Zpkt9Wn7tuJ03k+Xzl3RKwqsIukgJSG/AF1
4corgDuZ5g7N9lqEagFBQS9/zVgO99zXyvxHDIK0ZhiwSVDmmZeJ0ULwRIyFdvi5iX10B
Y3atn46y096k7nn4DFhSmTljJ2EtrqQSDdNZ7FAvOjeGIeMIP71I8sy+vz0zut6ojWlRc
40hp/R90MxOn49EfC6lRETYe1FhsLNBjWFBkenUa38d6T4iVv7tK/mPnqDmFPNphuriPV
Jh2LtTY+k/P12LMF/u9e8K7fIQZ15ZvNBP49qu8tcOcZF2RkAOpDoFJE295TrVFfgGg==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
a=rsa-sha256; c=relaxed/relaxed; t=1795307339;
h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature:
X-Gm-Message-State:X-Gm-Gg:X-Received:Received:From:To:Cc:Subject:
Date:Message-ID:X-Mailer:In-Reply-To:References:MIME-Version:
Content-Transfer-Encoding;
bh=J4rkI/3lcB0t873F/Ch5NZS7moBAkp3mZ08wbMwuyY8=;
b=xJ2pOjich1ZcZ2AAml5r5ez9Td3cX9V9XlFW3/r3CIU7xN445RQGP/vaw8ljAAlGbwAc
EkTy/fMRTZmLBhLMP8x2Jd0gjpx3nkgOMNcmDWtyU+kF0FGZw9O3AvtoYMHnDCs3CQecw
aRREMVH+ri3e7e7qgoB0xyybTfcvbBijFDvXLYV3ywtdgwqIUr8+IAlNBn7Ie0uCwuXfr
iBKuWMwIw0WA3lW6+VGW+/R1vHB7KgBrW9ADSXuQE4LS60HNJDwAXyD10pHcq1zGetkRe
JMZHNmB5aa+WUWxNtFgzIuY4yScJvQsWjE6G8T7EXMhy/V6S6IQLvsT/DnwcAmpJleA==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org;
dmarc=pass header.from=gmail.com;
spf=pass smtp.mailfrom=gmail.com;
dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=E5RSggNY;
arc=none smtp.remote-ip=209.85.221.42
X-Received: from mail-wr1-f42.google.com (mail-wr1-f42.google.com [209.85.221.42])
(using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)
key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256)
(No client certificate requested)
by smtp.subspace.kernel.org (Postfix) with ESMTPS id 59728606A320
for <netdev@vger.kernel.org>; Sun, 22 Nov 2026 00:28:59 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 59728606A320
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com
X-Received: by mail-wr1-f42.google.com with SMTP id ffacd0b85a97d-48dfc0421d9so2040741f8f.1
for <netdev@vger.kernel.org>; Sat, 21 Nov 2026 16:28:59 -0800 (PST)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=gmail.com; s=20260707; t=1795307338; x=1795912138; darn=vger.kernel.org;
h=content-transfer-encoding:mime-version:references:in-reply-to
:message-id:date:subject:cc:to:from:from:to:cc:subject:date
:message-id:reply-to:content-type;
bh=J4rkI/3lcB0t873F/Ch5NZS7moBAkp3mZ08wbMwuyY8=;
b=E5RSggNYQ2MZc6toIGh1CcUASP15BMuuAhOlBVwBpUDPxNpAJQh3dbQxtyaVrSj7gJ
E8cELtLN/UJMDXWTWgneMIncfVsYkCO5JclcYrqsN5xmaUtqCRfgUDJccoG0l4RczZQz
K+i+NkkKMSZ7q8JdjiBXoZd+7Hn+leGCdyp9WkfFVK7Q+iCVbSJ48kj9BUZZckR8LYUn
5aZqcrsjtZYN+MxKf+Sa5q56fvD9KrBGt0n1oS31gW7Kb7PaGev45HHNlVqE0j/0q1qj
dTAdx4HB7DxvlqCrtbLN6K12d9mIN9lMEgbshLnQNo1HJyORcz9F2c96s5CqvXB8U9Sa
r3Ag==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20260707; t=1795307338; x=1795912138;
h=content-transfer-encoding:mime-version:references:in-reply-to
:message-id:date:subject:cc:to:from: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k9o5zD+LlZRJMONLqcbfoBG26JegxsKIComnu/j77rI
sKn8NY72qziP70xRuBwbh+PArEgvVm+JZNiqzW/dQqBRYHlw7tTX1iQP5IreZcV8EIyKDRp9OAN
WOx06IXfmkHyPkdF/rQihEv+CiuWRi/c66wBRQ4=
X-Received: by 2002:a5d:5d0a:0:b0:4a7:e4c7:2795 with SMTP id ffacd0b85a97d-4abb71cbe31mr17127173f8f.36.1795307337743;
Sat, 21 Nov 2026 16:28:57 -0800 (PST)
X-Received: from Philipp-PC ([91.227.186.127])
by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-4ab6b10b2c9sm14415962f8f.31.2026.11.21.16.28.56
(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
Sat, 21 Nov 2026 16:28:57 -0800 (PST)
X-Cc: netdev@vger.kernel.org,
Philipp Sudakas <filzador@gmail.com>
X-Mailer: git-send-email 2.56.0.windows.4
X-In-Reply-To: <20261122002847.616-1-filzador@gmail.com>
X-Mailing-List: netdev@vger.kernel.org
X-List-Post: <mailto:netdev@vger.kernel.org>
X-List-Help: <mailto:netdev+help@vger.kernel.org>
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>
X-List-Owner: <mailto:netdev+owner@vger.kernel.org>
X-Precedence: list