kernel-janitors.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mac80211: fix potential deadlock in ieee80211_key_link()
@ 2022-08-27  2:24 Sun Ke
  2022-09-01  4:41 ` Kalle Valo
  0 siblings, 1 reply; 3+ messages in thread
From: Sun Ke @ 2022-08-27  2:24 UTC (permalink / raw)
  To: johannes, davem, edumazet, kuba, pabeni
  Cc: linux-wireless, netdev, kernel-janitors, johannes.berg, sunke32

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 <sunke32@huawei.com>
---
 net/mac80211/key.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/net/mac80211/key.c b/net/mac80211/key.c
index 86aac87e0211..d89ec93b243b 100644
--- a/net/mac80211/key.c
+++ b/net/mac80211/key.c
@@ -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]);
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] mac80211: fix potential deadlock in ieee80211_key_link()
  2022-08-27  2:24 [PATCH] mac80211: fix potential deadlock in ieee80211_key_link() Sun Ke
@ 2022-09-01  4:41 ` Kalle Valo
  2022-09-01  6:37   ` Sun Ke
  0 siblings, 1 reply; 3+ messages in thread
From: Kalle Valo @ 2022-09-01  4:41 UTC (permalink / raw)
  To: Sun Ke
  Cc: johannes, davem, edumazet, kuba, pabeni, linux-wireless, netdev,
	kernel-janitors, johannes.berg

Sun Ke <sunke32@huawei.com> writes:

> 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 <sunke32@huawei.com>

The title is missing "wifi:".

-- 
https://patchwork.kernel.org/project/linux-wireless/list/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] mac80211: fix potential deadlock in ieee80211_key_link()
  2022-09-01  4:41 ` Kalle Valo
@ 2022-09-01  6:37   ` Sun Ke
  0 siblings, 0 replies; 3+ messages in thread
From: Sun Ke @ 2022-09-01  6:37 UTC (permalink / raw)
  To: Kalle Valo
  Cc: johannes, davem, edumazet, kuba, pabeni, linux-wireless, netdev,
	kernel-janitors, johannes.berg



在 2022/9/1 12:41, Kalle Valo 写道:
> Sun Ke <sunke32@huawei.com> writes:
> 
>> 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 <sunke32@huawei.com>
> 
> The title is missing "wifi:".

Johannes had modified it by hand.

Thanks,
Sun Ke
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-09-01  6:38 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-27  2:24 [PATCH] mac80211: fix potential deadlock in ieee80211_key_link() Sun Ke
2022-09-01  4:41 ` Kalle Valo
2022-09-01  6:37   ` Sun Ke

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).