Article View: linux.kernel.netdev
Article #20172Re: [PATCH net v2 3/5] net: wwan: iosm: bound the ACBH command chain walk
From: netdev-bot+sashiko
Date: Sat, 21 Nov 2026 18:05
Date: Sat, 21 Nov 2026 18:05
108 lines
12101 bytes
12101 bytes
Thank you for your contribution! Sashiko AI review found 1 potential
issue(s) to consider.
Critical: 0 · High: 0 · Medium: 1 · Low: 0
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] This patch adds a new early return to ipc_mux_dl_acb_decode()
in drivers/net/wwan/iosm/iosm_ipc_mux_codec.c: `if (block_length <…
--
net: wwan: iosm: bound the ACBH command chain walk
This patch reworks ipc_mux_dl_acb_decode() so that every command offset
in a received Aggregated Command Block is bounded by skb->len. It also
validates next_cmd_index so the walk always moves forward. It removes
the array_index_nospec() call and adds a sanity check on
acbh->block_length.
> diff --git a/drivers/net/wwan/iosm/iosm_ipc_mux_codec.c b/drivers/net/wwan/iosm/iosm_ipc_mux_codec.c
> index 65421f6b4c91e..a8448e273c021 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)
> {
[ ... ]
> 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));
> + /*
> + * The uplink encoder leaves block_length at the ACBH header size.
> + * It cannot delimit the command chain, so use skb->len to bound
> + * the command offsets.
> + */
> + if (block_length < sizeof(struct mux_acbh) || block_length > skb->len)
> + return;
[Severity: Medium]
Could this new check drop every downlink ACB without any message on
some modem firmware?
Before this patch, the DL ACB decoder never read acbh->block_length.
Firmware has never had to keep it between sizeof(struct mux_acbh) and
skb->len. If the check fails, the function returns without logging
anything and the whole block is thrown away.
The comment above says block_length cannot delimit the command chain.
The loop below already bounds every command offset by skb->len. So the
check doesn't seem to add memory safety. Its only effect is that
commands can be dropped.
The only evidence of what this field holds comes from the host's uplink
encoder:
drivers/net/wwan/iosm/iosm_ipc_mux_codec.c:ipc_mux_acb_init() {
...
header->block_length = cpu_to_le32(sizeof(struct mux_acbh));
header->first_cmd_index = header->block_length;
...
}
ipc_mux_acb_add_cmd() never updates it. That doesn't match the
kernel-doc for struct mux_acbh in iosm_ipc_mux_codec.h:
* @block_length: Length (in bytes) of the Aggregated Command Block.
It also suggests the modem doesn't rely on this field in UL ACBs.
Nothing in the tree shows what the modem writes in DL ACBs.
If a firmware writes 0 here, or a value larger than the transfer,
wouldn't every DL ACB be dropped? Some of the effects:
MUX_CMD_OPEN_SESSION_RESP is never processed. ipc_mux_session_open()
then times out waiting for acb->got_response and fails.
IOSM_AGGR_MUX_CMD_FLOW_CTL_ENABLE/DISABLE are never applied.
session->net_tx_stop and session->flow_ctl_mask are not updated, and
no FLOW_CTL_ACK is sent.
LINK_STATUS_REPORT is never answered.
The ADB path isn't really a precedent. mux_dl_process_dg() checks each
datagram index against adbh->block_length as well as skb->len. ACBH
block_length, by contrast, was never read on the DL path before this
patch.
The check is still there after the later patch in this series, "net:
wwan: iosm: validate the command parameter length".
Is the block_length check needed here, since skb->len already bounds
the command chain walk?
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261117173940.34970-1-fangxy%40xiaopeng.com
Technical Details
Message-ID:
<179528433079.3135.7229744100791190249@kernel.org>Path:
mbox-mo1.pugleaf.net!news-wdc.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-368382-linux-kernel-netdev=dewy.ruReferences:
<20261117173940.34970-4-fangxy@xiaopeng.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-wdc.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-368382-linux-kernel-netdev=dewy.ru From: netdev-bot+sashiko@kernel.org Newsgroups: linux.kernel.netdev Subject: Re: [PATCH net v2 3/5] net: wwan: iosm: bound the ACBH command chain walk Date: Sat, 21 Nov 2026 18:05:30 +0000 Organization: Usenet Network Message-ID: <179528433079.3135.7229744100791190249@kernel.org> References: <20261117173940.34970-4-fangxy@xiaopeng.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Injection-Info: usenet.network; logging-data="3461694"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:TBWLQLnnBbwxMhTTLgk0DbPZ5C0= sha256:+rH/gwFoAA+6V07FMmgHa07FXhAK8jX9xJwWHpb897k= sha1:ddQp/yIcmUEbU5Fa6oW/o2Iyuxc= sha256:HdLLOKF/HDa7c3WjMiQrrC4wZUkdGNRZA2e2TeU4qrU= 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 86811115BA6; Sat, 21 Nov 2026 21:05:55 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.401 X-Spam-Status: No, score=-3.401 tagged_above=-9999 required=6.31 tests=[DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key) header.d=kernel.org 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 N1TCv_Bi0Xbp; Sat, 21 Nov 2026 21:05:51 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-368382-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> X-Authentication-Results: OpenDMARC; dmarc=pass (p=quarantine dis=none) header.from=kernel.org X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10]) by mail.dewy.ru (Postfix) with ESMTPS id D500A115B50; Sat, 21 Nov 2026 21:05:42 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by sea.lore.kernel.org (Postfix) with ESMTP id 12E0226F89; Sat, 21 Nov 2026 18:05:39 +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=1795284338; b=pvalB0Ow4J817to8wV2ePnBkAIwgJeW2OAXqkY0xXVEzdcAdyZyN6SdhPavw/Haz2PoL B9ICGfDUKIvcu6KM6MTojDMY+wPXuy1BpJU5/mCYnNaApLRnXm/beAZ3y8dxZCSa+FnfD MOvUfFV1Ncgh8ykz17zi1nhYWlz0FBin0rWxBn3drh6+ooYNKHq4HyRTYYMnNXxUiY95c b/72i/CG/Ljpnwl32P2CxKSgnc1pFkkV4l2NECq8551OMJwWJdwDm3rIAE9X3C3HgS/CP U3u7245GTOnrNvlBglQYhu2N0enBRzIvFY6jol4kE+po5Vo98DUrV1dDlaGZYF52h0A== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795284338; h=X-Original-To:Received:Received:DKIM-Signature:Subject:From:To:Cc: Date:Message-ID:In-Reply-To:References:X-sashiko-severity: Content-Type:Content-Transfer-Encoding:X-Mailing-List:List-Id: List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner: Precedence:MIME-Version; bh=pYt6gsq2OH3wlZNEVbjnaadPXz5Sn2AC2yTJX2nCaPA=; b=n0XpK+t5qcRQPEBwFcW3hj45Yrn0YJFGyoj6LbntQ7C6e77+e/1tUB6iv/zWfyEt5oDz 7ApJG2TStR30yUzvxFn7gRRpZq2qkahcl5MlHfjaiqAot8x0vLKSbW/Vpd0ta/hLDoYQY LR1BY51rK73rr7ySureBIT1PSXQi6PPiVLuVWdMuXnVCqCR81lRW2DzN8/TsBBPLxiQEj U4EL6JJpYX/A9nk8emtwDxKS4TN0WoWRnoBLdiVP7zlDFJFOv7myYvs1x80s7wKbHYZv3 TJNxYBHX4B2R0Q7W2wlYqXGQybOEzd0hg8J46XPlupVShM9dsROKK8ZK6U6A9AtRwLw== X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=GyhEwY5X; 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 67BF8606A339; Sat, 21 Nov 2026 18:05:38 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=GyhEwY5X X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795284332; b=SryxcBmskxs7TyQN0Oxvr7aR3LDaQRFkX6Alt5aBIEDqVDBcDI4Wd7/SBxjFe5JTQ/Nz PcpM4tBrCVYSqXSZdAY3BvmvuPbaYqIZUBRiBwk4kQglmmEt2CsoZsf3NO5q80y2KuKhh 0sozw61NdkA34mb4HWF6Puz80Q4S1iYR4oFb2zUDxBY4ZDtXYhJfHJyeR/aY10fJNt+dZ gRZbdw2XQXJyeQVyB75QAjT9w8VIdmTEc85Fkpv1gzptck/rfqhAxLItviqypAbXtjJC5 63zuHZobzBFcRIkZp15DbtBJ6NqR//PdZ1ZgCueNURaQKPI9B0n156pCS6pQAW+SWlg== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795284332; h=Received:DKIM-Signature:Subject:From:To:Cc:Date:Message-ID: In-Reply-To:References:X-sashiko-severity:Content-Type: Content-Transfer-Encoding:MIME-Version; bh=pYt6gsq2OH3wlZNEVbjnaadPXz5Sn2AC2yTJX2nCaPA=; b=O3bS75wt+QMIeucFqBn+FVAuJ8p0vaQ9F4GU05NfMHODohZVjvCkfp306BnSo/Q4RAPD 4c3GcIjNpZ2V/nYfjH7rHIvqpCMpFlnDH6WUOFZAs8hwQNgGENduXbj4GeM7FA3Npl+BV 1m90JWi5PD8m7uDQApcaahN9GtNXxz8c/To40c069v1YDzY23hSqqG31iNcNHpHGrBpwp gP/R5A7okRE5Nnm1L3LNAt0bEMywfeCb//CTnnJYKaRtzsRCeYRPWsSylEoywORxi9ee7 9HRQxdZDrLlQd2U1eH3RQLUeIHe0Pwj+pQa1glm59/pnC5PCLG5xVzt70PwuXDNbUqw== X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=GyhEwY5X; arc=none smtp.remote-ip=100.103.45.18 X-Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7E9A8606A32C; Sat, 21 Nov 2026 18:05:32 +0000 (UTC) X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 413AF1F000C0; Sat, 21 Nov 2026 18:05:31 +0000 (UTC) X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1795284332; bh=pYt6gsq2OH3wlZNEVbjnaadPXz5Sn2AC2yTJX2nCaPA=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=GyhEwY5XLGQoSMrD1HQGMj9zW4Rdym9pWExcDFB/ayobWxHFH7sIKfk3+rfnKXVB8 qYkSZ9eUBQbrtLtsM572AqKBwluP5rCBPSDHbAu48EZEmG51G9ROBO5Zcr9y9+FYxn vQ1UOMKnDDEv+fUJEeC3URphLewaCrG2b4iZb7xbCEi/xNZJe/4WUjtuRKu6iiHZCm 2eDRg4CGWHOAY286LDDKC2SlsEQXZk5Tyt1k/SxSA5Zis6/iSvxTCvgOikdAmzm6mm Zo2I0mkJyX0p+FqaFoFX8agcGTOuU4dJEyQGiOVGd24+s4XOYlKqHnUFkhJVoxfhix S9mFo8P6WiQNg== X-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, linux-kernel@vger.kernel.org, stable@vger.kernel.org, zhugl3@xiaopeng.com X-In-Reply-To: <20261117173940.34970-4-fangxy@xiaopeng.com> X-sashiko-severity: Medium 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