public inbox for stable@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] wifi: mac80211: bounds-check link_id in ieee80211_ml_reconfiguration
       [not found] <0fdab034a93626704d84eefbda652f5bfcbeac7e.camel@sipsolutions.net>
@ 2026-02-20 10:11 ` cr-ArielSilver
  2026-02-23 11:34   ` Johannes Berg
  0 siblings, 1 reply; 2+ messages in thread
From: cr-ArielSilver @ 2026-02-20 10:11 UTC (permalink / raw)
  To: johannes; +Cc: torvalds, kuba, pabeni, Ariel Silver, stable

From: Ariel Silver <arielsilver77@gmail.com>

link_id is taken from the ML Reconfiguration element (control & 0x000f),
so it can be 0..15. link_removal_timeout[] has IEEE80211_MLD_MAX_NUM_LINKS
(15) elements, so index 15 is out-of-bounds. Skip subelements with
link_id >= IEEE80211_MLD_MAX_NUM_LINKS to avoid a stack out-of-bounds
write.

Fixes: 8eb8dd2ffbbb ("wifi: mac80211: Support link removal using Reconfiguration ML element")
Reported-by: Ariel Silver <arielsilver77@gmail.com>
Signed-off-by: Ariel Silver <arielsilver77@gmail.com>
Cc: stable@vger.kernel.org
---
 net/mac80211/mlme.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -7073,6 +7073,10 @@ static void ieee80211_ml_reconfiguration(struct ieee80211_sub_if_data *sdata,
 		control = le16_to_cpu(prof->control);
 		link_id = control & IEEE80211_MLE_STA_RECONF_CONTROL_LINK_ID;
 
+		if (link_id >= IEEE80211_MLD_MAX_NUM_LINKS)
+			continue;
+
 		removed_links |= BIT(link_id);
 
 		/* the MAC address should not be included, but handle it */

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

* Re: [PATCH v2] wifi: mac80211: bounds-check link_id in ieee80211_ml_reconfiguration
  2026-02-20 10:11 ` [PATCH v2] wifi: mac80211: bounds-check link_id in ieee80211_ml_reconfiguration cr-ArielSilver
@ 2026-02-23 11:34   ` Johannes Berg
  0 siblings, 0 replies; 2+ messages in thread
From: Johannes Berg @ 2026-02-23 11:34 UTC (permalink / raw)
  To: cr-ArielSilver; +Cc: torvalds, kuba, pabeni, stable

On Fri, 2026-02-20 at 10:11 +0000, cr-ArielSilver wrote:
> From: Ariel Silver <arielsilver77@gmail.com>
> 
> link_id is taken from the ML Reconfiguration element (control & 0x000f),
> so it can be 0..15. link_removal_timeout[] has IEEE80211_MLD_MAX_NUM_LINKS
> (15) elements, so index 15 is out-of-bounds. Skip subelements with
> link_id >= IEEE80211_MLD_MAX_NUM_LINKS to avoid a stack out-of-bounds
> write.
> 
> Fixes: 8eb8dd2ffbbb ("wifi: mac80211: Support link removal using Reconfiguration ML element")
> Reported-by: Ariel Silver <arielsilver77@gmail.com>
> Signed-off-by: Ariel Silver <arielsilver77@gmail.com>

I'll apply this anyway, but ...

> --- a/net/mac80211/mlme.c
> +++ b/net/mac80211/mlme.c
> @@ -7073,6 +7073,10 @@ static void ieee80211_ml_reconfiguration(struct ieee80211_sub_if_data *sdata,

How did this line happen? You're only adding 3 new lines. How is it even
_possible_ to get this wrong?!

johannes

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

end of thread, other threads:[~2026-02-23 11:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <0fdab034a93626704d84eefbda652f5bfcbeac7e.camel@sipsolutions.net>
2026-02-20 10:11 ` [PATCH v2] wifi: mac80211: bounds-check link_id in ieee80211_ml_reconfiguration cr-ArielSilver
2026-02-23 11:34   ` Johannes Berg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox