]> git.baikalelectronics.ru Git - kernel.git/commit
wifi: mac80211: fix MBSSID parsing use-after-free
authorJohannes Berg <johannes.berg@intel.com>
Wed, 28 Sep 2022 20:07:15 +0000 (22:07 +0200)
committerJohannes Berg <johannes.berg@intel.com>
Mon, 10 Oct 2022 07:50:23 +0000 (09:50 +0200)
commitf279124b905209953805d9fbf77cb4277766ae17
treeb67ee15aea80b40cc40d2d76058b744deb3b080c
parent630b523ec4472d5914f6ba1a9750d1e8449cea59
wifi: mac80211: fix MBSSID parsing use-after-free

When we parse a multi-BSSID element, we might point some
element pointers into the allocated nontransmitted_profile.
However, we free this before returning, causing UAF when the
relevant pointers in the parsed elements are accessed.

Fix this by not allocating the scratch buffer separately but
as part of the returned structure instead, that way, there
are no lifetime issues with it.

The scratch buffer introduction as part of the returned data
here is taken from MLO feature work done by Ilan.

This fixes CVE-2022-42719.

Fixes: abd48b8066f3 ("mac80211: support profile split between elements")
Co-developed-by: Ilan Peer <ilan.peer@intel.com>
Signed-off-by: Ilan Peer <ilan.peer@intel.com>
Reviewed-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
net/mac80211/ieee80211_i.h
net/mac80211/util.c