All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCHv2] cfg80211: Skip key deletion for open associations
@ 2021-01-25 19:20 chaitanya.mgit
  2021-01-25 19:51 ` Johannes Berg
  0 siblings, 1 reply; 3+ messages in thread
From: chaitanya.mgit @ 2021-01-25 19:20 UTC (permalink / raw)
  To: johannes, linux-wireless; +Cc: Chaitanya Tata, Chaitanya Tata

From: Chaitanya Tata <chaitanya.mgit@gmail.com>

From: Chaitanya Tata <chaitanya.mgit@gmail.com>

If the association is open (no authentication and encryption) no need
to delete the keys, though this is handled by all drivers, this is
unnecessary.

Signed-off-by: Chaitanya Tata <chaitanya.tata@bluwireless.com>
---
v2: Move kfree after check.
---
 net/wireless/sme.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/net/wireless/sme.c b/net/wireless/sme.c
index 38df713f2e2e..016655595b48 100644
--- a/net/wireless/sme.c
+++ b/net/wireless/sme.c
@@ -1098,8 +1098,6 @@ void __cfg80211_disconnected(struct net_device *dev, const u8 *ie,
 	wdev->current_bss = NULL;
 	wdev->ssid_len = 0;
 	wdev->conn_owner_nlportid = 0;
-	kfree_sensitive(wdev->connect_keys);
-	wdev->connect_keys = NULL;
 
 	nl80211_send_disconnected(rdev, dev, reason, ie, ie_len, from_ap);
 
@@ -1113,7 +1111,7 @@ void __cfg80211_disconnected(struct net_device *dev, const u8 *ie,
 	 * Delete all the keys ... pairwise keys can't really
 	 * exist any more anyway, but default keys might.
 	 */
-	if (rdev->ops->del_key) {
+	if (wdev->connect_keys && rdev->ops->del_key) {
 		int max_key_idx = 5;
 
 		if (wiphy_ext_feature_isset(
@@ -1127,6 +1125,9 @@ void __cfg80211_disconnected(struct net_device *dev, const u8 *ie,
 			rdev_del_key(rdev, dev, i, false, NULL);
 	}
 
+	kfree_sensitive(wdev->connect_keys);
+	wdev->connect_keys = NULL;
+
 	rdev_set_qos_map(rdev, dev, NULL);
 
 #ifdef CONFIG_CFG80211_WEXT
-- 
2.17.1


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

* Re: [PATCHv2] cfg80211: Skip key deletion for open associations
  2021-01-25 19:20 [PATCHv2] cfg80211: Skip key deletion for open associations chaitanya.mgit
@ 2021-01-25 19:51 ` Johannes Berg
  2021-01-25 20:07   ` Krishna Chaitanya
  0 siblings, 1 reply; 3+ messages in thread
From: Johannes Berg @ 2021-01-25 19:51 UTC (permalink / raw)
  To: chaitanya.mgit, linux-wireless; +Cc: Chaitanya Tata

On Tue, 2021-01-26 at 00:50 +0530, chaitanya.mgit@gmail.com wrote:
> From: Chaitanya Tata <chaitanya.mgit@gmail.com>
> 
> From: Chaitanya Tata <chaitanya.mgit@gmail.com>

That's broken, please check your git mail setup.

>  	 * Delete all the keys ... pairwise keys can't really
>  	 * exist any more anyway, but default keys might.
>  	 */
> -	if (rdev->ops->del_key) {
> +	if (wdev->connect_keys && rdev->ops->del_key) {
> 

This is wrong, wdev->connect_keys is not needed to make a secure
connection.

johannes


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

* Re: [PATCHv2] cfg80211: Skip key deletion for open associations
  2021-01-25 19:51 ` Johannes Berg
@ 2021-01-25 20:07   ` Krishna Chaitanya
  0 siblings, 0 replies; 3+ messages in thread
From: Krishna Chaitanya @ 2021-01-25 20:07 UTC (permalink / raw)
  To: Johannes Berg; +Cc: linux-wireless, Chaitanya Tata

On Tue, Jan 26, 2021 at 1:21 AM Johannes Berg <johannes@sipsolutions.net> wrote:
>
> On Tue, 2021-01-26 at 00:50 +0530, chaitanya.mgit@gmail.com wrote:
> > From: Chaitanya Tata <chaitanya.mgit@gmail.com>
> >
> > From: Chaitanya Tata <chaitanya.mgit@gmail.com>
>
> That's broken, please check your git mail setup.
Fixed.
>
>
> >        * Delete all the keys ... pairwise keys can't really
> >        * exist any more anyway, but default keys might.
> >        */
> > -     if (rdev->ops->del_key) {
> > +     if (wdev->connect_keys && rdev->ops->del_key) {
> >
>
> This is wrong, wdev->connect_keys is not needed to make a secure
> connection.
Ah, I guess it's only for the WEP, right? From a quick look, we are not saving
connect params (connect.crypto), will take a deeper look, thanks.

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

end of thread, other threads:[~2021-01-26 19:12 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-25 19:20 [PATCHv2] cfg80211: Skip key deletion for open associations chaitanya.mgit
2021-01-25 19:51 ` Johannes Berg
2021-01-25 20:07   ` Krishna Chaitanya

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.