Commit eec5d76
committed
wifi: mac80211: fix use-after-free in chanctx code
jira VULN-51418
cve CVE-2022-49416
commit-author Johannes Berg <johannes.berg@intel.com>
commit 2965c4c
In ieee80211_vif_use_reserved_context(), when we have an
old context and the new context's replace_state is set to
IEEE80211_CHANCTX_REPLACE_NONE, we free the old context
in ieee80211_vif_use_reserved_reassign(). Therefore, we
cannot check the old_ctx anymore, so we should set it to
NULL after this point.
However, since the new_ctx replace state is clearly not
IEEE80211_CHANCTX_REPLACES_OTHER, we're not going to do
anything else in this function and can just return to
avoid accessing the freed old_ctx.
Cc: stable@vger.kernel.org
Fixes: 5bcae31 ("mac80211: implement multi-vif in-place reservations")
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20220601091926.df419d91b165.I17a9b3894ff0b8323ce2afdb153b101124c821e5@changeid
(cherry picked from commit 2965c4c)
Signed-off-by: Jonathan Maple <jmaple@ciq.com>1 parent 12ee70c commit eec5d76
1 file changed
+2
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1749 | 1749 | | |
1750 | 1750 | | |
1751 | 1751 | | |
1752 | | - | |
1753 | | - | |
1754 | | - | |
| 1752 | + | |
1755 | 1753 | | |
1756 | | - | |
1757 | | - | |
| 1754 | + | |
1758 | 1755 | | |
1759 | 1756 | | |
1760 | 1757 | | |
| |||
0 commit comments