* [PATCH] net: wwan: iosm: fix NULL skb deref in ul_td_process
@ 2026-10-20 10:11 liuc63
2026-10-20 10:14 ` netdev-bot+sinfo
2026-10-20 10:21 ` Loic Poulain
0 siblings, 2 replies; 3+ messages in thread
From: liuc63 @ 2026-10-20 10:11 UTC (permalink / raw)
To: M Chetan Kumar
Cc: Loic Poulain, Sergey Ryazanov, Johannes Berg, Guanglei Zhu,
netdev, linux-kernel, Liu Chao, stable
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
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] net: wwan: iosm: fix NULL skb deref in ul_td_process
2026-10-20 10:11 [PATCH] net: wwan: iosm: fix NULL skb deref in ul_td_process liuc63
@ 2026-10-20 10:14 ` netdev-bot+sinfo
2026-10-20 10:21 ` Loic Poulain
1 sibling, 0 replies; 3+ messages in thread
From: netdev-bot+sinfo @ 2026-10-20 10:14 UTC (permalink / raw)
To: liuc63
Cc: M Chetan Kumar, Loic Poulain, Sergey Ryazanov, Johannes Berg,
Guanglei Zhu, netdev, linux-kernel, stable
Hi!
This is an automated message. This series looks like a fix, but its
commit messages seem to be missing some information:
- How the issue was discovered, e.g. hit in production, hit during
development, syzbot report, manual code inspection, LLM or static
analysis tool scan.
- Whether the issue was actually triggered, or is only theoretical
(e.g. found by code inspection). If it was triggered please include
the symptoms, like the stack trace or error messages.
Please do not repost the series just to address the above. Instead,
reply to this email with the missing information, so that reviewers
can take it into account. If the series needs another revision for
other reasons, please include the information in the commit messages
then.
The evaluation is done by an LLM so it may be wrong, if you think
that is the case please reply and explain.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] net: wwan: iosm: fix NULL skb deref in ul_td_process
2026-10-20 10:11 [PATCH] net: wwan: iosm: fix NULL skb deref in ul_td_process liuc63
2026-10-20 10:14 ` netdev-bot+sinfo
@ 2026-10-20 10:21 ` Loic Poulain
1 sibling, 0 replies; 3+ messages in thread
From: Loic Poulain @ 2026-10-20 10:21 UTC (permalink / raw)
To: liuc63
Cc: M Chetan Kumar, Sergey Ryazanov, Johannes Berg, Guanglei Zhu,
netdev, linux-kernel, stable
On Tue, Oct 20, 2026 at 12:11 PM liuc63 <liuc63@xiaopeng.com> wrote:
>
> 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;
Look like the caller(s) already check/report for null skb, so instead
of adding another print here, maybe it would be simpler to check for
skb in the condition where IPC_CB(skb) is used:
`if (skb && p_td->buffer.address != IPC_CB(skb)->mapping)`
> +
> if (!p_td->buffer.address) {
> dev_err(ipc_protocol->dev, "Td buffer address is NULL");
> return NULL;
> --
> 2.50.1
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-10-20 10:21 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-20 10:11 [PATCH] net: wwan: iosm: fix NULL skb deref in ul_td_process liuc63
2026-10-20 10:14 ` netdev-bot+sinfo
2026-10-20 10:21 ` Loic Poulain
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®