mac80211: fix potential deadlock in ieee80211_key_link()
Subsystems (4)
PATCH 1/1 mac80211: fix potential deadlock in ieee80211_key_link()
Add the missing unlock before return in the error handling case.
Fixes ccdde7c74ffd ("wifi: mac80211: properly implement MLO key handling")
Signed-off-by Sun Ke <[email protected]>
--- net/mac80211/key.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
net/mac80211/key.c +4 -2
@@ -865,8 +865,10 @@ int ieee80211_key_link(struct ieee80211_key *key,if (link_id >=0 ) { link_sta =rcu_dereference_protected (sta->link[link_id],lockdep_is_held (&sta->local->sta_mtx)); -if (!link_sta) -return -ENOLINK ; +if (!link_sta) { + ret = -ENOLINK ; + goto out; + } } old_key =key_mtx_dereference (sdata->local, link_sta->gtk[idx]);
Signature · 1 line
2.31.1
Quoted 4 lines · Sun Ke
Add the missing unlock before return in the error handling case.
Fixes ccdde7c74ffd ("wifi: mac80211: properly implement MLO key handling")Signed-off-by Sun Ke <[email protected]>
The title is missing "wifi:".
Signature · 3 lines
https://patchwork.kernel.org/project/linux-wireless/list/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
Quoted 8 lines · Kalle Valo
Quoted 4 lines · Sun Ke
Add the missing unlock before return in the error handling case.
Fixes ccdde7c74ffd ("wifi: mac80211: properly implement MLO key handling")Signed-off-by Sun Ke <[email protected]>The title is missing "wifi:".
Johannes had modified it by hand.
Thanks,
Sun Ke