Article View: linux.kernel.netdev
Article #5416[PATCH] net: wwan: iosm: fix NULL skb deref in ul_td_process
From: liuc63
Date: Tue, 20 Oct 2026 10:11
Date: Tue, 20 Oct 2026 10:11
39 lines
9708 bytes
9708 bytes
From: Liu Chao <liuc63@xiaopeng.com>
ipc_protocol_ul_td_process() fetches the skb for the current tail
entry and then dereferences IPC_CB(skb) when comparing the TD buffer
address against the skb DMA mapping. If the skb slot is NULL (e.g.
the entry was never populated or was already consumed), this results
in a NULL pointer dereference.
Validate skb before dereferencing it, mirroring the existing check on
p_td->buffer.address. Return NULL and log the error when the skb is
missing so the caller can handle the malformed descriptor.
Fixes: 64516f633bfd ("net: iosm: protocol operations")
Cc: stable@vger.kernel.org
Reviewed-by: Guanglei Zhu <zhugl3@xiaopeng.com>
Signed-off-by: Liu Chao <liuc63@xiaopeng.com>
---
drivers/net/wwan/iosm/iosm_ipc_protocol_ops.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/net/wwan/iosm/iosm_ipc_protocol_ops.c b/drivers/net/wwan/iosm/iosm_ipc_protocol_ops.c
index f2f86f41fd10..dee2e6607f77 100644
--- a/drivers/net/wwan/iosm/iosm_ipc_protocol_ops.c
+++ b/drivers/net/wwan/iosm/iosm_ipc_protocol_ops.c
@@ -302,6 +302,11 @@ struct sk_buff *ipc_protocol_ul_td_process(struct iosm_protocol *ipc_protocol,
if (pipe->old_tail >= pipe->nr_of_entries)
pipe->old_tail = 0;
+ if (!skb) {
+ dev_err(ipc_protocol->dev, "skb is null");
+ return NULL;
+ }
+
if (!p_td->buffer.address) {
dev_err(ipc_protocol->dev, "Td buffer address is NULL");
return NULL;
--
2.50.1
Technical Details
Message-ID:
<20261020101150.16967-1-liuc63@xiaopeng.com>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-349193-linux-kernel-netdev=dewy.ruShow Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-349193-linux-kernel-netdev=dewy.ru
From: liuc63@xiaopeng.com (liuc63)
Newsgroups: linux.kernel.netdev
Subject: [PATCH] net: wwan: iosm: fix NULL skb deref in ul_td_process
Date: Tue, 20 Oct 2026 18:11:41 +0800
Organization: Usenet Network
Message-ID: <20261020101150.16967-1-liuc63@xiaopeng.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
logging-data="3829970"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:c0CAMpOwSEYLlMzIAvDAc8u6+kE= sha256:CtdAuF0cv5Shhr0WnB0jVJDsCT/u4J9nR1X9XdiQexo=
sha1:/5f9V6lSJstyyo2zeE3L5zBDy2o= sha256:MPMbEwYdzpg0KIGDHpjNte2S9LcZE8h39jbrUyy+7sY=
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 7ED10110C8C; Tue, 20 Oct 2026 13:20:37 +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, HEADER_FROM_DIFFERENT_DOMAINS=0.25,
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 N28uq4F7iP6r;
Tue, 20 Oct 2026 13:20:35 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-349193-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 BDD6C110C4D; Tue, 20 Oct 2026 13:20:26 +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 F031061921; Tue, 20 Oct 2026 10:12:23 +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=1792491126;
b=F8w2ut9k4LIctgdTtIupqb3y6QshGYx/RzZJr9YkuVaDcfNVlLOu7cEwjCOPfOj5NFJo
dqHBaqLDAeMK4+E/DpIyJCScBxP9Ki84m6bmstcT3uJvXKowmhkmL2rI2y6NQgDjChwTv
2v9rakQ5LMdFi0/UFA75kWcL5nG/uj/h77oyrjEFpyfO9bkqFK6uMH3w25SicIeXeDrmG
F2KRoa8qYnMc3shv0ag17rGXhfqemag2BWl4LGi05X6aFrrSIbKLjIo86DiPVD9EAWLh5
aLBlJWvvqw6koXjRvGgU1yHBgioGFfbLTKrdhzLNIVcPoCdL49vxP/bNRyjDXeNIY5Q==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
a=rsa-sha256; c=relaxed/relaxed; t=1792491126;
h=X-Original-To:Received:DMARC-Filter:DKIM-Signature:
X-Alimail-AntiSpam: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=7nteGObl6tpBTZEAOzKq4nqis2nYsetm5CtazCpg/Ho=;
b=Vyo7OXKhcwK3wwOEGY1mOUfU+UYozhVrXWO/bzimOC0wwO0Xrqz0ZSQDJUUIM0D8Mi/p
TePmH6wgtseSPf5Z+3qxNIbWanX/3oozHmp/QYosGGCvZGemgIcQ5Ubp814wCFkLOg4A/
wNlUeAKxBI5XzJcBW7VJkwd2sv9/+Ol1iA+HTju8xFKnDeU6/rGAfN3p+yAasmZ+RfhGX
zdlu8RXDN6uosCvyZmYzzPJCws2ZTWoBDg7xIPwS1lwyqfmsGVzBiGd7hrcVbiUScgeNT
JPqlK122ijeI2GOXhWkbN5YVeCLWltYdeIyMn3LFQVL0wT8Jd3A9Ysq7v1pBC+gy8Dg==
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=c1ut7cfn;
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 E557A606A320;
Tue, 20 Oct 2026 10:12:05 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
dkim=pass (1024-bit key, unprotected) header.d=xiaopeng.com header.i=@xiaopeng.com header.a=rsa-sha256 header.s=default header.b=c1ut7cfn
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=115.124.28.49
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
t=1792491116;
b=VBjFFd7caJ6KFoayAceWpx/Xvw/a6Qc9QDvmfIFLnx4D4FpEpMVZvu5IeciVn2gCiHSq
oOvoXwYXWAkOUA3CnS8FIny5/torUnpfclIziXm1P//tH+92tCivafjriIkG0HTmd389w
Oco4JuSJJJZxmdo5fL5Lj8pn2tbxwcvIeZk0UizaGfd3xDOr0Dv1EKZVmI3lieLUSWEZR
Hi+Ul9QMJgPNfCwsJHFzpa3Ykhh7ICqZxrn11/DuXf4ZuwtnyuO9s2rQtlJF3kX+m3p/r
wGtTmXFblWbKWM2clcS9AHALxPxUXPO5Xzg7tT3ZW1W7iNgWZfZuoUtUP1ZADbLykwg==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
a=rsa-sha256; c=relaxed/relaxed; t=1792491116;
h=DMARC-Filter:DKIM-Signature:X-Alimail-AntiSpam:Received:From:To:Cc:
Subject:Date:Message-ID:X-Mailer:MIME-Version:
Content-Transfer-Encoding;
bh=7nteGObl6tpBTZEAOzKq4nqis2nYsetm5CtazCpg/Ho=;
b=ihHR67re/46iZJd2wf1GvN9RwacHMBDUiAdCiAX8uhg0rSfne5KjTjPTVsyolWOWd+Ep
GW1pkWa8ikobCrI5KzYkwWADixS9UIBbLCKjhkAnkYmaDo+U2UvvJrERDB/EaAAvhR4W1
BhVexGZTepYB3sQwkuWkBIzWFpuYchxO16HXgFaFYLcGcXdNwu2ESGl6C76wk1dKB9E6W
lO0UkKIhUT5ArhCHOt6H3UAHGkz1LRE/kmZhMrnwVChGNElWgCbESKXReW/mVGbOxNW1A
uyBFdyhqOYOwrMToBQS1dMPyMy1ILqVM5zQ8NOjfs3jAF3/s0ZMG8V4qdPeHmyC6+zA==
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=c1ut7cfn;
arc=none smtp.remote-ip=115.124.28.49
X-Received: from out28-49.mail.aliyun.com (out28-49.mail.aliyun.com [115.124.28.49])
(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 6D499606A32A;
Tue, 20 Oct 2026 10:11:53 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 6D499606A32A
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=1792491112; h=From:To:Subject:Date:Message-ID:MIME-Version;
bh=7nteGObl6tpBTZEAOzKq4nqis2nYsetm5CtazCpg/Ho=;
b=c1ut7cfnaZk5pqV4gZ9+eI/31zPprYX/PR4nSFHx+8306ipQKLjsOllwdeHfPOV0GVcsEJ/uqM+ce8p+z3dGcivfJZpwwSNmo5WkwJdG5ayV5q+IsbezkbRDmMtg9XKA4PKglUHz2Vj2QQTfzcEHVcvOlSQjecQaKZe5YcEM+VE=
X-Alimail-AntiSpam: AC=CONTINUE;BC=0.07892643|-1;CH=green;DM=|CONTINUE|false|;DS=CONTINUE|ham_system_inform|0.00381769-0.000805355-0.995377;FP=12127585923466235074|0|0|0|0|-1|-1|-1;HT=maildocker-contentspam033023087102;MF=liuc63@xiaopeng.com;NM=1;PH=DS;RN=9;RT=9;SR=0;TI=SMTPD_---.jlhO7Fd_1792491110;
X-Received: from localhost(mailfrom:liuc63@xiaopeng.com fp:SMTPD_---.jlhO7Fd_1792491110 cluster:ay29)
by smtp.aliyun-inc.com;
Tue, 20 Oct 2026 18:11:51 +0800
X-Cc: Loic Poulain <loic.poulain@oss.qualcomm.com>,
Sergey Ryazanov <ryazanov.s.a@gmail.com>,
Johannes Berg <johannes@sipsolutions.net>,
Guanglei Zhu <zhugl3@xiaopeng.com>,
netdev@vger.kernel.org,
linux-kernel@vger.kernel.org,
Liu Chao <liuc63@xiaopeng.com>,
stable@vger.kernel.org
X-Mailer: git-send-email 2.50.1
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