]> git.baikalelectronics.ru Git - kernel.git/commit
wifi: cfg80211: Fix use after free for wext
authorAlexander Wetzel <alexander@wetzel-home.de>
Tue, 24 Jan 2023 14:18:56 +0000 (15:18 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 11 Mar 2023 15:44:03 +0000 (16:44 +0100)
commitacae1945cc63458f2c71556fb9bb10050836e522
treeb6f53bf72193642884369a78e19ccb5061c0f750
parent404ad5aeb86c6629276e76d27c2a67430be59e90
wifi: cfg80211: Fix use after free for wext

commit 015b8cc5e7c4d7bb671f1984d7b7338c310b185b upstream.

Key information in wext.connect is not reset on (re)connect and can hold
data from a previous connection.

Reset key data to avoid that drivers or mac80211 incorrectly detect a
WEP connection request and access the freed or already reused memory.

Additionally optimize cfg80211_sme_connect() and avoid an useless
schedule of conn_work.

Fixes: 81cbe2ab679f ("cfg80211: rework key operation")
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20230124141856.356646-1-alexander@wetzel-home.de
Signed-off-by: Alexander Wetzel <alexander@wetzel-home.de>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/wireless/sme.c