From: Fang Xieyan <fangxy@xiaopeng.com>
To: Loic Poulain <loic.poulain@oss.qualcomm.com>,
Sergey Ryazanov <ryazanov.s.a@gmail.com>
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>,
M Chetan Kumar <m.chetan.kumar@intel.com>,
Guanglei Zhu <zhugl3@xiaopeng.com>
Subject: [PATCH] net: wwan: iosm: fix potential skb leak in MUX DL decode
Date: Mon, 2 Nov 2026 16:19:20 +0800 [thread overview]
Message-ID: <20261102081920.50288-1-fangxy@xiaopeng.com> (raw)
ipc_mux_dl_decode() owns the received skb and frees it after
decoding. However, the early return when skb->data is NULL
bypasses the skb cleanup.
Free the skb through ipc_pcie_kfree_skb() before returning
to ensure that both the DMA mapping and skb are released.
Fixes: 3670970dd8c6 ("net: iosm: shared memory IPC interface")
Reviewed-by: Guanglei Zhu <zhugl3@xiaopeng.com>
Signed-off-by: Fang Xieyan <fangxy@xiaopeng.com>
---
drivers/net/wwan/iosm/iosm_ipc_mux_codec.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/net/wwan/iosm/iosm_ipc_mux_codec.c b/drivers/net/wwan/iosm/iosm_ipc_mux_codec.c
index 0bbd41263cc2..61700688eac9 100644
--- a/drivers/net/wwan/iosm/iosm_ipc_mux_codec.c
+++ b/drivers/net/wwan/iosm/iosm_ipc_mux_codec.c
@@ -693,8 +693,10 @@ void ipc_mux_dl_decode(struct iosm_mux *ipc_mux, struct sk_buff *skb)
{
u32 signature;
- if (!skb->data)
+ if (!skb->data) {
+ ipc_pcie_kfree_skb(ipc_mux->pcie, skb);
return;
+ }
/* Decode the MUX header type. */
signature = le32_to_cpup((__le32 *)skb->data);
--
2.50.1
next reply other threads:[~2026-11-02 8:19 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-02 8:19 Fang Xieyan [this message]
2026-11-02 8:23 ` netdev-bot+sinfo
2026-11-02 8:58 ` Loic Poulain
2026-11-02 10:53 ` Fang Xieyan
2026-11-03 8:20 ` netdev-bot+sashiko
2026-11-03 11:11 ` [PATCH v2] net: wwan: iosm: drop redundant skb->data check " Fang Xieyan
2026-11-03 13:50 ` Andrew Lunn
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261102081920.50288-1-fangxy@xiaopeng.com \
--to=fangxy@xiaopeng.com \
--cc=andrew+netdev@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@kernel.org \
--cc=johannes@sipsolutions.net \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=loic.poulain@oss.qualcomm.com \
--cc=m.chetan.kumar@intel.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=ryazanov.s.a@gmail.com \
--cc=zhugl3@xiaopeng.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®