mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH net 0/5] net: wwan: iosm: validate MUX DL lengths and offsets
@ 2026-11-12 12:51 Fang Xieyan
  2026-11-12 12:51 ` [PATCH net 1/5] net: wwan: iosm: validate the MUX DL block length Fang Xieyan
                   ` (4 more replies)
  0 siblings, 5 replies; 8+ messages in thread
From: Fang Xieyan @ 2026-11-12 12:51 UTC (permalink / raw)
  To: Loic Poulain, Sergey Ryazanov, netdev
  Cc: Johannes Berg, Andrew Lunn, David S . Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, linux-kernel, Maoyi Xie,
	Simon Horman, M Chetan Kumar

Several lengths and offsets the MUX downlink decoders work with are
supplied by the modem: the size of the received block comes from a
device written transfer descriptor, and the ADGH datagram length, the
ACBH block length, the command chain offsets and the length a command
header declares for its parameter are all read from the block itself.
None of them is bounded against what actually arrived, so a truncated or
enlarged DL block makes the driver read past the received data, hand the
network stack a payload the device never declared, walk a command chain
that points back at itself, or decode the bytes of one command a second
time as the command following it. The aggregated datagram block path is
already covered by commit 526b8ef54668 ("net: wwan: iosm: bound device
offsets in the MUX downlink decoder") and is not touched here.

This series adds those bounds. The checks only relate the device
supplied lengths and offsets to the received data: no command type,
response or protocol semantics change, so a conforming modem behaves
exactly as before. Patch 4 is the prep change for patch 5, it stops the
driver from copying the received parameter union by value and from
building its answer inside the received block.

cmd_len is not used the same way in the two paths. In the aggregated
path the parameter boundary is next_cmd_index, or the end of the
received block for the last command: the flow control decoder already
keeps a backward compatible handling for a cmd_len that does not match
the header and its parameter size, so the field is not a hard bound
there. In MUX Lite it is an upper bound when it covers at least the
header; a smaller value is not taken as a usable declaration and the
received length stays the limit. That is a compatibility tolerance, not
a valid input: the protocol requires 0x10 or more.

A parameter too short for the member its command type reads is dropped
with -EMSGSIZE, which also ends an aggregated block at that command.

Patch 3 also delimits the command chain by the received length:
block_length is checked to cover the ACBH header and not exceed the
received buffer, but skb->len is what bounds the commands. The
array_index_nospec() call of the walk is gone with these explicit
checks: it bounds a byte offset by sizeof(struct mux_cmdh), which
turns every legal offset past that size into zero, while the checks
constrain the same value against the received length.
array_index_nospec() is kept only for if_id, an actual array index.

Patch 2 relies on the ADGH header check introduced by patch 1, and patch
5 relies on the ACBH block validation from patch 3 and on the parameter
pointer introduced by patch 4. Patches 1 through 3 apply cleanly and
build individually against the base, the series applies cleanly and
every commit builds, W=1 drivers/net/wwan/iosm/ is clean.

Found by reviewing the DL decode path against the MUX protocol
structures. Not reproduced on a live modem: reaching it needs a device
that truncates or enlarges its own downlink blocks.

The series is based on the net tree at 145480b28ca8 and applies to it
cleanly.

Fang Xieyan (5):
  net: wwan: iosm: validate the MUX DL block length
  net: wwan: iosm: validate the ADGH datagram length
  net: wwan: iosm: bound the ACBH command chain walk
  net: wwan: iosm: pass the DL command parameter by pointer
  net: wwan: iosm: validate the command parameter length

 drivers/net/wwan/iosm/iosm_ipc_mux_codec.c | 197 ++++++++++++++++++++++-------
 1 file changed, 151 insertions(+), 46 deletions(-)

-- 
2.50.1


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH net 1/5] net: wwan: iosm: validate the MUX DL block length
  2026-11-12 12:51 [PATCH net 0/5] net: wwan: iosm: validate MUX DL lengths and offsets Fang Xieyan
@ 2026-11-12 12:51 ` Fang Xieyan
  2026-11-12 12:51 ` [PATCH net 2/5] net: wwan: iosm: validate the ADGH datagram length Fang Xieyan
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 8+ messages in thread
From: Fang Xieyan @ 2026-11-12 12:51 UTC (permalink / raw)
  To: Loic Poulain, Sergey Ryazanov, netdev
  Cc: Johannes Berg, Andrew Lunn, David S . Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, linux-kernel, Maoyi Xie,
	Simon Horman, M Chetan Kumar, stable, Guanglei Zhu

The received length of a DL MUX block is supplied by the device and can
be shorter than the header its signature advertises. ipc_mux_dl_decode()
reads the four byte signature and then lets the decoders index their
header structures without checking skb->len, so a short block makes the
driver decode past the received data.

Check the signature before reading it, and check the header size of the
ADGH, FCTH and CMDH branches before dispatching to their decoders. The
ADB branch already validates its own headers, and the ACBH branch is
covered by the bounds checks of its command chain walk. A block too
short to carry its signature is dropped on the way to the single free.

Fixes: 9413491e20e1 ("net: iosm: encode or decode datagram")
Cc: stable@vger.kernel.org
Reviewed-by: Guanglei Zhu <zhugl3@xiaopeng.com>
Signed-off-by: Fang Xieyan <fangxy@xiaopeng.com>
---
 drivers/net/wwan/iosm/iosm_ipc_mux_codec.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/drivers/net/wwan/iosm/iosm_ipc_mux_codec.c b/drivers/net/wwan/iosm/iosm_ipc_mux_codec.c
index 0bbd41263cc2..5c33171ca701 100644
--- a/drivers/net/wwan/iosm/iosm_ipc_mux_codec.c
+++ b/drivers/net/wwan/iosm/iosm_ipc_mux_codec.c
@@ -696,6 +696,11 @@ void ipc_mux_dl_decode(struct iosm_mux *ipc_mux, struct sk_buff *skb)
 	if (!skb->data)
 		return;
 
+	if (skb->len < sizeof(signature)) {
+		dev_err(ipc_mux->dev, "invalid MUX block length %u", skb->len);
+		goto free_skb;
+	}
+
 	/* Decode the MUX header type. */
 	signature = le32_to_cpup((__le32 *)skb->data);
 
@@ -704,15 +709,24 @@ void ipc_mux_dl_decode(struct iosm_mux *ipc_mux, struct sk_buff *skb)
 		mux_dl_adb_decode(ipc_mux, skb);
 		break;
 	case IOSM_AGGR_MUX_SIG_ADGH:
+		if (skb->len < sizeof(struct mux_adgh))
+			break;
+
 		ipc_mux_dl_adgh_decode(ipc_mux, skb);
 		break;
 	case MUX_SIG_FCTH:
+		if (skb->len < sizeof(struct ipc_mem_lite_gen_tbl))
+			break;
+
 		ipc_mux_dl_fcth_decode(ipc_mux, skb->data);
 		break;
 	case IOSM_AGGR_MUX_SIG_ACBH:	/* Aggregated Command Block Header */
 		ipc_mux_dl_acb_decode(ipc_mux, skb);
 		break;
 	case MUX_SIG_CMDH:
+		if (skb->len < offsetof(struct mux_lite_cmdh, param))
+			break;
+
 		ipc_mux_dl_cmd_decode(ipc_mux, skb);
 		break;
 
@@ -720,6 +734,7 @@ void ipc_mux_dl_decode(struct iosm_mux *ipc_mux, struct sk_buff *skb)
 		dev_err(ipc_mux->dev, "invalid ABH signature");
 	}
 
+free_skb:
 	ipc_pcie_kfree_skb(ipc_mux->pcie, skb);
 }
 
-- 
2.50.1


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH net 2/5] net: wwan: iosm: validate the ADGH datagram length
  2026-11-12 12:51 [PATCH net 0/5] net: wwan: iosm: validate MUX DL lengths and offsets Fang Xieyan
  2026-11-12 12:51 ` [PATCH net 1/5] net: wwan: iosm: validate the MUX DL block length Fang Xieyan
@ 2026-11-12 12:51 ` Fang Xieyan
  2026-11-16 13:55   ` netdev-bot+sashiko
  2026-11-12 12:51 ` [PATCH net 3/5] net: wwan: iosm: bound the ACBH command chain walk Fang Xieyan
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 8+ messages in thread
From: Fang Xieyan @ 2026-11-12 12:51 UTC (permalink / raw)
  To: Loic Poulain, Sergey Ryazanov, netdev
  Cc: Johannes Berg, Andrew Lunn, David S . Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, linux-kernel, Maoyi Xie,
	Simon Horman, M Chetan Kumar, stable, Guanglei Zhu

ipc_mux_dl_adgh_decode() takes adgh->length from the device and hands
adgh_len - packet_offset to the network stack as the payload size of the
cloned skb, without bounding adgh_len at all. When the device reports a
datagram shorter than the ADGH header plus its negotiated padding, the
subtraction wraps to a huge u32, skb_trim() refuses the length and keeps
the clone unchanged, and the stack gets every byte left in the block
instead of the declared payload. A length beyond skb->len is nonsense
that the driver passes on as well.

Require the datagram length to cover packet_offset and to fit into
skb->len, and drop the block otherwise.

Fixes: c34ca4f32c24 ("net: wwan: iosm: fix incorrect skb length")
Cc: stable@vger.kernel.org
Reviewed-by: Guanglei Zhu <zhugl3@xiaopeng.com>
Signed-off-by: Fang Xieyan <fangxy@xiaopeng.com>
---
 drivers/net/wwan/iosm/iosm_ipc_mux_codec.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/drivers/net/wwan/iosm/iosm_ipc_mux_codec.c b/drivers/net/wwan/iosm/iosm_ipc_mux_codec.c
index 5c33171ca701..b573067a366f 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
+	 * cover 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;
+	}
+
 	/* Pass the packet to the netif layer */
 	rc = ipc_mux_net_receive(ipc_mux, if_id, wwan, packet_offset,
 				 adgh->service_class, skb,
-- 
2.50.1


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH net 3/5] net: wwan: iosm: bound the ACBH command chain walk
  2026-11-12 12:51 [PATCH net 0/5] net: wwan: iosm: validate MUX DL lengths and offsets Fang Xieyan
  2026-11-12 12:51 ` [PATCH net 1/5] net: wwan: iosm: validate the MUX DL block length Fang Xieyan
  2026-11-12 12:51 ` [PATCH net 2/5] net: wwan: iosm: validate the ADGH datagram length Fang Xieyan
@ 2026-11-12 12:51 ` Fang Xieyan
  2026-11-12 12:52 ` [PATCH net 4/5] net: wwan: iosm: pass the DL command parameter by pointer Fang Xieyan
  2026-11-12 12:52 ` [PATCH net 5/5] net: wwan: iosm: validate the command parameter length Fang Xieyan
  4 siblings, 0 replies; 8+ messages in thread
From: Fang Xieyan @ 2026-11-12 12:51 UTC (permalink / raw)
  To: Loic Poulain, Sergey Ryazanov, netdev
  Cc: Johannes Berg, Andrew Lunn, David S . Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, linux-kernel, Maoyi Xie,
	Simon Horman, M Chetan Kumar, stable, Guanglei Zhu

ipc_mux_dl_acb_decode() walks the command chain of a received
Aggregated Command Block. first_cmd_index is passed through
array_index_nospec() with sizeof(struct mux_cmdh) as its bound, which
treats a byte offset as an array index: every valid offset at or beyond
that size is turned into zero, so the command it points at is dropped.
next_cmd_index is not validated at all before it is followed, so it can
point outside the received block, back at an already processed command,
or into the header just read. The walk can therefore read past the end
of the skb, revisit an earlier command indefinitely, or decode an
overlapping command header.

The overlapping case does not fault, which makes it the quiet one: the
current walk does not check that next_cmd_index advances beyond the
header just read. An index into that header is therefore followed, and
those bytes are decoded a second time as another command and
acknowledged a second time.

Bound the commands by the received length and require every command
offset to leave room for a complete command header. block_length is
checked to cover the block header and not to exceed the received
buffer, but it is not used to delimit the commands: the driver gives
the field no meaning beyond the header on this path, and its own
uplink encoder leaves block_length at the size of the block header.
What arrived holds either way.

Validate the link to the next command before the command carrying it is
processed: a non zero index has to advance past the current header, stay
inside the received data and leave room for a complete next header. Only
a zero index terminates the chain, which is how the uplink side of the
driver terminates its own command blocks as well. The offsets then
strictly increase, so the walk terminates, and a command is no longer
acted upon before its link is known to be usable. The array_index_nospec()
call is gone with these checks, which constrain the same value properly.

Fixes: 1f52d7b62285 ("net: wwan: iosm: Enable M.2 7360 WWAN card support")
Cc: stable@vger.kernel.org
Reviewed-by: Guanglei Zhu <zhugl3@xiaopeng.com>
Signed-off-by: Fang Xieyan <fangxy@xiaopeng.com>
---
 drivers/net/wwan/iosm/iosm_ipc_mux_codec.c | 46 ++++++++++++++++++----
 1 file changed, 38 insertions(+), 8 deletions(-)

diff --git a/drivers/net/wwan/iosm/iosm_ipc_mux_codec.c b/drivers/net/wwan/iosm/iosm_ipc_mux_codec.c
index b573067a366f..2c4f175233a1 100644
--- a/drivers/net/wwan/iosm/iosm_ipc_mux_codec.c
+++ b/drivers/net/wwan/iosm/iosm_ipc_mux_codec.c
@@ -526,30 +526,60 @@ static void ipc_mux_dl_acbcmd_decode(struct iosm_mux *ipc_mux,
 /* Decode an aggregated command block. */
 static void ipc_mux_dl_acb_decode(struct iosm_mux *ipc_mux, struct sk_buff *skb)
 {
+	size_t hdr_len = offsetof(struct mux_cmdh, param);
 	struct mux_acbh *acbh;
 	struct mux_cmdh *cmdh;
-	u32 next_cmd_index;
+	u32 block_length, cmd_index, next_cmd_index;
 	u8 *block;
 	int size;
 
+	if (skb->len < sizeof(struct mux_acbh))
+		return;
+
 	acbh = (struct mux_acbh *)(skb->data);
 	block = (u8 *)(skb->data);
+	block_length = le32_to_cpu(acbh->block_length);
 
-	next_cmd_index = le32_to_cpu(acbh->first_cmd_index);
-	next_cmd_index = array_index_nospec(next_cmd_index,
-					    sizeof(struct mux_cmdh));
+	/*
+	 * Keep block_length within the received buffer, but use skb->len
+	 * to bound the command chain: the uplink encoder sets
+	 * block_length to the ACBH header size.
+	 */
+	if (block_length < sizeof(struct mux_acbh) || block_length > skb->len)
+		return;
+
+	cmd_index = le32_to_cpu(acbh->first_cmd_index);
+
+	while (cmd_index != 0) {
+		/* Every command header has to lie inside the received data. */
+		if (cmd_index < sizeof(struct mux_acbh) ||
+		    cmd_index > skb->len ||
+		    hdr_len > skb->len - cmd_index)
+			break;
 
-	while (next_cmd_index != 0) {
-		cmdh = (struct mux_cmdh *)&block[next_cmd_index];
+		cmdh = (struct mux_cmdh *)&block[cmd_index];
 		next_cmd_index = le32_to_cpu(cmdh->next_cmd_index);
+
+		/*
+		 * The next index has to move past this header, stay inside
+		 * the received data and leave room for a header of its own.
+		 */
+		if (next_cmd_index != 0 &&
+		    (next_cmd_index <= cmd_index ||
+		     next_cmd_index - cmd_index < hdr_len ||
+		     next_cmd_index > skb->len ||
+		     skb->len - next_cmd_index < hdr_len))
+			break;
+
 		if (ipc_mux_dl_cmdresps_decode_process(ipc_mux, cmdh->param,
 						       cmdh->command_type,
 						       cmdh->if_id,
 						       cmdh->transaction_id)) {
-			size = offsetof(struct mux_cmdh, param) +
-				sizeof(cmdh->param.flow_ctl);
+			size = hdr_len + sizeof(cmdh->param.flow_ctl);
 			ipc_mux_dl_acbcmd_decode(ipc_mux, cmdh, size);
 		}
+
+		cmd_index = next_cmd_index;
 	}
 }
 
-- 
2.50.1


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH net 4/5] net: wwan: iosm: pass the DL command parameter by pointer
  2026-11-12 12:51 [PATCH net 0/5] net: wwan: iosm: validate MUX DL lengths and offsets Fang Xieyan
                   ` (2 preceding siblings ...)
  2026-11-12 12:51 ` [PATCH net 3/5] net: wwan: iosm: bound the ACBH command chain walk Fang Xieyan
@ 2026-11-12 12:52 ` Fang Xieyan
  2026-11-12 12:52 ` [PATCH net 5/5] net: wwan: iosm: validate the command parameter length Fang Xieyan
  4 siblings, 0 replies; 8+ messages in thread
From: Fang Xieyan @ 2026-11-12 12:52 UTC (permalink / raw)
  To: Loic Poulain, Sergey Ryazanov, netdev
  Cc: Johannes Berg, Andrew Lunn, David S . Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, linux-kernel, Maoyi Xie,
	Simon Horman, M Chetan Kumar, Guanglei Zhu

ipc_mux_dl_cmdresps_decode_process() takes the twelve byte union
mux_cmd_param by value, so every received command copies the whole union
out of the skb even when the command type only needs one member of it.
The driver also builds its answers inside the received block:
ipc_mux_dl_cmd_decode() writes the link status response into cmdh->param
of the skb and reads it back a few lines later, and
ipc_mux_dl_acbcmd_decode() writes into it as well.

Take the parameter as a const pointer, and keep the link status response
of the lite path in a local variable. The aggregated path does not need a
parameter pointer at all: it passes a size of zero to
ipc_mux_dl_acb_send_cmds(), so nothing is ever copied from it and the
write into cmdh->param had no effect.

The bytes handed to the UL path are unchanged, the lite path still sends
the four byte response field and the aggregated path still sends none.

Reviewed-by: Guanglei Zhu <zhugl3@xiaopeng.com>
Signed-off-by: Fang Xieyan <fangxy@xiaopeng.com>
---
 drivers/net/wwan/iosm/iosm_ipc_mux_codec.c | 29 ++++++++++------------
 1 file changed, 13 insertions(+), 16 deletions(-)

diff --git a/drivers/net/wwan/iosm/iosm_ipc_mux_codec.c b/drivers/net/wwan/iosm/iosm_ipc_mux_codec.c
index 2c4f175233a1..aea4cd9ec20d 100644
--- a/drivers/net/wwan/iosm/iosm_ipc_mux_codec.c
+++ b/drivers/net/wwan/iosm/iosm_ipc_mux_codec.c
@@ -184,7 +184,7 @@ void ipc_mux_netif_tx_flowctrl(struct mux_session *session, int idx, bool on)
 }
 
 static int ipc_mux_dl_cmdresps_decode_process(struct iosm_mux *ipc_mux,
-					      union mux_cmd_param param,
+					      const union mux_cmd_param *param,
 					      __le32 command_type, u8 if_id,
 					      __le32 transaction_id)
 {
@@ -194,7 +194,7 @@ static int ipc_mux_dl_cmdresps_decode_process(struct iosm_mux *ipc_mux,
 	case MUX_CMD_OPEN_SESSION_RESP:
 	case MUX_CMD_CLOSE_SESSION_RESP:
 		/* Resume the control application. */
-		acb->got_param = param;
+		acb->got_param = *param;
 		break;
 
 	case MUX_LITE_CMD_FLOW_CTL_ACK:
@@ -318,7 +318,7 @@ static void ipc_mux_dl_cmd_decode(struct iosm_mux *ipc_mux, struct sk_buff *skb)
 	__le32 trans_id = cmdh->transaction_id;
 	int size;
 
-	if (ipc_mux_dl_cmdresps_decode_process(ipc_mux, cmdh->param,
+	if (ipc_mux_dl_cmdresps_decode_process(ipc_mux, &cmdh->param,
 					       cmdh->command_type, cmdh->if_id,
 					       cmdh->transaction_id)) {
 		/* Unable to decode command response indicates the cmd_type
@@ -333,14 +333,15 @@ static void ipc_mux_dl_cmd_decode(struct iosm_mux *ipc_mux, struct sk_buff *skb)
 			/* Decoded command may need a response. Give the
 			 * response according to the command type.
 			 */
+			union mux_cmd_param response = {};
 			union mux_cmd_param *mux_cmd = NULL;
 			size_t size = 0;
 			u32 cmd = MUX_LITE_CMD_LINK_STATUS_REPORT_RESP;
 
 			if (cmdh->command_type ==
 			    cpu_to_le32(MUX_LITE_CMD_LINK_STATUS_REPORT)) {
-				mux_cmd = &cmdh->param;
-				mux_cmd->link_status_resp.response =
+				mux_cmd = &response;
+				response.link_status_resp.response =
 					cpu_to_le32(MUX_CMD_RESP_SUCCESS);
 				/* response field is u32 */
 				size = sizeof(u32);
@@ -500,26 +501,22 @@ static void ipc_mux_dl_acbcmd_decode(struct iosm_mux *ipc_mux,
 	u32 fctl_dis = IOSM_AGGR_MUX_CMD_FLOW_CTL_DISABLE;
 	u32 fctl_ena = IOSM_AGGR_MUX_CMD_FLOW_CTL_ENABLE;
 	u32 fctl_ack = IOSM_AGGR_MUX_CMD_FLOW_CTL_ACK;
-	union mux_cmd_param *cmd_p = NULL;
 	u32 cmd = link_st;
 	u32 trans_id;
 
 	if (!ipc_mux_dl_cmds_decode_process(ipc_mux, &cmdh->param,
 					    cmdh->command_type, cmdh->if_id,
 					    cmdh->cmd_len, size)) {
-		size = 0;
-		if (cmdh->command_type == cpu_to_le32(link_st)) {
-			cmd_p = &cmdh->param;
-			cmd_p->link_status_resp.response = MUX_CMD_RESP_SUCCESS;
-		} else if ((cmdh->command_type == cpu_to_le32(fctl_ena)) ||
-				(cmdh->command_type == cpu_to_le32(fctl_dis))) {
+		if (cmdh->command_type == cpu_to_le32(fctl_ena) ||
+		    cmdh->command_type == cpu_to_le32(fctl_dis))
 			cmd = fctl_ack;
-		} else {
+		else if (cmdh->command_type != cpu_to_le32(link_st))
 			return;
-			}
+
 		trans_id = le32_to_cpu(cmdh->transaction_id);
+		/* No response parameter is sent in the aggregated protocol. */
 		ipc_mux_dl_acb_send_cmds(ipc_mux, cmd, cmdh->if_id,
-					 trans_id, cmd_p, size, false, true);
+					 trans_id, NULL, 0, false, true);
 	}
 }
 
@@ -571,7 +568,7 @@ static void ipc_mux_dl_acb_decode(struct iosm_mux *ipc_mux, struct sk_buff *skb)
 		     skb->len - next_cmd_index < hdr_len))
 			break;
 
-		if (ipc_mux_dl_cmdresps_decode_process(ipc_mux, cmdh->param,
+		if (ipc_mux_dl_cmdresps_decode_process(ipc_mux, &cmdh->param,
 						       cmdh->command_type,
 						       cmdh->if_id,
 						       cmdh->transaction_id)) {
-- 
2.50.1


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH net 5/5] net: wwan: iosm: validate the command parameter length
  2026-11-12 12:51 [PATCH net 0/5] net: wwan: iosm: validate MUX DL lengths and offsets Fang Xieyan
                   ` (3 preceding siblings ...)
  2026-11-12 12:52 ` [PATCH net 4/5] net: wwan: iosm: pass the DL command parameter by pointer Fang Xieyan
@ 2026-11-12 12:52 ` Fang Xieyan
  2026-11-16 13:55   ` netdev-bot+sashiko
  4 siblings, 1 reply; 8+ messages in thread
From: Fang Xieyan @ 2026-11-12 12:52 UTC (permalink / raw)
  To: Loic Poulain, Sergey Ryazanov, netdev
  Cc: Johannes Berg, Andrew Lunn, David S . Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, linux-kernel, Maoyi Xie,
	Simon Horman, M Chetan Kumar, stable, Guanglei Zhu

Both command decoders read members of the parameter union without
knowing how long the parameter actually is.
ipc_mux_dl_cmdresps_decode_process() and
ipc_mux_dl_cmds_decode_process() used to be handed the size of the whole
union or of the command header, which is a property of the structures,
not of the received command: an OPEN_SESSION_RESP truncated below its
twelve byte parameter copied bytes past the command into acb->got_param
and then resumed the session establishment waiting on it, and a FLOW_CTL
whose parameter does not fit left the flow control mask and the state of
the session built from whatever bytes followed.

Derive the parameter length from what the current command owns: for MUX
Lite the bytes cmd_len declares beyond the header, for a command of an
aggregated block the bytes up to the next command, or up to the end of
the received block for the last one. Both stay capped by the received
length.

cmd_len is not used as a per-command parameter bound in the aggregated
path: next_cmd_index is what identifies the next command, and the flow
control decoder already treats a cmd_len that does not match the header
and parameter size as a legacy device instead of as an error, so the
field is not a hard bound there. In MUX Lite, cmd_len bounds the
parameter only when it covers at least the header. The protocol asks for
0x10 or more, but a shorter value is not rejected: the received length
keeps the limit there, which preserves the handling the existing
backward compatible code gives legacy devices and is still tighter than
the unbounded read it replaces. That case stays silent, like the
compatibility handling itself.

Check the member each command type really uses against that length: the
two session responses by their own size, which differ, and the flow
control mask before it is read. A parameter too short for its command
type is returned as -EMSGSIZE and the callers no longer hand it to the
command decoder, so a known but incomplete response is dropped instead
of being retried as a command.

In an aggregated block, ipc_mux_dl_acbcmd_decode() used to swallow that
error: the command was not acted upon, but the walk went on to the next
one. It now returns it, so a block that declared a command it cannot
hold is not trusted for the ones behind it either. A command of unknown
type still returns -EINVAL, is tried as a command and the walk
continues, as before.

Fixes: 9413491e20e1 ("net: iosm: encode or decode datagram")
Cc: stable@vger.kernel.org
Reviewed-by: Guanglei Zhu <zhugl3@xiaopeng.com>
Signed-off-by: Fang Xieyan <fangxy@xiaopeng.com>
---
 drivers/net/wwan/iosm/iosm_ipc_mux_codec.c | 116 +++++++++++++++------
 1 file changed, 85 insertions(+), 31 deletions(-)

diff --git a/drivers/net/wwan/iosm/iosm_ipc_mux_codec.c b/drivers/net/wwan/iosm/iosm_ipc_mux_codec.c
index aea4cd9ec20d..bd6c82746cc4 100644
--- a/drivers/net/wwan/iosm/iosm_ipc_mux_codec.c
+++ b/drivers/net/wwan/iosm/iosm_ipc_mux_codec.c
@@ -185,6 +185,7 @@ void ipc_mux_netif_tx_flowctrl(struct mux_session *session, int idx, bool on)
 
 static int ipc_mux_dl_cmdresps_decode_process(struct iosm_mux *ipc_mux,
 					      const union mux_cmd_param *param,
+					      size_t param_len,
 					      __le32 command_type, u8 if_id,
 					      __le32 transaction_id)
 {
@@ -192,9 +193,18 @@ static int ipc_mux_dl_cmdresps_decode_process(struct iosm_mux *ipc_mux,
 
 	switch (le32_to_cpu(command_type)) {
 	case MUX_CMD_OPEN_SESSION_RESP:
-	case MUX_CMD_CLOSE_SESSION_RESP:
+		if (param_len < sizeof(param->open_session_resp))
+			return -EMSGSIZE;
+
 		/* Resume the control application. */
-		acb->got_param = *param;
+		acb->got_param.open_session_resp = param->open_session_resp;
+		break;
+
+	case MUX_CMD_CLOSE_SESSION_RESP:
+		if (param_len < sizeof(param->close_session_resp))
+			return -EMSGSIZE;
+
+		acb->got_param.close_session_resp = param->close_session_resp;
 		break;
 
 	case MUX_LITE_CMD_FLOW_CTL_ACK:
@@ -229,6 +239,7 @@ static int ipc_mux_dl_cmdresps_decode_process(struct iosm_mux *ipc_mux,
 
 static int ipc_mux_dl_cmds_decode_process(struct iosm_mux *ipc_mux,
 					  union mux_cmd_param *param,
+					  size_t param_len,
 					  __le32 command_type, u8 if_id,
 					  __le16 cmd_len, int size)
 {
@@ -242,6 +253,9 @@ static int ipc_mux_dl_cmds_decode_process(struct iosm_mux *ipc_mux,
 	case MUX_LITE_CMD_FLOW_CTL:
 	case IOSM_AGGR_MUX_CMD_FLOW_CTL_DISABLE:
 
+		if (param_len < sizeof(param->flow_ctl))
+			return -EMSGSIZE;
+
 		if (if_id >= IPC_MEM_MUX_IP_SESSION_ENTRIES) {
 			dev_err(ipc_mux->dev, "if_id [%d] not valid",
 				if_id);
@@ -315,19 +329,36 @@ static int ipc_mux_dl_cmds_decode_process(struct iosm_mux *ipc_mux,
 static void ipc_mux_dl_cmd_decode(struct iosm_mux *ipc_mux, struct sk_buff *skb)
 {
 	struct mux_lite_cmdh *cmdh = (struct mux_lite_cmdh *)skb->data;
+	size_t hdr_len = offsetof(struct mux_lite_cmdh, param);
+	size_t param_len;
 	__le32 trans_id = cmdh->transaction_id;
-	int size;
+	u16 cmd_len;
+	int ret, size;
 
-	if (ipc_mux_dl_cmdresps_decode_process(ipc_mux, &cmdh->param,
-					       cmdh->command_type, cmdh->if_id,
-					       cmdh->transaction_id)) {
+	cmd_len = le16_to_cpu(cmdh->cmd_len);
+	param_len = skb->len > hdr_len ? skb->len - hdr_len : 0;
+	/*
+	 * A cmd_len below the header is not a usable declaration: the
+	 * received length stays the limit, as for a legacy device.
+	 */
+	if (cmd_len >= hdr_len)
+		param_len = min_t(size_t, param_len, cmd_len - hdr_len);
+
+	ret = ipc_mux_dl_cmdresps_decode_process(ipc_mux, &cmdh->param,
+						 param_len,
+						 cmdh->command_type,
+						 cmdh->if_id,
+						 cmdh->transaction_id);
+	if (ret == -EMSGSIZE)
+		return;
+
+	if (ret) {
 		/* Unable to decode command response indicates the cmd_type
 		 * may be a command instead of response. So try to decoding it.
 		 */
-		size = offsetof(struct mux_lite_cmdh, param) +
-				sizeof(cmdh->param.flow_ctl);
+		size = hdr_len + sizeof(cmdh->param.flow_ctl);
 		if (!ipc_mux_dl_cmds_decode_process(ipc_mux, &cmdh->param,
-						    cmdh->command_type,
+						    param_len, cmdh->command_type,
 						    cmdh->if_id,
 						    cmdh->cmd_len, size)) {
 			/* Decoded command may need a response. Give the
@@ -494,8 +525,9 @@ static void ipc_mux_dl_adgh_decode(struct iosm_mux *ipc_mux,
 	ipc_mux->session[if_id].flush = 1;
 }
 
-static void ipc_mux_dl_acbcmd_decode(struct iosm_mux *ipc_mux,
-				     struct mux_cmdh *cmdh, int size)
+static int ipc_mux_dl_acbcmd_decode(struct iosm_mux *ipc_mux,
+				    struct mux_cmdh *cmdh, size_t param_len,
+				    int size)
 {
 	u32 link_st  = IOSM_AGGR_MUX_CMD_LINK_STATUS_REPORT_RESP;
 	u32 fctl_dis = IOSM_AGGR_MUX_CMD_FLOW_CTL_DISABLE;
@@ -503,32 +535,39 @@ static void ipc_mux_dl_acbcmd_decode(struct iosm_mux *ipc_mux,
 	u32 fctl_ack = IOSM_AGGR_MUX_CMD_FLOW_CTL_ACK;
 	u32 cmd = link_st;
 	u32 trans_id;
+	int ret;
 
-	if (!ipc_mux_dl_cmds_decode_process(ipc_mux, &cmdh->param,
-					    cmdh->command_type, cmdh->if_id,
-					    cmdh->cmd_len, size)) {
-		if (cmdh->command_type == cpu_to_le32(fctl_ena) ||
-		    cmdh->command_type == cpu_to_le32(fctl_dis))
-			cmd = fctl_ack;
-		else if (cmdh->command_type != cpu_to_le32(link_st))
-			return;
-
-		trans_id = le32_to_cpu(cmdh->transaction_id);
-		/* No response parameter is sent in the aggregated protocol. */
-		ipc_mux_dl_acb_send_cmds(ipc_mux, cmd, cmdh->if_id,
-					 trans_id, NULL, 0, false, true);
-	}
+	ret = ipc_mux_dl_cmds_decode_process(ipc_mux, &cmdh->param, param_len,
+					     cmdh->command_type, cmdh->if_id,
+					     cmdh->cmd_len, size);
+	if (ret)
+		return ret;
+
+	if (cmdh->command_type == cpu_to_le32(fctl_ena) ||
+	    cmdh->command_type == cpu_to_le32(fctl_dis))
+		cmd = fctl_ack;
+	else if (cmdh->command_type != cpu_to_le32(link_st))
+		return -EINVAL;
+
+	trans_id = le32_to_cpu(cmdh->transaction_id);
+
+	/* No response parameter is sent in the aggregated protocol. */
+	ipc_mux_dl_acb_send_cmds(ipc_mux, cmd, cmdh->if_id, trans_id,
+				 NULL, 0, false, true);
+
+	return 0;
 }
 
 /* Decode an aggregated command block. */
 static void ipc_mux_dl_acb_decode(struct iosm_mux *ipc_mux, struct sk_buff *skb)
 {
 	size_t hdr_len = offsetof(struct mux_cmdh, param);
+	size_t cmd_end, param_len;
 	struct mux_acbh *acbh;
 	struct mux_cmdh *cmdh;
 	u32 block_length, cmd_index, next_cmd_index;
 	u8 *block;
-	int size;
+	int ret, size;
 
 	if (skb->len < sizeof(struct mux_acbh))
 		return;
@@ -568,12 +607,27 @@ static void ipc_mux_dl_acb_decode(struct iosm_mux *ipc_mux, struct sk_buff *skb)
 		     skb->len - next_cmd_index < hdr_len))
 			break;
 
-		if (ipc_mux_dl_cmdresps_decode_process(ipc_mux, &cmdh->param,
-						       cmdh->command_type,
-						       cmdh->if_id,
-						       cmdh->transaction_id)) {
+		/*
+		 * A command owns the bytes up to the next one, the last
+		 * one of the chain those up to the end of what arrived.
+		 */
+		cmd_end = next_cmd_index ? next_cmd_index : skb->len;
+		param_len = cmd_end - cmd_index - hdr_len;
+
+		ret = ipc_mux_dl_cmdresps_decode_process(ipc_mux, &cmdh->param,
+							 param_len,
+							 cmdh->command_type,
+							 cmdh->if_id,
+							 cmdh->transaction_id);
+		if (ret == -EMSGSIZE)
+			break;
+
+		if (ret) {
 			size = hdr_len + sizeof(cmdh->param.flow_ctl);
-			ipc_mux_dl_acbcmd_decode(ipc_mux, cmdh, size);
+			ret = ipc_mux_dl_acbcmd_decode(ipc_mux, cmdh, param_len,
+						       size);
+			if (ret == -EMSGSIZE)
+				break;
 		}
 
 		cmd_index = next_cmd_index;
-- 
2.50.1


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH net 2/5] net: wwan: iosm: validate the ADGH datagram length
  2026-11-12 12:51 ` [PATCH net 2/5] net: wwan: iosm: validate the ADGH datagram length Fang Xieyan
@ 2026-11-16 13:55   ` netdev-bot+sashiko
  0 siblings, 0 replies; 8+ messages in thread
From: netdev-bot+sashiko @ 2026-11-16 13:55 UTC (permalink / raw)
  To: fangxy
  Cc: loic.poulain, ryazanov.s.a, netdev, johannes, andrew+netdev,
	davem, edumazet, kuba, pabeni, linux-kernel, maoyixie.tju, horms,
	m.chetan.kumar, zhugl3

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] The new ADGH length check in ipc_mux_dl_adgh_decode() is
  `adgh_len < packet_offset || adgh_len > skb->len`.

--

net: wwan: iosm: validate the ADGH datagram length

This patch adds a bounds check on the device-supplied adgh->length in
ipc_mux_dl_adgh_decode(). The block is dropped unless the length covers
packet_offset and fits within skb->len. Without the check, a short length
wraps the payload size computed as adgh_len - packet_offset.

> diff --git a/drivers/net/wwan/iosm/iosm_ipc_mux_codec.c b/drivers/net/wwan/iosm/iosm_ipc_mux_codec.c
> index 5c33171ca7012..b573067a366f0 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
> +	 * cover packet_offset and fit into the received block.
> +	 */
> +	if (adgh_len < packet_offset || adgh_len > skb->len) {

[Severity: Low]
Should the lower bound be adgh_len <= packet_offset?

With the strict comparison, adgh_len == packet_offset still passes. That
gives a datagram with no payload, and ipc_mux_net_receive() is called with
pkt_len == 0.

For example, the modem could send a 16-byte ADGH block with
adgh->length == 16. dl_head_pad_len is IPC_MEM_DL_ETH_OFFSET, so pad_len
is 0 and packet_offset is 16. ipc_mux_net_receive() then does:

	skb_pull(dest_skb, offset);
	skb_trim(dest_skb, pkt_len);

and the clone reaches ipc_wwan_receive() with len 0. That function reads
the first byte without checking skb->len:

drivers/net/wwan/iosm/iosm_ipc_wwan.c:ipc_wwan_receive() {
    ...
	if ((skb->data[0] & IOSM_IP_TYPE_MASK) == IOSM_IP_TYPE_IPV4)
		skb->protocol = htons(ETH_P_IP);
    ...
}

So skb->protocol comes from a stale byte past the datagram. The empty frame
is also counted in rx_packets/rx_bytes and passed to netif_rx(). The read
stays inside the DL buffer allocation, so this is not a memory safety
problem.

The aggregated path for the same protocol, mux_dl_process_dg(), already
rejects this case:

		if (dg_index >= le32_to_cpu(adbh->block_length) ||
		    dg_index >= skb->len ||
		    dg_len > skb->len - dg_index ||
		    dl_head_pad_len >= dg_len) {
			goto dg_error;

Would using <= here make the ADGH and ADB decoders agree?

> +		dev_err(ipc_mux->dev, "invalid ADGH length %u, skb len %u",
> +			adgh_len, skb->len);
> +		return;
> +	}
> +

[ ... ]

-- 
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261112125201.1019-1-fangxy%40xiaopeng.com

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH net 5/5] net: wwan: iosm: validate the command parameter length
  2026-11-12 12:52 ` [PATCH net 5/5] net: wwan: iosm: validate the command parameter length Fang Xieyan
@ 2026-11-16 13:55   ` netdev-bot+sashiko
  0 siblings, 0 replies; 8+ messages in thread
From: netdev-bot+sashiko @ 2026-11-16 13:55 UTC (permalink / raw)
  To: fangxy
  Cc: loic.poulain, ryazanov.s.a, netdev, johannes, andrew+netdev,
	davem, edumazet, kuba, pabeni, linux-kernel, maoyixie.tju, horms,
	m.chetan.kumar, zhugl3

Thank you for your contribution! Sashiko AI review found 2 potential
issue(s) to consider.

Critical: 0 · High: 0 · Medium: 1 · Low: 1

If you believe none of the issues are legitimate, please reply to each
issue of Medium severity or higher and explain why the AI is wrong.
If any of them are legitimate and you plan to respin, please let patchwork
know by including "pw-bot: cr" as a separate line at the end of your reply
(one such reply per series is enough).

- [Medium] In ipc_mux_dl_cmd_decode() (MUX Lite path,
  drivers/net/wwan/iosm/iosm_ipc_mux_codec.c:338-345), once cmd_len >=…
- [Low] This commit is tagged 'Cc: stable@vger.kernel.org' (Fixes:
  9413491e20e1) but depends on the preceding series commit "net: wwan:…

--

net: wwan: iosm: validate the command parameter length

This patch works out a parameter length for each received DL command. For
MUX Lite it comes from cmd_len. For aggregated blocks it comes from
next_cmd_index, or from skb->len for the last command. The union member
each command type uses is checked against that length. A parameter that is
too short returns -EMSGSIZE, the callers drop the command, and in the
aggregated path the walk of the command chain stops.

> diff --git a/drivers/net/wwan/iosm/iosm_ipc_mux_codec.c b/drivers/net/wwan/iosm/iosm_ipc_mux_codec.c
> index aea4cd9ec20d3..bd6c82746cc4a 100644
> --- a/drivers/net/wwan/iosm/iosm_ipc_mux_codec.c
> +++ b/drivers/net/wwan/iosm/iosm_ipc_mux_codec.c
> @@ -185,6 +185,7 @@ void ipc_mux_netif_tx_flowctrl(struct mux_session *session, int idx, bool on)
>  
>  static int ipc_mux_dl_cmdresps_decode_process(struct iosm_mux *ipc_mux,
>  					      const union mux_cmd_param *param,
> +					      size_t param_len,
>  					      __le32 command_type, u8 if_id,
>  					      __le32 transaction_id)
>  {

[Severity: Low]
This patch has Cc: stable and Fixes: 9413491e20e1. Its context, though,
depends on the earlier series patch "net: wwan: iosm: pass the DL command
parameter by pointer", which has neither a Cc: stable nor a Fixes: tag.

In the stable trees, ipc_mux_dl_cmdresps_decode_process() still takes
union mux_cmd_param by value, and the callers pass cmdh->param. The
prerequisite also introduced two things this patch changes:

  - the acb->got_param = *param line removed here
  - the ipc_mux_dl_acbcmd_decode() body rewritten here

So this patch won't apply on its own.

Suppose the length checks are adapted by hand onto the by-value signature.
Each call would still copy the full 12-byte union out of the skb before
param_len is checked, so the over-read this series removes would remain.

The fix also relies on "net: wwan: iosm: bound the ACBH command chain
walk" and "net: wwan: iosm: validate the MUX DL block length".

Could the prerequisite be tagged for stable as well? Alternatively, the
prerequisite annotations from Documentation/process/stable-kernel-rules.rst
would make the ordering clear to backporters.

[ ... ]

> @@ -315,19 +329,36 @@ static int ipc_mux_dl_cmds_decode_process(struct iosm_mux *ipc_mux,
>  static void ipc_mux_dl_cmd_decode(struct iosm_mux *ipc_mux, struct sk_buff *skb)
>  {
>  	struct mux_lite_cmdh *cmdh = (struct mux_lite_cmdh *)skb->data;
> +	size_t hdr_len = offsetof(struct mux_lite_cmdh, param);
> +	size_t param_len;
>  	__le32 trans_id = cmdh->transaction_id;
> -	int size;
> +	u16 cmd_len;
> +	int ret, size;
>  
> -	if (ipc_mux_dl_cmdresps_decode_process(ipc_mux, &cmdh->param,
> -					       cmdh->command_type, cmdh->if_id,
> -					       cmdh->transaction_id)) {
> +	cmd_len = le16_to_cpu(cmdh->cmd_len);
> +	param_len = skb->len > hdr_len ? skb->len - hdr_len : 0;
> +	/*
> +	 * A cmd_len below the header is not a usable declaration: the
> +	 * received length stays the limit, as for a legacy device.
> +	 */
> +	if (cmd_len >= hdr_len)
> +		param_len = min_t(size_t, param_len, cmd_len - hdr_len);
> +
> +	ret = ipc_mux_dl_cmdresps_decode_process(ipc_mux, &cmdh->param,
> +						 param_len,
> +						 cmdh->command_type,
> +						 cmdh->if_id,
> +						 cmdh->transaction_id);
> +	if (ret == -EMSGSIZE)
> +		return;

[Severity: Medium]
Can this bound reject MUX Lite commands that were handled before?

Once cmd_len >= 16, param_len becomes min(skb->len - 16, cmd_len - 16).

Take a FLOW_CTL with cmd_len 0x10 (the header-only minimum mentioned in
the commit message) or 17..19. It ends up with param_len < 4. The new
check in ipc_mux_dl_cmds_decode_process() then returns before the existing
backward compatibility branch runs:

	if (param_len < sizeof(param->flow_ctl))
		return -EMSGSIZE;
	...
	if (param->flow_ctl.mask == cpu_to_le32(0xFFFFFFFF)) {
		/* Backward Compatibility */
		if (cmd_len == cpu_to_le16(size))
			session->flow_ctl_mask =
				le32_to_cpu(param->flow_ctl.mask);
		else
			session->flow_ctl_mask = ~0;

That branch was added for MUX Lite in 9413491e20e1. There, size is
offsetof(struct mux_lite_cmdh, param) + sizeof(flow_ctl), so the branch
expects Lite FLOW_CTL commands whose cmd_len is not 20.

Before this patch, such a command was applied and acknowledged as long as
the mask was in the received bytes. With this patch, net_tx_stop and
flow_ctl_mask are left unchanged and no MUX_LITE_CMD_FLOW_CTL_ACK is sent.

An OPEN_SESSION_RESP with cmd_len 16..27 is affected the same way, even
when all 12 parameter bytes arrived. The chain is:

ipc_mux_dl_cmd_decode()
  ipc_mux_dl_cmdresps_decode_process() returns -EMSGSIZE
  return (silent)

The blocking ipc_mux_session_open_send() then runs out
IPC_MUX_CMD_RUN_DEFAULT_TIMEOUT and fails. The only message logged is
"OPEN_SESSION send failed".

It isn't clear whether shipping firmware uses these lengths. However, the
commit message says:

  the received length keeps the limit there, which preserves the handling
  the existing backward compatible code gives legacy devices

It also argues that cmd_len is not a hard bound on the aggregated path,
because the flow control decoder treats a mismatched cmd_len as a legacy
device. Wouldn't the same reasoning apply to MUX Lite, where that
compatibility code came from?

Should cmd_len bound the parameter only when it covers the member being
read? Or should the 16..19 and 16..27 cases at least be logged and
mentioned in the commit message?

> +
> +	if (ret) {
>  		/* Unable to decode command response indicates the cmd_type
>  		 * may be a command instead of response. So try to decoding it.
>  		 */
> -		size = offsetof(struct mux_lite_cmdh, param) +
> -				sizeof(cmdh->param.flow_ctl);
> +		size = hdr_len + sizeof(cmdh->param.flow_ctl);
>  		if (!ipc_mux_dl_cmds_decode_process(ipc_mux, &cmdh->param,
> -						    cmdh->command_type,
> +						    param_len, cmdh->command_type,
>  						    cmdh->if_id,
>  						    cmdh->cmd_len, size)) {

[ ... ]

-- 
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261112125201.1019-1-fangxy%40xiaopeng.com

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2026-11-16 13:55 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-12 12:51 [PATCH net 0/5] net: wwan: iosm: validate MUX DL lengths and offsets Fang Xieyan
2026-11-12 12:51 ` [PATCH net 1/5] net: wwan: iosm: validate the MUX DL block length Fang Xieyan
2026-11-12 12:51 ` [PATCH net 2/5] net: wwan: iosm: validate the ADGH datagram length Fang Xieyan
2026-11-16 13:55   ` netdev-bot+sashiko
2026-11-12 12:51 ` [PATCH net 3/5] net: wwan: iosm: bound the ACBH command chain walk Fang Xieyan
2026-11-12 12:52 ` [PATCH net 4/5] net: wwan: iosm: pass the DL command parameter by pointer Fang Xieyan
2026-11-12 12:52 ` [PATCH net 5/5] net: wwan: iosm: validate the command parameter length Fang Xieyan
2026-11-16 13:55   ` netdev-bot+sashiko

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®