๐Ÿš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #13459

Re: [PATCH] wifi: mac80211: use frame link_id when adjusting link_sta on reorder release

#13459
From: netdev-bot+sashiko
Date: Mon, 09 Nov 2026 22:41
148 lines
14401 bytes
Thank you for your contribution! Sashiko AI review found 4 potential
issue(s) to consider.

Critical: 0 ยท High: 0 ยท Medium: 1 ยท Low: 3

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] The commit message names the wrong trigger for the link[-1]
  access.
- [Low] The commit has no Signed-off-by: line.
- [Low] The Fixes: tag is a literal placeholder ('Fixes: [fill in before
  sending - on a full clone run: git log -S ...]').
- [Low] The commit message is a bug report or cover email, not a
  changelog.

--

wifi: mac80211: use frame link_id when adjusting link_sta on reorder release

This patch changes the link-adjust block in ieee80211_rx_handlers(). When
a released frame arrived on a different link, rx->link_sta is now looked
up with the frame's own status->link_id instead of the previous
rx->link_id. This avoids indexing rx->sta->link[] with -1.

> In ieee80211_rx_handlers(), when frames are released from the BA reorder
> buffer on timeout, rx->link_sta is re-fetched using the *previous*
> rx->link_id instead of the frame's own status->link_id. For a legacy
> (non-MLO) client on an MLO access point,
> ieee80211_release_reorder_timeout() passes link_id = -1 and
> ieee80211_rx_data_set_sta() never updates rx->link_id, so the adjust
> block evaluates rcu_dereference(rx->sta->link[-1]).

[ ... ]

> nan_sched and the driver-private area that follow deflink. At minimum
> this is a remotely triggered crash on MLO APs serving legacy clients;
> worse outcomes are layout-dependent.

[Severity: Medium]
Is this the right trigger for the link[-1] access? For stations added
through nl80211 on an MLD interface, nl80211_new_station() requires a
link ID:

net/wireless/nl80211.c:nl80211_new_station() {
    ...
	if (wdev->valid_links) {
		if (params.link_sta_params.link_id < 0)
			return -EINVAL;
    ...
}

ieee80211_add_station() then goes through sta_info_alloc_with_link().
__sta_info_alloc() sets valid_links for non-MLO stations as well:

	if (link_id >= 0) {
		sta_info_add_link(sta, link_id, &sta->deflink,
				  &sta->sta.deflink);
		sta->sta.valid_links = BIT(link_id);

So ieee80211_release_reorder_timeout() picks a real link:

	if (sta->sta.valid_links)
		link_id = ffs(sta->sta.valid_links) - 1;

ieee80211_rx_data_set_sta()->ieee80211_rx_data_set_link() then sets
rx->link_id to the station's own link. That matches status->link_id, so on
this path a legacy client never enters the adjust block.

Before this patch, the caller that does reach rx->sta->link[-1] seems to
be ieee80211_mark_rx_ba_filtered_frames(), which always passes -1:

	if (!ieee80211_rx_data_set_sta(&rx, sta, -1))
		return;

On an MLD vif with a station that has valid_links set (MLD or legacy),
this leaves rx->link_id at -1. status->link_id is an unsigned 4-bit field,
so the first released frame always takes the mismatch branch.

In-tree, only iwlwifi mvm calls ieee80211_mark_rx_ba_filtered_frames().
MLO-capable mvm hardware sets SUPPORTS_REORDERING_BUFFER, so
___ieee80211_start_rx_ba_session() never assigns tid_rx and the function
returns early.

The reorder timeout path could only hit link[-1] if an MLD vif held a
station with valid_links == 0. nl80211 doesn't appear to create such a
station.

The code change looks correct for all of these paths. It also fixes the
MLD peer case, where stats go to the previous frame's link.

Could the changelog describe the actual trigger and its driver dependence,
instead of "a remotely triggered crash on MLO APs serving legacy clients"?
As written, it may mislead severity triage and stable backport decisions.

> Affected version/commit: mainline fa4ad798f6f681031775266044ba1b0cf3c670bd (v7.4-rc1, 2026-11-07), net/mac80211/rx.c:4243-4255 (adjust block), rx.c:4375-4404 (ieee80211_rx_data_set_sta), rx.c:4410-4426 (ieee80211_release_reorder_timeout).
> Introduced in the v7.4 merge window (regression vs v7.3).
>
> This was found during an assisted (AI-supported) static source review of
> mainline fa4ad798f6f681031775266044ba1b0cf3c670bd (v7.4-rc1, 2026-11-07); every code path cited below was re-verified by the
> reporter against that tree. The patch below has NOT been compiled and has
> NOT been runtime tested, and no reproducer was produced - the triggering
> conditions are described above instead. Please treat this as a report for
> verification rather than a battle-tested fix.

[Severity: Low]
This isn't a bug, but the changelog reads like a cover email rather than
a commit message. It opens with "Hello,", refers to "The one-word fix
below" and "every code path cited below", and includes tree-specific rx.c
line ranges that will go stale once the patch is applied.

Could the greeting, the rx.c line references and the review and testing
notes move below the --- separator? The note that the patch is untested
is still needed, but it doesn't belong in the permanent changelog.

> Fixes: [fill in before sending - on a full clone run:
>   git log -S 'rcu_dereference(rx->sta->link[rx->link_id])' --oneline -- net/mac80211/rx.c]

[Severity: Low]
The Fixes: tag is still a placeholder. git blame on the adjust block in
ieee80211_rx_handlers(), including the rx->sta->link[rx->link_id] line,
points to:

Fixes: 4db13371e217 ("wifi: mac80211: refactor RX link_id and station handling")

That commit also removed status->link_valid, started deriving
status->link_id from rx->link_id in ieee80211_prepare_and_rx_handle() and
ieee80211_invoke_fast_rx(), and left callers such as
ieee80211_mark_rx_ba_filtered_frames() passing link_id = -1.

> Reported-by: [your name and email]

[Severity: Low]
The trailers have no Signed-off-by:, and the Reported-by: is a
placeholder. Documentation/process/coding-assistants.rst says that when
an AI assistant was used, the human submitter must add their own
Signed-off-by to certify the DCO. submitting-patches.rst also requires
one.

Could a Signed-off-by be added, and the placeholder Reported-by: either
filled in or dropped?

-- 
Sashiko AI review ยท https://netdev-ai.bots.linux.dev/sashiko/#/patchset/Sq80dyNRnQWE5H_yZYIwxaQiwgvIrIlET6kND66_K0UpnKQZruHroWDq6hlYKDM0y9e2vXW2UBlBmnjw3bCLKk1Acrp7F49_jk883tbCqxk%3D%40proton.me
Technical Details
Message-ID: <179426409490.994134.13077118770469155374@kernel.org>
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-359647-linux-kernel-netdev=dewy.ru
References: <Sq80dyNRnQWE5H_yZYIwxaQiwgvIrIlET6kND66_K0UpnKQZruHroWDq6hlYKDM0y9e2vXW2UBlBmnjw3bCLKk1Acrp7F49_jk883tbCqxk=@proton.me>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-359647-linux-kernel-netdev=dewy.ru
From: netdev-bot+sashiko@kernel.org
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH] wifi: mac80211: use frame link_id when adjusting link_sta
 on reorder release
Date: Mon, 09 Nov 2026 22:41:34 +0000
Organization: Usenet Network
Message-ID: <179426409490.994134.13077118770469155374@kernel.org>
References: <Sq80dyNRnQWE5H_yZYIwxaQiwgvIrIlET6kND66_K0UpnKQZruHroWDq6hlYKDM0y9e2vXW2UBlBmnjw3bCLKk1Acrp7F49_jk883tbCqxk=@proton.me>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="466326"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:/ZKAkBNriAwG19BBrFFXCxna3vA= sha256:gzOCWprkYq4DA414YL/vb3e5O9JX/2ZOlD7QrPNa04E=
	sha1:C3ZvPkIHyeXNNCox7+a+svuUpOo= sha256:SXQP3qqccuEoMAABS6XlcajIX0a2QU/zZr806Ak20HU=
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 38C5C11395C; Tue, 10 Nov 2026 01:43:17 +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 i952jBkBZggQ;
	Tue, 10 Nov 2026 01:43:13 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-359647-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 1CB52113924; Tue, 10 Nov 2026 01:43:05 +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 3C6DA2A6E3; Mon,  9 Nov 2026 22:41:44 +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=1794264102;
	b=0MaKn12RGawmuHA4HJMaUPFRtKwUmWlYxz6l9XHJuVtZHWoENPTaFPXhran/wJICt/bS
	 wW02RVcAusXTDKezY4HETcWKt22jr3lxkumuaoroVo9XXwIu1wzRAi67T5fA38dfPzzUp
	 het0vYsgkfwdaxxzkGVrVvYj7LBMg7NiVvPDoStmVHoaNmIBIlPOYZr4gUIkQDCjA9eNb
	 fUcu/NC/BfUBg22TKq6MdryQNwB78YhZULMWx1kGLsLoP5kCDY8SqX+SpKP+rUVbfHcqj
	 a8k2n7xFUaGm9DYSCYmJtyS/kZPQvR/GvJYcSbTj/RXUEpTv1k736SHd2a5pGfgLTDg==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1794264102;
	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=0FmOT40SSGTEJ8nAUd6PHhQJfpkzfaV1DQZc2IL/c4g=;
	b=yCmtBPoTtWBUtZ1GkAhR6iKUqhPz0xvjzZVmrS4LUhYWRCt2yd6McL641wprODQwUlUP
	 zVaLNJJIQlz9Vppgv44OPUIdB1u34Ui2V1dtyEGZ14MQDsJraiw6Dpr33q8wC5PXP5p2K
	 GiyzQdjZcJsTadZQ16qXEbnLGwbJM9C9ZjKwK4WqUvexgaduw9dA0Ra32gN4wUg1Qs+p9
	 KOd0NS2awbHPFAB3cwX5v+Sr2LxketDWh5HfBCzmIJIQqFVIpvhvBovq8CQQnEqMOL6Sz
	 jyycaU8d5Dn7dijgOJIgyEoYgKhZTffErCCJhEitgu3rZFb9x27VrBdEKU9r8Rtvshw==
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=OvGAT3WY;
	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 4A594606A334;
	Mon,  9 Nov 2026 22:41:42 +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=OvGAT3WY
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=1794264096;
	b=1TnbKzgdQiva48aU8FsepbLAxErT/SLAGxG7WUuKD75XR8DRwuqJIB34WT0PSTZvkGaL
	 vtG4NIPLlK5EGsN78EPOdV7rB2a83DaMDFKAPjy/2ZHenRdkhCElUUJzs36gUhq5xHTCs
	 lV0uKbjrXkqRwmGD0vmHHgpr8phFopoq584cDibI/GD/6A1zunKcq39k0sQqfHTAVlvOs
	 hTuBHr3p0T8bhzuuXd1TOAyKqLTdZsrbPV3y5PQ6Md8FIK1v4N/o9GKhYrDXX3kOZrfWt
	 hCwZwyzygyId9+pu+z9EhpriEmHq+D7XxsWu9iKhydVrv13OCmGHr/oxcWS66t8tUiw==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1794264096;
	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=0FmOT40SSGTEJ8nAUd6PHhQJfpkzfaV1DQZc2IL/c4g=;
	b=GM20zFJrHCRezueQJdeCEjfixuEsKubO04bc82CcjKq1yBbWVJGvPJg+r2AB7WUEoiDg
	 avqsdx0GnvtiRF7NfO8N0ydCszfatXmUTB7F87gQMYBhnO8vc8QE6rdMoCSHUPvE0fip2
	 bLD1OA5HQY2IcAx+uxPgROM/T10UCcSE5mPcYvYipgcEcDtkTtC6+Fn/NPDppWTykS5zX
	 8zEaK/dWRiG5cB8jH/B2sq1E/xIFfukIVSbJYuIuibv0EQI+LyOslBkkzfAP4T4bGFVPc
	 6+j+m2s8V0GRdFj9cQF0zvLyNzNcsV4Xmet4Lq+HIXs0cKo8tcs/R0t0FUeof7MmZ5w==
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=OvGAT3WY;
	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 28A55606A338;
	Mon,  9 Nov 2026 22:41:35 +0000 (UTC)
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5F7511F0089F;
	Mon,  9 Nov 2026 22:41:35 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1794264095;
	bh=0FmOT40SSGTEJ8nAUd6PHhQJfpkzfaV1DQZc2IL/c4g=;
	h=Subject:From:To:Cc:Date:In-Reply-To:References;
	b=OvGAT3WY2lqJf+x65niUYy5RRXbHypKdImba1ImF2KnOYLPiHNrnuaCU1Ox4OE9nt
	 ld0MqAux4mV9fqrmQronw0F6vz9DHtLAs3FUXvtdQgZm10geCm5KYQ6E72cMmhn5dt
	 GSKeMwuPSCVIQuKY8nUCJipskiYUCyEqlPEQRioKti0PFrC4rdaeFTGTXt40jnxqY9
	 c/IijNAkiNbb92f5XF6Fj1LS0/n24w1jojrxele/eEEp4NC8xHUSu54eKiS2Km6lQU
	 4I1N2HjmBaClR59cLXr38UB3dbNRECiqXVn3dRCVwsm0gTMtvsFczwirw9YBnQJDhL
	 VamZJWECPpoIA==
X-Cc: johannes@sipsolutions.net, linux-wireless@vger.kernel.org,
 netdev@vger.kernel.org, linux-kernel@vger.kernel.org, security@kernel.org,
 kuba@kernel.org
X-In-Reply-To: <Sq80dyNRnQWE5H_yZYIwxaQiwgvIrIlET6kND66_K0UpnKQZruHroWDq6hlYKDM0y9e2vXW2UBlBmnjw3bCLKk1Acrp7F49_jk883tbCqxk=@proton.me>
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