Re: [PATCH v2] wifi: mwifiex: validate action frame fixed fields
From: Zhao Li
Date: Thu Jul 23 2026 - 16:23:55 EST
On Thu, 23 Jul 2026 at 16:41:27 +0200, Francesco Dolcini wrote:
> I am confused, why is this check needed here, and not done in
> mwifiex_process_mgmt_packet()?
I double-checked the arithmetic and, yes, I made a mistake. The header
check is redundant while the other two checks are needed.
mwifiex_process_mgmt_packet() already validates:
if (pkt_len < sizeof(struct ieee80211_hdr) + sizeof(pkt_len)) {
After subtracting sizeof(pkt_len), the len passed into
mwifiex_parse_mgmt_packet() is at least sizeof(struct ieee80211_hdr).
So the if (len < sizeof(*ieee_hdr)) guard is redundant.
The remaining two guards check that the category and action_code bytes
are present beyond the header. Keeping these subtype-specific checks in
the parser places them next to the corresponding reads.
I will drop the redundant header check and resend as v3.
Thanks,
Zhao