Article View: linux.kernel.netdev
Article #9584Re: [PATCH] net: wwan: iosm: fix potential skb leak in MUX DL decode
From: Fang Xieyan
Date: Mon, 02 Nov 2026 10:53
Date: Mon, 02 Nov 2026 10:53
48 lines
10054 bytes
10054 bytes
Hi Loic,
You're right, skb->data cannot be NULL in this path. I traced both the
allocation side and the RX path that feeds ipc_mux_dl_decode(), and the
check can never trigger.
Allocation chain:
ipc_pcie_alloc_skb()
+-- ipc_pcie_alloc_local_skb()
+-- __netdev_alloc_skb()
On success skb->data points into a valid linear buffer; skb_reserve()
only advances skb->data within that buffer and never clears the
pointer. Allocation or DMA mapping failure returns a NULL skb.
The RX path is:
ipc_imem_dl_pipe_process()
+-- ipc_protocol_dl_td_process()
+-- ipc_imem_dl_skb_process()
+-- if (!skb) return;
+-- ipc_mux_dl_decode()
The skb is allocated and queued on the DL pipe by
ipc_protocol_dl_td_prepare(). It stores the skb in skbr_start[] only
after a successful allocation; on failure it returns without advancing
the head or publishing the descriptor.
On the RX path, ipc_protocol_dl_td_process() either returns a valid skb
or frees it and returns NULL. ipc_imem_dl_skb_process() checks for NULL
before calling ipc_mux_dl_decode().
The later skb_put() only updates skb->len and the tail; it does not
touch skb->data. DMA writes to the mapped data buffer, not to the skb
metadata.
I couldn't find any code in the IOSM driver that assigns skb->data to
NULL either.
So the check is unreachable: the skb that reaches ipc_mux_dl_decode()
always has a valid data pointer. I'll send a cleanup patch that removes
the redundant check instead.
Thanks.
Fang Xieyan
Technical Details
Message-ID:
<20261102105307.11263-1-fangxy@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-354602-linux-kernel-netdev=dewy.ruReferences:
<CAFEp6-1JqRXuXQgaoCRDivHyu668d-5Sb-gY+rWbn1aEBqTV3w@mail.gmail.com>Show 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-354602-linux-kernel-netdev=dewy.ru
From: fangxy@xiaopeng.com (Fang Xieyan)
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH] net: wwan: iosm: fix potential skb leak in MUX DL decode
Date: Mon, 2 Nov 2026 18:53:07 +0800
Organization: Usenet Network
Message-ID: <20261102105307.11263-1-fangxy@xiaopeng.com>
References: <CAFEp6-1JqRXuXQgaoCRDivHyu668d-5Sb-gY+rWbn1aEBqTV3w@mail.gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
logging-data="2905641"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:11kdM6VCluqqwCU2Yt4OHof+ABg= sha256:yM4Dp8dDfiYJ3cU9a69NH5vTF2S9HAjkgSwsVFAvICc=
sha1:AFx52xMeKUlspQSaxAkE4K3m2q8= sha256:VoI1F1jV5b8mJmsz1/StbVsZfinA5Vbz3m1T0LZchho=
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 17A1C1124B5; Mon, 2 Nov 2026 13:53:56 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.15
X-Spam-Status: No, score=-3.15 tagged_above=-9999 required=6.31
tests=[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 2i1Kvsq3cf3p;
Mon, 2 Nov 2026 13:53:53 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.232.135.74; helo=sto.lore.kernel.org; envelope-from=netdev+bounces-354602-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 sto.lore.kernel.org (sto.lore.kernel.org [172.232.135.74])
by mail.dewy.ru (Postfix) with ESMTPS id A26D71124B1; Mon, 2 Nov 2026 13:53:45 +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 C764B6012FD; Mon, 2 Nov 2026 10:53:24 +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=1793616802;
b=XHLqjrnXXOxOdHnAPQVsWtx0BDSipGGtBwcCAtpnWTXDhupqHy6y3wdrLFrfH1wCU6Vq
ARD68kdlJpGAsEq/U8G6bAF6INzoNdHVAnb1KHNDkaXxOt7cJod3IWC3u5C86zr3UEYbM
9gaHN4vyP6hm+G6DZIbUB/oc3/hmLPwZdLGR5D+fG1V50sILIrXL+4DCp+KNu3TMeD1/F
juYSIB0FlCnAH3IQhewaW/qNMZ5tYK4Y/7LulASVr92z6wSNlcSKNmn3gdkhpehygHmFe
3sSNGjknmSEwNzbBdKBROzLFWJXE6n//2Dp0v6NPXk+67JUoAf97v4HeiT9JiINKyhQ==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
a=rsa-sha256; c=relaxed/relaxed; t=1793616802;
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=T4y4qHErCUjizAzkD5FVGa7UziyW70K01/ZD4UHFGlQ=;
b=ELos4cU0HpVOARZhfVPhPuMOGl0NijEiHIsp1PFwjCO4lUcAOGLHQo5mDh7t7cyE56Ux
t7AX7G2Z4cL+KI2XQMIU/QxQkZy+WtpYkjWTOMxRo56mS7psHryqc5pY+98X2dgA0pkmk
Vaa2Jc32WmLp/MFRYPG4Fjl2izAMqiiH5T1t73qbW1qPf0RHLUDvg4P9SB1A6P7Fz0e2g
ypo72szABOOVUYBArEMVWiH8/JxNHiTwwAs80In/MlwLiHeua05Ms42REqbjrZ75Kpqr1
E495zcuX0zA3Ay6AD4ip7WEiI4OOy0gPZirvNjKm8Ld9jJBZxlXXDMP3Ww2fIU3lNvA==
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=VCiSjpfR;
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 3CC70606A330;
Mon, 2 Nov 2026 10:53:22 +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=VCiSjpfR
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=115.124.28.171
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
t=1793616801;
b=QtM2sQDyTf8DJs7S7ZZQQvmi/1+l81mqUs+ikawaKf5xAYQwjQZwMDZMSYJMMeRvB8kH
O5NrVOLY7xjU65azW0epZZYkVfN9As0efZ8GKEAQJZuv3UQLoE4pDk9f5QHV8/IJ0nGkq
p+dKgO2xHU+ptd2vHfH72sYbtaY2rAbvLGNrnvmac+aZzKry4N/B/04gMnOtqSPO3vKwp
WzEk9JkFVNJyk8oqX0Rjd7c1mf3vgFCWW73v694hqwVhxl4ge+2SzS/8LW7fIpP734SMr
OO1+BrNv/wvhe/CN82o4Uqu/nD4RAQPnQ06SRHKj2pOAPlogNKWESYpPJyRiQx3YZ+w==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
a=rsa-sha256; c=relaxed/relaxed; t=1793616801;
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=T4y4qHErCUjizAzkD5FVGa7UziyW70K01/ZD4UHFGlQ=;
b=poe0KZZb1zFHP1QOqSMGNUUeyS+toFXTAW/5MHJ1eONQvF7Czg3VLMSOqR/Zv9Xn8ug8
a2t5XVZOH3jO0LLeU9XBqMx/DgZzxkQrceo4zSp2Fu8Ufo+W3Zcrs4Z+eA66FpYveO5xF
44acK7nXOrRpGV9L9H2b6YpQkny/RQtcwhC8ME7iUMa0n1wJoob7JZSPKdmui7HYfyi6o
9cgBpJm8zrKcp0ESqgELYxrn9zg3xp23ndNOpGNtXEKU2aNwXe4q3NIJ/bMP8NCtzC+aa
tTXxfKS1eOsHnIFm4+vl1+9t1JB6c9huXc/WxXf6XWSCo1V6g6Ccw/9MSJYSAhUBPBg==
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=VCiSjpfR;
arc=none smtp.remote-ip=115.124.28.171
X-Received: from out28-171.mail.aliyun.com (out28-171.mail.aliyun.com [115.124.28.171])
(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 DED0A606A326;
Mon, 2 Nov 2026 10:53:18 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org DED0A606A326
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=1793616790; h=From:To:Subject:Date:Message-ID:MIME-Version;
bh=T4y4qHErCUjizAzkD5FVGa7UziyW70K01/ZD4UHFGlQ=;
b=VCiSjpfR0xAcQRFTMfZiHH7n0kTZJL7pb7PVhAHbg/4cvzFiy7QHlBf8oJ+2K4IFoGWApZieKjOVOBKipbvrB5THoBCDP3lLn3I7xqW2d3mchEDjo66Cs6pQqlyOgSOSoFtmPWN9A7NeXlWJ40wR7l6vxpYJcLcj5gKdleB/uBc=
X-Alimail-AntiSpam: AC=CONTINUE;BC=0.06373121|-1;CH=green;DM=|CONTINUE|false|;DS=CONTINUE|ham_regular_dialog|0.037735-0.0024049-0.95986;FP=10386311332249785874|0|0|0|0|-1|-1|-1;HT=maildocker-contentspam033037033194;MF=fangxy@xiaopeng.com;NM=1;PH=DS;RN=11;RT=11;SR=0;TI=SMTPD_---.jumRy2H_1793616787;
X-Received: from localhost.localdomain(mailfrom:fangxy@xiaopeng.com fp:SMTPD_---.jumRy2H_1793616787 cluster:ay29)
by smtp.aliyun-inc.com;
Mon, 02 Nov 2026 18:53:09 +0800
X-Cc: 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>,
netdev@vger.kernel.org,
linux-kernel@vger.kernel.org,
Johannes Berg <johannes@sipsolutions.net>,
Guanglei Zhu <zhugl3@xiaopeng.com>
X-Mailer: git-send-email 2.50.1
X-In-Reply-To: <CAFEp6-1JqRXuXQgaoCRDivHyu668d-5Sb-gY+rWbn1aEBqTV3w@mail.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