]> 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)
commit30b9d21add3e87c164f0dd6558eec90aed012f56
treeb67ee15aea80b40cc40d2d76058b744deb3b080c
parent9744e1c02065575eeb158e1682c97b951ee680c1
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: 1cdc5b1f9f77 ("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