Skip to contentSkip to conversation

mac80211: fix potential deadlock in ieee80211_key_link()

PATCH In review Sun Ke 2 participants 3 messages Aug 27, 2022 – Sep 1, 2022

Subsystems (4)
lore
Share & tools
lore

Sun Ke

author
#0 lore raw

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")
---
 net/mac80211/key.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
net/mac80211/key.c +4 -2
index 86aac87e0211..d89ec93b243b 100644
@@ -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
#1 lore raw
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")

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
author
#2 lore raw
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")

The title is missing "wifi:".

Johannes had modified it by hand.

Thanks,
Sun Ke

Quoted 1 line