From: netdev-bot+sashiko@kernel.org
To: fangxy@xiaopeng.com
Cc: loic.poulain@oss.qualcomm.com, ryazanov.s.a@gmail.com,
netdev@vger.kernel.org, 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
Subject: Re: [PATCH net v4 2/5] net: wwan: iosm: validate the ADGH datagram length
Date: Wed, 25 Nov 2026 14:46:33 +0000 [thread overview]
Message-ID: <179561799387.3135.10134611969059298688@kernel.org> (raw)
In-Reply-To: <20261121141850.73754-3-fangxy@xiaopeng.com>
Thank you for your contribution! Sashiko AI review found more severe
issue(s) in other patches of this series. This mail is only an FYI, in case
you want to address the nit picks below when you respin.
Low priority / nit picks for your consideration:
- [Low] In drivers/net/wwan/iosm/iosm_ipc_mux_codec.h, the kernel-doc for
struct mux_adgh describes @length as "Length (in bytes) of the…
--
net: wwan: iosm: validate the ADGH datagram length
This adds a bounds check on the device-supplied adgh->length in
ipc_mux_dl_adgh_decode(). A datagram is now dropped if its length is not
greater than packet_offset or is larger than skb->len. Before this, an
underflowing payload length or a zero-length clone could be passed to the
network stack.
> diff --git a/drivers/net/wwan/iosm/iosm_ipc_mux_codec.c b/drivers/net/wwan/iosm/iosm_ipc_mux_codec.c
> index 5c33171ca7012..65421f6b4c91e 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;
> + }
[Severity: Low]
This isn't a bug, but the new check disagrees with the kernel-doc for
struct mux_adgh in iosm_ipc_mux_codec.h:
* @length: Length (in bytes) of the datagram header. This length
* shall include the header size. Min value: 0x10
dl_head_pad_len is only ever set to IPC_MEM_DL_ETH_OFFSET, in
iosm_ipc_mux.c:
ipc_mux->session[if_id].dl_head_pad_len = IPC_MEM_DL_ETH_OFFSET;
So pad_len is 0 and packet_offset is sizeof(struct mux_adgh), which is
0x10. That means adgh_len == 0x10, the documented minimum, is rejected
here as invalid.
Dropping a header-only datagram looks correct, since a zero-length clone
reaching ipc_wwan_receive() is what this patch fixes. The issue is that
the header says 0x10 is valid while the decoder logs it with dev_err as
an invalid length.
Firmware that sends header-only ADGH blocks according to the documented
minimum would get one non-ratelimited dev_err per block on the RX path.
Should the kernel-doc be updated so the minimum requires a payload? Or
should header-only datagrams be dropped silently, or with a ratelimited
or lower-level message?
> +
> /* Pass the packet to the netif layer */
> rc = ipc_mux_net_receive(ipc_mux, if_id, wwan, packet_offset,
> adgh->service_class, skb,
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261121141850.73754-1-fangxy%40xiaopeng.com
next prev parent reply other threads:[~2026-11-25 14:46 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-21 14:18 [PATCH net v4 0/5] net: wwan: iosm: validate MUX DL lengths and offsets Fang Xieyan
2026-11-21 14:18 ` [PATCH net v4 1/5] net: wwan: iosm: validate the MUX DL block length Fang Xieyan
2026-11-21 14:18 ` [PATCH net v4 2/5] net: wwan: iosm: validate the ADGH datagram length Fang Xieyan
2026-11-25 14:46 ` netdev-bot+sashiko [this message]
2026-11-21 14:18 ` [PATCH net v4 3/5] net: wwan: iosm: bound the ACBH command chain walk Fang Xieyan
2026-11-25 14:46 ` netdev-bot+sashiko
2026-11-21 14:18 ` [PATCH net v4 4/5] net: wwan: iosm: pass the DL command parameter by pointer Fang Xieyan
2026-11-21 14:18 ` [PATCH net v4 5/5] net: wwan: iosm: validate the command parameter length Fang Xieyan
2026-11-25 14:46 ` netdev-bot+sashiko
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=179561799387.3135.10134611969059298688@kernel.org \
--to=netdev-bot+sashiko@kernel.org \
--cc=andrew+netdev@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@kernel.org \
--cc=fangxy@xiaopeng.com \
--cc=horms@kernel.org \
--cc=johannes@sipsolutions.net \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=loic.poulain@oss.qualcomm.com \
--cc=maoyixie.tju@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=ryazanov.s.a@gmail.com \
--cc=stable@vger.kernel.org \
--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®