Re: [PATCH v3] wifi: rtw89: add bounds check on firmware mac_id in link lookup

Johannes Berg
2026-04-21T11:05:32Z

On Tue, 2026-04-21 at 11:01 +0000, Tristan Madani wrote:
>
> diff --git a/drivers/net/wireless/realtek/rtw89/core.h b/drivers/net/wireless/realtek/rtw89/core.h
> index XXXXXXX..XXXXXXX 100644
> --- a/drivers/net/wireless/realtek/rtw89/core.h
> +++ b/drivers/net/wireless/realtek/rtw89/core.h
> @@ -6435,6 +6435,9 @@ static inline struct rtw89_sta_link *
> rtw89_assoc_link_rcu_dereference(struct rtw89_dev *rtwdev, u8 macid)
> {
> + if (unlikely(macid >= RTW89_MAX_MAC_ID_NUM))
> + return NULL;
> +
> return rcu_dereference(rtwdev->assoc_link_on_macid[macid]);
> }

Also, I have no idea how you're generating these patches, but please
don't do whatever you're doing.

You have "X-Mailer: git-send-email 2.47.3" in there, but there's no way
git would have created such corrupt patches. Also the "index XXXXX"
thing seems to point to some (fairly pointless since it's just hashes)
post-processing.

Please stop sending patches until you've figured out how to generate
patches that can actually (and reproducibly) be *applied*.

johannes