]> git.baikalelectronics.ru Git - kernel.git/commit
nl80211: fix beacon head validation
authorJohannes Berg <johannes.berg@intel.com>
Thu, 8 Apr 2021 13:45:20 +0000 (15:45 +0200)
committerJohannes Berg <johannes.berg@intel.com>
Thu, 8 Apr 2021 14:43:05 +0000 (16:43 +0200)
commitcf46bdb5ad7fd2c3f86b952c6abdcea10ff8753b
tree3c9907d8cd594f3ec819146a807a0c5d6fe6869a
parent6974d0db0df3ca4f677e825c73771e1aa1c289db
nl80211: fix beacon head validation

If the beacon head attribute (NL80211_ATTR_BEACON_HEAD)
is too short to even contain the frame control field,
we access uninitialized data beyond the buffer. Fix this
by checking the minimal required size first. We used to
do this until S1G support was added, where the fixed
data portion has a different size.

Reported-and-tested-by: syzbot+72b99dcf4607e8c770f3@syzkaller.appspotmail.com
Suggested-by: Eric Dumazet <eric.dumazet@gmail.com>
Fixes: 3628ce99a8a2 ("nl80211: correctly validate S1G beacon head")
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Link: https://lore.kernel.org/r/20210408154518.d9b06d39b4ee.Iff908997b2a4067e8d456b3cb96cab9771d252b8@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
net/wireless/nl80211.c