Article View: linux.kernel.netdev
Article #20980[PATCH net v2 0/5] vmxnet3: fix native XDP crash on oversized frames and XDP loss on reset
From: Philipp Sudakas
Date: Mon, 23 Nov 2026 12:48
Date: Mon, 23 Nov 2026 12:48
95 lines
15136 bytes
15136 bytes
Fixes for native XDP on vmxnet3. A single frame from any host on the
same L2 segment can crash a guest that has an XDP program attached;
any device reset silently stops XDP; and the attach error path leaves
the driver with a program it holds no reference to.
Patch 1: the rx data ring XDP path leaves rx_ctx.skb pointing at the
ring head page after a non-PASS verdict. Patch 4 relies on rx_ctx.skb
being NULL between frames.
Patch 2: vmxnet3_xdp_set() releases the old program before the device
is active again and does not roll back on failure. Keep the old
program on failure. Patch 5 removes the side effect that used to hide
this.
Patch 3: with an MTU between 3051 and VMXNET3_XDP_MAX_MTU, full-sized
frames do not fit the 3072-byte rx head buffer. Limit the XDP MTU so
that they do.
Patch 4: a frame that does not fit in one XDP rx buffer (sop without
eop) reaches the skb path, which takes the page_pool page for an skb:
kernel BUG in skb_put(). With MTU 1500, a single untagged frame of
1523..1526 bytes is enough. Drop such frames.
Patch 5: vmxnet3_rq_cleanup_all() clears xdp_bpf_prog on every quiesce
(MTU change, down/up, ring resize, reset). XDP stops being called while
the program is still reported as attached, and its reference leaks.
Reproduced with stock modules on Debian kernels 6.12.113, 6.12.117 and
7.2.12 (7.2.12 untainted), VMware virtual hardware version 20. A small
reproducer (raw frame sender and an XDP_PASS counter program) is
available on request.
Testing:
- Run-tested: the patched vmxnet3 files of net as of today, with the
driver's current vmxnet3_ethtool.c and headers, built as a module for
a Debian 7.2.12 kernel; VMware virtual hardware version 20, MTU 1500,
native XDP:
- untagged frames of 1514..1522 bytes reach XDP; 1523, 1524 and
1526 bytes are dropped and counted in drop_total; 1530 bytes with
a VLAN 0 tag are dropped; no crash;
- 5000 frames of 1500 bytes mixed with 5000 of 1524 bytes: exactly
5000 XDP passes and 5000 drops;
- with XDP_DROP attached, small frames over the rx data ring
(64 and 100 bytes) are dropped by XDP, followed by normal and
oversized frames without issue;
- after an MTU change, down/up and an rx ring resize the same
program keeps running; after detach no program is left loaded;
- MTU 3051 is refused with XDP attached and attaching at MTU 3051
is refused; at MTU 3050 frames of 3064 bytes reach XDP and 3073
bytes are dropped;
- attach and detach failures were forced with a test-only module
parameter that skips vmxnet3_rq_create_all() and returns -ENOMEM:
after a failed attach no XDP program is attached or left loaded,
and after down/up the stack receives again; after a failed detach
the old program stays attached and runs again after down/up, and
is freed after a later detach.
No warnings in dmesg.
- Not covered: the rx_error paths (no way to make the virtual device
report a receive error), and VLAN tags other than 0, which the test
switch does not pass.
Changes in v2:
- New patch 1, and the rx_error double count fix in patch 4, after an
automated review of v1 (Sashiko).
- New patch 2: v1 patch 2 made the attach failure path in
vmxnet3_xdp_set() reachable with a stale program pointer.
- New patch 3: v1 left the MTU 3051..VMXNET3_XDP_MAX_MTU range as a
known limit; it is now refused.
- Patch 4 no longer counts the dropped frame against the NAPI budget:
in mainline other non-PASS XDP verdicts are not counted either, so
the v1 comment claiming so was wrong.
- Patch 4: fixed a line over 80 columns.
- Cc the networking, XDP and BPF maintainers and the author of the
blamed commit, as get_maintainer.pl lists them.
- v1: https://lore.kernel.org/netdev/20261122002847.616-1-filzador@gmail.com/
The problems were found and analysed, and the patches drafted, with
the help of an AI coding assistant; reproduction and testing were run
on the reporter's lab systems.
Philipp Sudakas (5):
vmxnet3: clear rx_ctx.skb after a data ring XDP verdict
vmxnet3: keep the previous XDP program when attaching fails
vmxnet3: limit the XDP MTU to the rx head buffer size
vmxnet3: drop XDP frames that do not fit in one rx buffer
vmxnet3: keep the XDP program across device resets
drivers/net/vmxnet3/vmxnet3_drv.c | 27 +++++++++++++++++++++++++--
drivers/net/vmxnet3/vmxnet3_xdp.c | 22 +++++++++++++++++-----
drivers/net/vmxnet3/vmxnet3_xdp.h | 10 ++++++++--
3 files changed, 50 insertions(+), 9 deletions(-)
--
2.47.3
Technical Details
Message-ID:
<20261123124855.1021-1-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-369358-linux-kernel-netdev=dewy.ruShow 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-369358-linux-kernel-netdev=dewy.ru
From: filzador@gmail.com (Philipp Sudakas)
Newsgroups: linux.kernel.netdev
Subject: [PATCH net v2 0/5] vmxnet3: fix native XDP crash on oversized frames and XDP loss on reset
Date: Mon, 23 Nov 2026 15:48:50 +0300
Organization: Usenet Network
Message-ID: <20261123124855.1021-1-filzador@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
logging-data="3879252"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:QnjXVM0uU5IDmdhzQu7/alj68TI= sha256:9cgAkXPCduDsk5nv1MWJi4oN81hufRq5sO9I2JL4DEI=
sha1:SmCXGGV0Qlj7L5cAsgHAn07kELU= sha256:oinnb7J/Igg2ftr6pL92ZzMJAVaceugdJr+9DG476FA=
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 B3560125DB1; Mon, 23 Nov 2026 15:49:24 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.049
X-Spam-Status: No, score=-3.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, 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 v-w7jiyzuhDQ;
Mon, 23 Nov 2026 15:49:20 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-369358-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 8CFDA125DB0; Mon, 23 Nov 2026 15:49:12 +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 88206332B5; Mon, 23 Nov 2026 12:49:08 +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=1795438147;
b=YTET5GbY9CCHWoeJCMsWq7vMs0GF6rfBBqdDZcXjRzhxZRILnbCLr1F+D5YJzwWHatOT
vy70JryiDhTK9uXO/sUHFJKfcgtNHMHbCAGoODuAEcBA/RuY7QWQxa4VA3Rt9ItdnXviS
3Vy9CBpAycGc6PIhNZx28Ko1wJiYyLbHJYGm25SMcCa2bPRa7k9MUVv0REB6EqCf+twfe
1l712G1Z0ajOWa3zVQa8IHA+DmxhiUssceFm1exSA7SRz/dzfIVUxcX1goWHDuV3RdDL+
vT9fZRMcyQgHBPIVcMkYBIVobyF+44IwJowx/rV0MVn9WWYgEPSjX1LlhMd5bUQ2/7g==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
a=rsa-sha256; c=relaxed/relaxed; t=1795438147;
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:X-Mailing-List:
List-Id:List-Post:List-Help:List-Subscribe:List-Unsubscribe:
List-Owner:Precedence:MIME-Version:Content-Transfer-Encoding;
bh=DhK6CtMOLYZCVdUuss7wafvSK3dtx+GbAoe1f/T7oT8=;
b=sFLMVqm9QaFOjgVeiwXnYwbgkWi/q0EoSOPBI2roJk7A53t/zQ9fLAgyCHBmDNuZZf3V
g29YASgVFRfb558j8szwuODZSXGZrO89GHBDapuweBEatC7PiDkwidG5w7oxCOMmmGNSF
grbyanjr0bJ6IOr8o9xy3kVN+2AT/TaZKMxw1ZMEulKN2xUgkLZfSPJhYHji3w4nzOpS5
j1P3WVLf+NKqwEbP0bjmCU/P6gPTVL9oNp6VijWSKg0gDEMz2gP/+UBmAlPMGM3sV2wNx
wIhDw4pPIIvi6Bubgdm11Cg0dvwMtLhM5h3VoJoAWWJ2edE9b/9lS7aNcmudsOztD3A==
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=hsFF5YSQ;
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 0BCBB606A32C;
Mon, 23 Nov 2026 12:49:07 +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=hsFF5YSQ
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.128.42
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
t=1795438146;
b=VU/PCiOB3O4q3WmIN1Kto4LBUc9G0oCsnPyVIyFk8yU64udNltYn4zAsDXYCvScXZNuN
Y6hm4W3GmvEuLJVUhtzUX895Pt2SC++8Pu/7l26bFd191GKV/Cuy9TkIyA87jOL8LXR5A
+vWcECCwYlNlCPiX09dX4kYrhxQe5q1qvEQ8mR5W5y43r4wq27tWWyja1Gv/Dnp7XzvjQ
87Tpfh5hb6TCdoXqTqb1cmoASaDiBGnwoMexX3ENvLqxHVhsNi/hGsA7NrwwHK1LyiVrA
DebocwXE5T7TnYAtsNJgdtc+l74CJSFJUl4KU0ZaNUVtemxmkrcEcooV4xjpxrhS5qQ==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
a=rsa-sha256; c=relaxed/relaxed; t=1795438146;
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:MIME-Version:Content-Transfer-Encoding;
bh=DhK6CtMOLYZCVdUuss7wafvSK3dtx+GbAoe1f/T7oT8=;
b=YxB8kolMfzscHVekmaF8OCvlbV6b6BcXm4Q5PgTJ1JKKYM7ZoQty7fQnPxrTI3kC9FLx
dWLaSnVDaTgw56tbf/5oGPC+S/bGWB0pcYaAZm/vNrhghFbg+6un33ZLiQit/smo4nDMK
cafMe/PD/Mb8dp8m6AiwiOCIFnVRjYT2DcziDrXb3hxhSfN3uJQumf6Sh7tyFrl6KvIDY
IBTJoe/DfQRFMym+goYOwg/wy7VanIRQCAK/tOnFRBs0pNYthzbLv0TLYC+Yw25pYxkGF
ANgzWYF0Y6wEjyoclIr676hij2h8QINAacvblGinZAwzysOmJDvolp+vZmvCm2cZzVA==
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=hsFF5YSQ;
arc=none smtp.remote-ip=209.85.128.42
X-Received: from mail-wm1-f42.google.com (mail-wm1-f42.google.com [209.85.128.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 4232F606A31F
for <netdev@vger.kernel.org>; Mon, 23 Nov 2026 12:49:05 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 4232F606A31F
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-wm1-f42.google.com with SMTP id 5b1f17b1804b1-4a207b02a2cso23050395e9.1
for <netdev@vger.kernel.org>; Mon, 23 Nov 2026 04:49:04 -0800 (PST)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=gmail.com; s=20260707; t=1795438143; x=1796042943; darn=vger.kernel.org;
h=content-transfer-encoding:mime-version:message-id:date:subject:cc
:to:from:from:to:cc:subject:date:message-id:reply-to:content-type;
bh=DhK6CtMOLYZCVdUuss7wafvSK3dtx+GbAoe1f/T7oT8=;
b=hsFF5YSQpULfJ7UU3yf6gePPrgLzGPpQGEr9byySTcmMiZzNMUd5KQzuLtfMjRsSSq
r/r4niBQPj2bPpnzW+fzmJkXDr8egb6JTq4pQ6o10q6NVz2odjdWWXX9AfLqTCUh9XTn
1pfLoCDYjggp+DV/iAPRim4+9tKaQr3oOefVKTi3aBv6GxrO+J+sUteCKyYlkZFUqHKJ
ewfrYdy8jNRy6SweMe760ZkOSF1rCZcUVjZnlgRQihnTABbeNtPpOAXIB5WwRSiPr+Wn
Oy/so54F0sovqvmwz7pV+EGEsgQ46OypTUm6SphaM7pFCO+oOFKpe1mLM9YTtaT1sJlJ
SiNQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20260707; t=1795438143; x=1796042943;
h=content-transfer-encoding:mime-version:message-id:date:subject:cc
:to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
:message-id:reply-to:content-type;
bh=DhK6CtMOLYZCVdUuss7wafvSK3dtx+GbAoe1f/T7oT8=;
b=HQNfK9W5ijJTZlv1eqmk1mHOYPo45VZ4WcK6fVW3Vg08ZEpHNkw+/glrOGpKqryMxA
eYKsaKuB2lv4AkK/rekuI/hCVzlPPlEyh6PcprBPDOqWAPnMLRKoZMV5s/p8p2SLbCpM
XIl3DQmsmWTp6FNXLPQ57b4RlquSuBuQ/P1MDBWTrGeMD7rKBi4Jgs1YlrSPLnLzJu1s
G31hk9IHlSPrTrUPNNS86HBipH1yig02ZKgtNEiaQ79+N8iVi+pno6I11uftJaiLHx2Y
Xjn0uerwALTA14NiQ2SNamif2pGG2RStA/3xQ4Tp6VDxStUk+K+tBYpLZpd/3NS2Qi5/
4J3w==
X-Gm-Message-State: APuU4Z/OGbnqAWse067bcyWBMK5qajL3T5aIViD/aEZBwNtwtqtjYHtZ
DFR9auNlH7tJ+z6eypDeIgMQXcWZaX4nK/CCtEp1c41fXZAsA388Lcxt
X-Gm-Gg: AZFdTZdeMXOYxHxwz93qQbtqAQ/77NDJNjStK43cNTkqCWd3Qc6WWATyl6V/ORpGaak
K7jRLJzH/a+SSgFDpVy3wE+mO1kKa4nKkQQrCzJ9AFqfMC1xtwtCcbbmZ3enpShg7yKS4lvrtLp
tGX7kRIOmSgJ2x5GygiaxyXOgW5o7RiDj9Z1HZAjZnD3DBbfNHrGYBIq1hgEbtKqfhzJzGPYbgu
/gQYEjSD71drwdccVhRcbMBenuwZezDZDLdqGO+2EI2Ygk65EUbGxnRbrfu54yV9GzK/IC/LH2v
M/CWBs9dJefcMJ7d+LWx4Kr46h31Y4DEWXa9iNAaF754OPPmjDpVzCbYxPcJqFE0YIC2StPSXL4
Ikhffz5LEs4VPDF3yycPRQgZi1lafKPRqJfh3pK6i8L0HNS9Vkt8+YQFm0rEE0hMR68F67wYBM8
2Sna7kjfPYofAaOB4szabwxizVkm9BNFYgbzjd2oPNx2Xh36IID7flwcTtBeVWnaG9OEobVN7U6
D5B379owMBwUckZ9/2kFgnnHRAMs437cWXg6dfp4ho3rSgUn1fmItLNxWiPKaiHx/pki3NTLqQd
FBuA5WVjSNr25GhSs5GOcjNOMMeIz+nOEN2F8z7O
X-Received: by 2002:a05:600c:154e:b0:4a3:59ee:86b with SMTP id 5b1f17b1804b1-4bb887c3b63mr248348265e9.4.1795438143282;
Mon, 23 Nov 2026 04:49:03 -0800 (PST)
X-Received: from Philipp-PC ([91.227.186.127])
by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4bb906817ccsm165097045e9.5.2026.11.23.04.49.00
(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
Mon, 23 Nov 2026 04:49:02 -0800 (PST)
X-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>
X-Mailer: git-send-email 2.56.0.windows.4
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