Article View: linux.kernel.netdev
Article #25998[PATCH net v5 10/10] net: au1000: reject frames larger than the TX bounce buffer
From: Florian Fainelli
Date: Wed, 02 Dec 2026 22:49
Date: Wed, 02 Dec 2026 22:49
50 lines
13408 bytes
13408 bytes
au1000_tx() copies skb->len bytes into a MAX_BUF_SIZE coherent buffer
without checking the length. The copy can corrupt neighboring DMA
buffers or run beyond the coherent allocation.
AF_PACKET with PACKET_VNET_HDR can deliver oversized frames through
both plain sendmsg() and PACKET_TX_RING. In packet_snd(), a nonzero
virtio GSO type bypasses the MTU checks, even when the supplied gso_size
is large enough that virtio_net_hdr_to_skb() leaves the skb non-GSO.
Genuine GSO packets can also reach the driver as oversized frames:
au1000 has no TSO, and software segmentation using a user-supplied
gso_size can produce segments larger than MAX_BUF_SIZE.
Drop oversized packets before touching the ring or copying any data,
and account them in tx_dropped. Use an IRQ-safe skb free for netpoll.
Identified by Sashiko AI review; implementation and validation assisted
by OpenAI Codex. An extracted-function harness passed ASan/UBSan checks
for 2049- and 4096-byte drops and a 2048-byte accepted frame, as well as
TX ring regression cases. MIPS driver compilation and checkpatch passed.
Sashiko AI review identified the additional sendmsg and GSO routes;
OpenAI Codex assisted source-path verification and message revision.
The complete AF_PACKET triggers and hardware operation were not tested.
Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Reviewed-by: Simon Horman <horms@kernel.org>
---
drivers/net/ethernet/amd/au1000_eth.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/net/ethernet/amd/au1000_eth.c b/drivers/net/ethernet/amd/au1000_eth.c
index 5bfafe52020f..2a15cd1f5655 100644
--- a/drivers/net/ethernet/amd/au1000_eth.c
+++ b/drivers/net/ethernet/amd/au1000_eth.c
@@ -1100,6 +1100,12 @@ static netdev_tx_t au1000_tx(struct sk_buff *skb, struct net_device *dev)
int i;
unsigned long flags;
+ if (unlikely(skb->len > MAX_BUF_SIZE)) {
+ dev->stats.tx_dropped++;
+ dev_kfree_skb_any(skb);
+ return NETDEV_TX_OK;
+ }
+
netif_dbg(aup, tx_queued, dev, "tx: aup %x len=%d, data=%p, head %d\n",
(unsigned)aup, skb->len,
skb->data, aup->tx_head);
--
2.53.0
Technical Details
Message-ID:
<20261202224957.3043478-11-f.fainelli@gmail.com>Path:
mbox-mo1.pugleaf.net!srv.newsdeef.eu.MISMATCH!feed-us-txt.newsdeef.eu!feed-us-ny.newsdeef.eu!srv.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-376093-linux-kernel-netdev=dewy.ruReferences:
<20261202224957.3043478-1-f.fainelli@gmail.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu.MISMATCH!feed-us-txt.newsdeef.eu!feed-us-ny.newsdeef.eu!srv.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-376093-linux-kernel-netdev=dewy.ru
From: f.fainelli@gmail.com (Florian Fainelli)
Newsgroups: linux.kernel.netdev
Subject: [PATCH net v5 10/10] net: au1000: reject frames larger than the TX bounce buffer
Date: Wed, 2 Dec 2026 14:49:57 -0800
Organization: Usenet Network
Message-ID: <20261202224957.3043478-11-f.fainelli@gmail.com>
References: <20261202224957.3043478-1-f.fainelli@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
logging-data="2080414"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:fAbIZ78lbK9a1IEH2jFHZHxIHcE= sha256:R7Kf1N/CLQqBi4LOX68MZ0+kGqzQR8CX+Pw41+EgYtI=
sha1:tFWra7EfqcTdlMxuGhSnMZ4cZ3k= sha256:20xoZxsj7zaoaADwaXhMWCYfCn1KSDbWezkiZdjLcmc=
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 DBF3011776A; Thu, 3 Dec 2026 01:51:10 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.149
X-Spam-Status: No, score=-3.149 tagged_above=-9999 required=6.31
tests=[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 ru2eoLnNvtI2;
Thu, 3 Dec 2026 01:51:08 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.232.135.74; helo=sto.lore.kernel.org; envelope-from=netdev+bounces-376093-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 sto.lore.kernel.org (sto.lore.kernel.org [172.232.135.74])
by mail.dewy.ru (Postfix) with ESMTPS id 0903911771C; Thu, 3 Dec 2026 01:51:00 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
by sto.lore.kernel.org (Postfix) with ESMTP id 98F6F603289; Wed, 2 Dec 2026 22:50:59 +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=1796251824;
b=xYv2NtmyefFwp1glqV2x87y4ckALqIeJdf/Cjlv0n3f/ahxAtcGMx09IKv/hof4qiBud
GLtO6tZFnuT0yWzn8XC9v4UwasjscFU5zhXGdJ4w0mvKdhHoGzLyeW+rBipmroXtaeOhd
MuGy88Ba0QFBxDF8p61Aam8pJcosryCegB3XfXmpVKofhDXFWV0VrBCZ7QD1Ja2UbqAFb
1+E08Nllr5kgNDgM8lh2zk8d8TRkmo8NQraiLRRZYEUhQip88YWXJwjH9j40F65HAiYLA
/2dqQzgpVyi5e0F7Gbf12pVUqtqsa9EIU0LenK1LOkvQAVcdUKOzqCPyeSOvs4BnMwg==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
a=rsa-sha256; c=relaxed/relaxed; t=1796251824;
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=qJthQ+m5bhHpn00VKmp6Rp9mUjvxiqW3g+n9rTwQvH4=;
b=NOlkSoe/eKnfU5HQRMDkb6NN7zB6dhOUD70CBVhESnA/GRi+eik2hzOFtCxzMgDXQm/U
dXSAxZDRUibdgUkxx7KGExALeNocjYovr5B/Q1vaeqViHJ7LgLqmw3qkcjADTPZLwRUXI
ic0Jl8qf0rBdNb/WD6U1Bpqu9/UGCJu2IHsnq+DYQ/lMb9qczvrRMU1FI4xee7sLwCOU0
bcyv43WlI+oqgc2uUJfWS2E7kgOcyVcNhHNQ6Ndwgls25PU5KHNys7mNOiyGzmCAmhYE5
mR9yOfPi+Ia825UghuSTdMuTw5Pg6t/+7ui5B9dw8pd2OBkb0GchOf6nPWoD4zPHgNA==
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=BnXbgJMN;
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 39163606A6AD;
Wed, 2 Dec 2026 22:50:24 +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=BnXbgJMN
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=74.125.82.43
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
t=1796251823;
b=Xf1rfHigkP2GTAq5GapD28qARyIgid5dUo3Xs8qKMkGQiiVRVt0pogvRPfyY4JVcg8/o
JyFBWv107k6NGGIoV6Fab4V8gkYWzmAs1nWiC4dHahvSRphEnDKEdC7v0RxY+1SfBQ+x1
5SX3QqIjsz3VrGiMmviyKsHUxF/+wVJ7xO5tLWtrcuxWfy0gELlo4+CEP8s7XLUk/FFFy
mfwGE7tzlNnvwlX0UI/0K5guOc7pQghIipzexiHqnnYIjpFGvmtfl5UothJyuOrdS5CYC
6nh2m2urfpouvTEsWwClcTRe9OsrD5d/VV0sCC4A018NsjHaR1EAcAGhExIb9JXXdHw==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
a=rsa-sha256; c=relaxed/relaxed; t=1796251823;
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=qJthQ+m5bhHpn00VKmp6Rp9mUjvxiqW3g+n9rTwQvH4=;
b=1E81KhATVcQeyWpp6oWjHwNx9eE6jJCHbeLfxNuwN7jQ5DLclooqq49VO6cDJ2HwZKPl
maZDG7thLtKI3MJRac3ZdtuZJ43zlTWBMeaLSqD5yfNJFJ6WgZQ080AAMoi4+GR3At1gF
Uc3U9uWXLKtSHarThdQzZqZhP9yjo+MQ4PVAuDueuiDuV/BrBs9c16QkmI6uNC5FVFJUQ
p8H1/QDOcdb1nkN/OCRyBOzWYcZ0UAGLgjW99oGUny6FASEo9VnZwFHqEoGUPdZheGU3O
84nSwgRSb0iPA8Y7h027By2AR/0ebbKgs3IU5PRgLeDm4bGUDVBjMMySAfR8GcN12/A==
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=BnXbgJMN;
arc=none smtp.remote-ip=74.125.82.43
X-Received: from mail-dl1-f43.google.com (mail-dl1-f43.google.com [74.125.82.43])
(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 0776D60A382B
for <netdev@vger.kernel.org>; Wed, 2 Dec 2026 22:50:22 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 0776D60A382B
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-dl1-f43.google.com with SMTP id a92af1059eb24-1b5adf7eacdso3439770c88.1
for <netdev@vger.kernel.org>; Wed, 02 Dec 2026 14:50:22 -0800 (PST)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=gmail.com; s=20260707; t=1796251822; x=1796856622; 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=qJthQ+m5bhHpn00VKmp6Rp9mUjvxiqW3g+n9rTwQvH4=;
b=BnXbgJMNPsLVeGk4MgyLGKuR0bsYWZDm7Rx9AxMAXC3z/shlvqJ4EoI266QuBHD4cn
5yJnBvk0/+WLaEKBh9KkB0q5N4FCnwaYxb9gPAIB42LeK1CNAvpqP/8emIbXvsrIefuz
yF2T9t77TtQnbihjj08SQsSR7feD6rZfA3ClZGsoDd7O1ntX7To1OfnUEF5ZyUQl5oZ8
Raoczwnx8oL27wCZ/c/eXNRLQMjiOS09D140gFvujLGwG5nGQf2Z8gLBgesmsyl6ovIa
RBE0M5qwpBjdmOAYr+O6dpasi7FCuW13uaI/oACZa42v5AewNj/k5ALNBTsh6Vi3ZD9q
ysOw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20260707; t=1796251822; x=1796856622;
h=content-transfer-encoding:mime-version:references:in-reply-to
: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=qJthQ+m5bhHpn00VKmp6Rp9mUjvxiqW3g+n9rTwQvH4=;
b=wM6CZ3pb27HVjN4h79fwAoFb2GoW4apJ+mCnIrkMiaXDe3fA3JA5JogXJK9ZVF4Cs7
TXbH/PiudcrobN4xsVmvA8WwnZQy8JzkDXkhfzmjs6XAEVL3pbAKTWSqfbYl1AMn/El0
g4nKnxQ8L4UT7UchQVEQ/yw2qxtlMogQ4Y2HrnWMyF7FKsWybPxfkHRCQZvFFH1qz9G8
XuIs2pvth2iPH5JWz9HDU/uvIspH01goLwGOB46bVLW7rKNOxGLbndD0JO0YLInznW3I
Idnwlr+DeR8awFtI9S2MLWL0oiYTd0lHXkBWEIwGDp6RYPXd6eNthLtoSqJ7PO8FX9Ne
7w8Q==
X-Gm-Message-State: APuU4Z/9H2s4EbkEkGz0TJ/bjaahxofsMsHhDXY4Gs//qelk13XuHt31
Ic0+ofEChkWZr4VIjxxVhEsTVDtnMinbogI/U9gzYXSXDwn/oYSzon//gTm/yA==
X-Gm-Gg: AZFdTZdYV/FQsljt8y1tJ+QLykvY2xqCqdbhNXC8GoIh+AeMDEhxLRjBa4+z1pMNTrx
2nK7Gb8atLlfJrmAZAC15FARBlC8sED6W4Tk+arR6QRHBxo94Yb0uJzKZ2v3TQ8kmmUAiln62if
jFNF/M6mFHCQSI8QARoVvwJdSWAqKQ+7pOsJDpGf0CM+bae78VI29NXk2iXS7jYRgDbPUTo4/Cb
cSYMkzItt8kzUZdnZCjxzgawrDP/CLuqhue11+VUnj/8JBYB5eLmqvLBEvLDPSTykKair9ky4E7
ZpxUD6uVYSizNcizOKfZQKAMZlrh4OQin3Ho5Wt35Vq5/qyVQW8avl09nIGA5NfjHg4QvddfhH5
ds6BGuJnWyegyzyNdTJ8mG1wpHN4jwez4hzlnjUbaX2fjJlyck4l6110zmT1FV+GnCnzktckga2
BF4MZdDLzX3MtH74xszZWL/vPGgTQXVpYKOu04oSj/8aE8mMuopk5lGfyOlwDcNr66Xi9Bk6Fer
Z6EzH5NKLFNdOfcnPP0k3ktUoCFRG3fYmcaqfVFa/oYiLNQksmL7yoi3jgmwagSSNIZD4/8FgY2
s56WAiFCI/3aFkNKf+HpGZw3P3Ry
X-Received: by 2002:a05:7022:1587:b0:168:3243:c911 with SMTP id a92af1059eb24-1b556903a3bmr50402920c88.37.1796251822188;
Wed, 02 Dec 2026 14:50:22 -0800 (PST)
X-Received: from eldorado ([2600:8802:b00:1f88:d294:66ff:fe95:a98e])
by smtp.gmail.com with ESMTPSA id a92af1059eb24-1b55684c85fsm151770048c88.14.2026.12.02.14.50.20
(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
Wed, 02 Dec 2026 14:50:21 -0800 (PST)
X-Cc: Florian Fainelli <f.fainelli@gmail.com>,
Simon Horman <horms@kernel.org>,
Andrew Lunn <andrew+netdev@lunn.ch>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@kernel.org>,
Jakub Kicinski <kuba@kernel.org>,
Paolo Abeni <pabeni@redhat.com>,
Heiner Kallweit <hkallweit1@gmail.com>,
Russell King <linux@armlinux.org.uk>,
Jijie Shao <shaojijie@huawei.com>,
Runyu Xiao <runyu.xiao@seu.edu.cn>,
David Yang <mmyangfl@gmail.com>,
Herbert Valerio Riedel <hvr@gnu.org>,
Danny Kukawka <danny.kukawka@bisect.de>,
Mugunthan V N <mugunthanvnm@ti.com>,
Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>,
linux-kernel@vger.kernel.org (open list),
Manuel Lauss <manuel.lauss@gmail.com>
X-Mailer: git-send-email 2.53.0
X-In-Reply-To: <20261202224957.3043478-1-f.fainelli@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