Skip to content

Commit

Permalink
mac80211: validate extended element ID is present
Browse files Browse the repository at this point in the history
commit 768c0b1 upstream.

Before attempting to parse an extended element, verify that
the extended element ID is present.

Fixes: 41cbb0f ("mac80211: add support for HE")
Reported-by: syzbot+59bdff68edce82e393b6@syzkaller.appspotmail.com
Link: https://lore.kernel.org/r/20211211201023.f30a1b128c07.I5cacc176da94ba316877c6e10fe3ceec8b4dbd7d@changeid
Cc: stable@vger.kernel.org
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
jmberg-intel authored and gregkh committed Dec 22, 2021
1 parent 0bb5047 commit 7fd214f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion net/mac80211/util.c
Expand Up @@ -950,7 +950,12 @@ static void ieee80211_parse_extension_element(u32 *crc,
struct ieee802_11_elems *elems)
{
const void *data = elem->data + 1;
u8 len = elem->datalen - 1;
u8 len;

if (!elem->datalen)
return;

len = elem->datalen - 1;

switch (elem->data[0]) {
case WLAN_EID_EXT_HE_MU_EDCA:
Expand Down

0 comments on commit 7fd214f

Please sign in to comment.