Article View: linux.kernel.netdev
Article #20140[PATCH net v4 2/5] net: wwan: iosm: validate the ADGH datagram length
From: Fang Xieyan
Date: Sat, 21 Nov 2026 14:18
Date: Sat, 21 Nov 2026 14:18
41 lines
10074 bytes
10074 bytes
ipc_mux_dl_adgh_decode() takes adgh->length from the device and hands
adgh_len - packet_offset to the network stack as the payload size of
the cloned skb, without bounding adgh_len. A length below the header
plus its negotiated padding wraps the subtraction, skb_trim() keeps
the clone unchanged and the stack gets the whole rest of the block. A
length equal to packet_offset yields a zero length clone that
ipc_wwan_receive() still reads skb->data[0] from.
Require the datagram length to exceed packet_offset and to fit into
skb->len, and drop the block otherwise.
Fixes: c34ca4f32c24 ("net: wwan: iosm: fix incorrect skb length")
Cc: stable@vger.kernel.org
Signed-off-by: Fang Xieyan <fangxy@xiaopeng.com>
---
drivers/net/wwan/iosm/iosm_ipc_mux_codec.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/drivers/net/wwan/iosm/iosm_ipc_mux_codec.c b/drivers/net/wwan/iosm/iosm_ipc_mux_codec.c
index 5c33171ca701..65421f6b4c91 100644
--- a/drivers/net/wwan/iosm/iosm_ipc_mux_codec.c
+++ b/drivers/net/wwan/iosm/iosm_ipc_mux_codec.c
@@ -473,6 +473,15 @@ static void ipc_mux_dl_adgh_decode(struct iosm_mux *ipc_mux,
if_id += ipc_mux->wwan_q_offset;
adgh_len = le16_to_cpu(adgh->length);
+ /* The device supplied length bounds the datagram. It has to
+ * exceed packet_offset and fit into the received block.
+ */
+ if (adgh_len <= packet_offset || adgh_len > skb->len) {
+ dev_err(ipc_mux->dev, "invalid ADGH length %u, skb len %u",
+ adgh_len, skb->len);
+ return;
+ }
+
/* Pass the packet to the netif layer */
rc = ipc_mux_net_receive(ipc_mux, if_id, wwan, packet_offset,
adgh->service_class, skb,
--
2.50.1
Technical Details
Message-ID:
<20261121141850.73754-3-fangxy@xiaopeng.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-368345-linux-kernel-netdev=dewy.ruReferences:
<20261121141850.73754-1-fangxy@xiaopeng.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-368345-linux-kernel-netdev=dewy.ru
From: fangxy@xiaopeng.com (Fang Xieyan)
Newsgroups: linux.kernel.netdev
Subject: [PATCH net v4 2/5] net: wwan: iosm: validate the ADGH datagram length
Date: Sat, 21 Nov 2026 22:18:47 +0800
Organization: Usenet Network
Message-ID: <20261121141850.73754-3-fangxy@xiaopeng.com>
References: <20261121141850.73754-1-fangxy@xiaopeng.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
logging-data="3422928"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:5kV8UzpXUCGiFqUS4k1xSeQPGZg= sha256:Tx5421akBFPHr4zfyomitcUwAiAyZGgKqWT7+Z/cAyM=
sha1:qDu2qrB/EtmvOiSacfhybr/Ik00= sha256:qGMwLwxd6CHPWK/Wfky6SjuiMVN7Zt0aVQKuGzZrvC8=
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 552C5115B74; Sat, 21 Nov 2026 17:20:13 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.05
X-Spam-Status: No, score=-3.05 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, 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, UNPARSEABLE_RELAY=0.001]
autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (1024-bit key)
header.d=xiaopeng.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 f5WAvVX1QPJD;
Sat, 21 Nov 2026 17:20:10 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-368345-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN>
X-Authentication-Results: OpenDMARC; dmarc=none (p=none dis=none) header.from=xiaopeng.com
X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
by mail.dewy.ru (Postfix) with ESMTPS id 3B48D115B72; Sat, 21 Nov 2026 17:20: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 187A3482F6; Sat, 21 Nov 2026 14:19:38 +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=1795270770;
b=JRoWE9cTPX92EuZv28eIBzybJZdm2v5cN+0sIJECMaSz+VUVAiwGT0KdU0IQT4K7wtPp
mz6XboESLQNDZF6Q4Y3iNqkv8s2ExNVlQuSbjp7dfUZft2EanA8x8Kd7bsxmSrcQ8FTxW
ttkcuAbK1Tm+VRd5ayiUFes4TXXmhWLBPxuQ3rL5PoZ2ixXdOdargqjg5jaY3R5QG77RR
3mz6vETxkHEU2DCwGgVUuIBwLuoLLvz48GFn2b6/7sPLtPspeIp5k/b5PG/rwaHXPFG65
MncbNT8maJwi2BB00VByKy6QZj8CiyKIBoCDvLnVK9AZc9LnmkntFafMklazrVewi/w==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
a=rsa-sha256; c=relaxed/relaxed; t=1795270770;
h=X-Original-To:Received:DMARC-Filter:DKIM-Signature:
X-Alimail-AntiSpam: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=AyZSPZSAoyu0XMTrk6TSL45fPCkVoxP9QhoH2Zd6Zfo=;
b=f3BrCrTfHg3rpwQxT+hFcEwc9FBssaMErTjkRMgQo2u+1TzynO+aujQSaDM0f3Rj5k43
mguva26BOhngpMQIUpKFIbqIiyJ2uQnHxeeznyZu/iY0smcbPn3eZG9NY5VNISFq3Z+ns
EeSGXloNzXVMiI+nTa4fK+Qc2h7PNqWnPEjT1HWy8OUaTUgmVSuzHg4kTCKS0+uj6oWEI
zxHcha4iaCTk3faIFqIEFDsEoHINaYCdwY/JAN7d9gc78Yvx93p7ZLQgxD/5b6JGqQOnG
O8UUaIO5N9rkCq0nqgEZT1azKh5dwp51sd0DmEzxdfKU7/Zo0wj7iZnGMKK41PGRnZg==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org;
dkim=pass header.d=xiaopeng.com header.i=@xiaopeng.com header.a=rsa-sha256 header.s=default header.b="pjsVH/iO";
dmarc=none header.from=xiaopeng.com;
spf=pass smtp.mailfrom=xiaopeng.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 B923B606A6BE;
Sat, 21 Nov 2026 14:19:30 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
dkim=pass (1024-bit key) header.d=xiaopeng.com header.i=@xiaopeng.com header.a=rsa-sha256 header.s=default header.b=pjsVH/iO
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=115.124.28.4
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
t=1795270759;
b=yz/oLldPKPdPF4wGVoKcyYMOfmqw+xBExy+3F9EfVAtd9hDZ9MwUf/4vm3PpYpNjPxNu
devJWnLFtPr5WVTwVofTcbcfqzdt8dzJxDLzXur8XbcGaRN3cqMNpHqz+B5Z20QReuNiB
z0reMOxfSZgQIia6ZfviCG1M+xmXYMCYDpggjy0PLitG/viwWDY5jlg4JqZ5X7zut4uDx
mGItkM2Im2fDs3gepfGUBK4EbHmdoPckRJB56sW+QpcIAPCh1UFGgbFmkGMhYrvuH9OUS
2itUKV+1huMFbO+HlRdMyozVjFhS2iCI42RC+zm3vNsiPh2bK3UIN7khq3E9t4kweDg==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
a=rsa-sha256; c=relaxed/relaxed; t=1795270759;
h=DMARC-Filter:DKIM-Signature:X-Alimail-AntiSpam:Received:From:To:Cc:
Subject:Date:Message-ID:X-Mailer:In-Reply-To:References:MIME-Version:
Content-Transfer-Encoding;
bh=AyZSPZSAoyu0XMTrk6TSL45fPCkVoxP9QhoH2Zd6Zfo=;
b=gw7waEgrd2Ay0hPjpEElJQxUMBLlCo22lfrIbBhhFsEdGTNuwEgfcgY5L2RTmptotRDM
N84s+irUU353LuXIPbCY3rBpcgnQgGuaWeuoFvTjlpchlSJxZka+LHOcgp5yYJtRiERoA
ZpUZViF2VpgHOPBxU94lPgrZyn4az8uhrJ4IrPSDEGuDNMglQRV6NmGoycsJW77PJmT6Q
Sb+mOhQsFcGzgQDeGqgpIR1ag/DEVs/OfzXyXpIoZdCBqq/8OdJZqRdYzj0W5SW9U+Wpd
3OTRM9f/+1Of1LgEJBb24OJbv+LrImeOh6WaN2JJoSq0AOaZIhT6XfJENyWGZ5Ti/oQ==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org;
dmarc=none header.from=xiaopeng.com;
spf=pass smtp.mailfrom=xiaopeng.com;
dkim=pass header.d=xiaopeng.com header.i=@xiaopeng.com header.a=rsa-sha256 header.s=default header.b="pjsVH/iO";
arc=none smtp.remote-ip=115.124.28.4
X-Received: from out28-4.mail.aliyun.com (out28-4.mail.aliyun.com [115.124.28.4])
(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256)
(No client certificate requested)
by smtp.subspace.kernel.org (Postfix) with ESMTPS id D6022606A32C;
Sat, 21 Nov 2026 14:19:17 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org D6022606A32C
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=xiaopeng.com
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=xiaopeng.com
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=xiaopeng.com; s=default;
t=1795270749; h=From:To:Subject:Date:Message-ID:MIME-Version;
bh=AyZSPZSAoyu0XMTrk6TSL45fPCkVoxP9QhoH2Zd6Zfo=;
b=pjsVH/iOOVfb8Wqp7YXvv9oVrYDkuf72Nv+t7GFzg67WHcZF79UFvZn6/ZR12+1Vi8TV3dBpu5hKYx5YnfAsWo/VAcIR+LKSpunWuV2hih7L7UaVfShxda2t48mduQZ+4uQnIJYW6yMwxsCSqjkKyl5KD76fuMw+u1QTrqa+lhk=
X-Alimail-AntiSpam: AC=CONTINUE;BC=0.05731619|-1;CH=green;DM=|CONTINUE|false|;DS=CONTINUE|ham_system_inform|0.00349499-0.00128547-0.99522;FP=11260164001253854944|0|0|0|0|-1|-1|-1;HT=maildocker-contentspam033040092104;MF=fangxy@xiaopeng.com;NM=1;PH=DS;RN=14;RT=14;SR=0;TI=SMTPD_---.k7GCEYM_1795270746;
X-Received: from localhost.localdomain(mailfrom:fangxy@xiaopeng.com fp:SMTPD_---.k7GCEYM_1795270746 cluster:ay29)
by smtp.aliyun-inc.com;
Sat, 21 Nov 2026 22:19:09 +0800
X-Cc: davem@davemloft.net,
edumazet@kernel.org,
kuba@kernel.org,
pabeni@redhat.com,
andrew+netdev@lunn.ch,
horms@kernel.org,
johannes@sipsolutions.net,
maoyixie.tju@gmail.com,
zhugl3@xiaopeng.com,
linux-kernel@vger.kernel.org,
stable@vger.kernel.org
X-Mailer: git-send-email 2.50.1
X-In-Reply-To: <20261121141850.73754-1-fangxy@xiaopeng.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