πŸš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #24897

Re: [PATCH net 09/14] net: phy: as21xxx: Reject odd IPC payload lengths

#24897
From: netdev-bot+sashiko
Date: Tue, 01 Dec 2026 01:50
74 lines
10590 bytes
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 commit message and its `Fixes: 830877d89edc` tag present this
  patch as a fix for a live defect: an odd `data_len` drops the last…

--

net: phy: as21xxx: Reject odd IPC payload lengths

This patch adds a check to aeon_ipc_send_msg() that rejects payload
lengths that are not a multiple of the 16-bit IPC data register width.
The commit message says an odd length drops the last byte and that the
firmware then reads stale register contents. The patch carries a Fixes:
tag for the original driver commit.

> The IPC payload is transferred through 16-bit data registers, but
> aeon_ipc_send_msg() advertises data_len bytes to the firmware while
> writing only data_len / 2 registers.  For an odd length the last byte is
> silently dropped, and the firmware reads whatever was left in the next
> register.
>
> Reject payload lengths that are not a multiple of the register width.
>
> Fixes: 830877d89edc ("net: phy: Add support for Aeonsemi AS21xxx PHYs")

[Severity: Low]
Can any in-tree caller actually pass an odd data_len to
aeon_ipc_send_msg()?

The function is static in drivers/net/phy/as21xxx.c. Every caller passes
sizeof() of a local u16 array, so data_len is always even:

drivers/net/phy/as21xxx.c:aeon_ipc_get_fw_version() {
    u16 ret_data[AEON_IPC_DATA_NUM_REGISTERS], data[1];
    ...
    ret = aeon_ipc_send_msg(phydev, IPC_CMD_INFO, data,
                            sizeof(data), ret_data);
    ...
}

drivers/net/phy/as21xxx.c:aeon_dpc_ra_enable() {
    u16 data[2];
    ...
    return aeon_ipc_send_msg(phydev, IPC_CMD_CFG_PARAM, data,
                             sizeof(data), NULL);
}

The callers added later in the series also pass even lengths.
aeon_restart_aneg() uses u16 data[3], which is 6 bytes, and
aeon_set_top_speed() uses u16 data[4], which is 8 bytes.

So the new check never fires on any current path. It looks like
hardening against future misuse rather than a fix for a reachable bug.

Could the commit message say that no existing caller is affected? Should
the Fixes: tag be dropped so this isn't picked up for stable as a bug
fix?

The commit message also doesn't say why odd lengths are rejected instead
of rounded up. The receive path in the same function accepts an odd byte
count and rounds up:

    for (i = 0; i < DIV_ROUND_UP(ret_size, sizeof(u16)); i++) {

Could the commit message explain why the send side rejects odd lengths
instead?

-- 
Sashiko AI review Β· https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261130-as21xxx-fixes-v1-0-1bd2eae6ccbc%40collabora.com
Technical Details
Message-ID: <179608985578.3146.12784918968376120755@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-374617-linux-kernel-netdev=dewy.ru
References: <20261130-as21xxx-fixes-v1-9-1bd2eae6ccbc@collabora.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-374617-linux-kernel-netdev=dewy.ru
From: netdev-bot+sashiko@kernel.org
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net 09/14] net: phy: as21xxx: Reject odd IPC payload lengths
Date: Tue, 01 Dec 2026 01:50:55 +0000
Organization: Usenet Network
Message-ID: <179608985578.3146.12784918968376120755@kernel.org>
References: <20261130-as21xxx-fixes-v1-9-1bd2eae6ccbc@collabora.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="1586972"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:KSbYjoWCe9oINCQ8Lz7LIUpMFSI= sha256:tqcGMUEtArjT0e6vQU+HQysQJ6yP7vXnnwDPuJM+naM=
	sha1:CF+ApzxBQxHKuu0R9jt07/UQTUY= sha256:4MWY7W27bLcTvZUxrbXt8JyaV3vTw016nzkCYQVqqkY=
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 702541171F7; Tue,  1 Dec 2026 04:51:20 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.5
X-Spam-Status: No, score=-3.5 tagged_above=-9999 required=6.31
	tests=[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,
	URIBL_BLOCKED=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 QfNUxaqJYfN9;
	Tue,  1 Dec 2026 04:51:17 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-374617-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 tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114])
	by mail.dewy.ru (Postfix) with ESMTPS id 37A9B1171F0; Tue,  1 Dec 2026 04:51:04 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by tor.lore.kernel.org (Postfix) with ESMTP id DB3CD26371; Tue,  1 Dec 2026 01:51:00 +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=1796089858;
	b=zM6RdUr2WkQ/4EcUe2mUuct3bc8j8tDyH0IbS0i4181IgB3WhJ1YRwFWTrrionAK32o/
	 ZKldx7e8Y+FSOTPABNZ+JDDkPmkGERHKzjVqi8N8zjJD1ej3KFdLMcmnxtkVE8BgTChIQ
	 6Q1RUlZzSJqUZe2m3HsguZG0o3tvyA58CzUP4H9JL+bjpc7nK65gASLFvGcfzS78rsX28
	 +H3cxiDV/Y5isgYF36UUsMuy9S5PGrCMrHK2RdwmSec3j6tmp5m+bx03OAGA8TZxnU1ab
	 mIuQAVoofxS7oo/CP8yT5kXdtzD2MF2Trk6oI4VrhAEmcRpckLXk3BHmgEM91U+NKIA==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1796089858;
	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=y1r9v9ejm/K8Ow8P01Z6/m2/nb7jDdBm79mi61sUH4A=;
	b=qK6J3c6oCyx31llRRXdl7SGMeJOOJ25e6HigoKCL9WXxVNe2bRdfizGCykbfcu9WqELi
	 Fx82MY5KmPuADSQnHr4Rmqg2BxqZEmoGITwMHXhEoYiFTarFzOvNVavGiyrTFaLmy6hp7
	 yYuZD155MvEaAYzvyhynxWtIuykKOHdKeteX09P1oYpQePi4A6qhp625ZSG7ZtJOo4uK5
	 Y0ygmZ7XloTA9mA7gp2ReJj7GScSa4C0hSARzieLw1TXu9KkoIophauak0LTTC1MjLQE9
	 qlptSXEO0llClgAZtWsuCRZE+bURe+X/fUJwA269nB1wEF+Llm8wGgV+0Y+puh3DMUA==
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=F+r7TGrH;
	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 147F2606A335;
	Tue,  1 Dec 2026 01:50:58 +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=F+r7TGrH
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=1796089857;
	b=jiAsMiCQNkyILJUicVy2SFSiVYpxFcAiDswnwJVcwZgGu+jzYY0KDG0AdwGbEQ+g7Mnw
	 M3IgW+Txes3mEm8Vg3+hTbE3Vc74xwkf1Paq8OAFLiDcHb0wwRsn+4Bxrz4V7AR/cUYmW
	 M0GMPgDa13PcAm9veRaxy0KjfbPrhGHqxpIk2hKsrYJYtext4apRn3m54GwiR85TZTNmM
	 Ir/EuKAlYHOogTg/MEcWfoExw15nOxDS019FJKjRVO+lgS4B/Le+zo41kCN+C8NbxTNqx
	 BH14Kd7lWfTKcZBCm+mAgvoG2v1QaIbgPLc0w8Rwe3TzQKUKTB+umZbu0Hna4WtFGOQ==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1796089857;
	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=y1r9v9ejm/K8Ow8P01Z6/m2/nb7jDdBm79mi61sUH4A=;
	b=Zi5JBkvCNf7o5SpO1tBzBgesZVOIQHJvCzrySqcO1aX2QEbi2iWR4Eo54uGWtpPftZ88
	 94UXrjn+0LiD5uWS0Vf9QsR2/hcN/B3S5qXA8348JhO1buACiaMopZ3uWTZe6dOp/INkn
	 dPj7ELnUN/SHSsFEpzTTPM1IwEbDftK7htp7H46G+9PqjHIOJ90m3wvDoebpHlvkwRioO
	 sqUxD3f18P2WMH1fu+Y984bNOrQdAjKj2otYidvA/BnuGmvpr4I5hF7UHXl3EQlVriI4G
	 O73CZHXhC6Ldcn33WLQB4xs3eTo54ODWYd6/M1q76/UsuHlNz1AB6WsvTvlqGUuFlXw==
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=F+r7TGrH;
	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 35DF5606A32D
	for <netdev@vger.kernel.org>; Tue,  1 Dec 2026 01:50:56 +0000 (UTC)
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3A6BC1F00897;
	Tue,  1 Dec 2026 01:50:56 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1796089856;
	bh=y1r9v9ejm/K8Ow8P01Z6/m2/nb7jDdBm79mi61sUH4A=;
	h=Subject:From:To:Cc:Date:In-Reply-To:References;
	b=F+r7TGrHzAMFKVpG91BtBVbfRNSENQ45S9PnZZSSW0tM6w9A3xG/AgtcmkbNXGVc1
	 dcxmqVconMqLF7k5MdF3zYCqwL8kMM6xwyzKQ6RNJ8N8cECVHfcIfaP6Wygi/ipagZ
	 hyRl7shRcAyc954iQkYeJyfq1qeX10JsjloNpmaqth6r3LBplAl7AX3kT+UAwpLWia
	 eVZ+PgoCdKQ9QyjM8KKhU25mjEkNFbCieagG5x0iVQWrxEJqy4fQYPDTlL0/P372LQ
	 hzXu/GcvjaBAkWxAveiwGZRz1i4uD60bX+L+0UQe/Wd4SNhyKfiVM3i7FqCadFWpkC
	 70aERiVas/gxg==
X-Cc: ansuelsmth@gmail.com, andrew@lunn.ch, hkallweit1@gmail.com,
 linux@armlinux.org.uk, davem@davemloft.net, edumazet@kernel.org,
 kuba@kernel.org, pabeni@redhat.com, kernel@collabora.com,
 netdev@vger.kernel.org
X-In-Reply-To: <20261130-as21xxx-fixes-v1-9-1bd2eae6ccbc@collabora.com>
X-sashiko-severity: Low
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