Linux wireless drivers development
 help / color / mirror / Atom feed
* [PATCH 1/1] wifi:nl80211: Extend del pmksa support for SAE and OWE security
@ 2023-11-07  6:40 Vinayak Yadawad
  2023-11-07 14:15 ` Kalle Valo
  0 siblings, 1 reply; 3+ messages in thread
From: Vinayak Yadawad @ 2023-11-07  6:40 UTC (permalink / raw)
  To: johannes; +Cc: linux-wireless, jithu.jance, Vinayak Yadawad

[-- Attachment #1: Type: text/plain, Size: 2428 bytes --]

Current handling of del pmksa with SSID is limited to FILS
security. In the current change the del pmksa support is extended
to SAE/OWE security offloads as well. For OWE/SAE offloads, the
PMK is generated and cached at driver/FW, so user app needs the
capability to request cache deletion based on SSID for drivers
supporting SAE/OWE offload.

Signed-off-by: Vinayak Yadawad <vinayak.yadawad@broadcom.com>
---
 net/wireless/nl80211.c | 27 ++++++++++++++++++++-------
 1 file changed, 20 insertions(+), 7 deletions(-)

diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index 569234bc2be6..8dc1c800f171 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -12183,24 +12183,37 @@ static int nl80211_setdel_pmksa(struct sk_buff *skb, struct genl_info *info)
 
 	memset(&pmksa, 0, sizeof(struct cfg80211_pmksa));
 
-	if (!info->attrs[NL80211_ATTR_PMKID])
+	if ((info->genlhdr->cmd == NL80211_CMD_SET_PMKSA) &&
+	    (!info->attrs[NL80211_ATTR_PMKID]))
 		return -EINVAL;
 
-	pmksa.pmkid = nla_data(info->attrs[NL80211_ATTR_PMKID]);
+	if (info->attrs[NL80211_ATTR_PMKID])
+		pmksa.pmkid = nla_data(info->attrs[NL80211_ATTR_PMKID]);
 
 	if (info->attrs[NL80211_ATTR_MAC]) {
 		pmksa.bssid = nla_data(info->attrs[NL80211_ATTR_MAC]);
-	} else if (info->attrs[NL80211_ATTR_SSID] &&
-		   info->attrs[NL80211_ATTR_FILS_CACHE_ID] &&
-		   (info->genlhdr->cmd == NL80211_CMD_DEL_PMKSA ||
+	} else if (info->attrs[NL80211_ATTR_SSID]) {
+		/* SSID based pmksa flush suppported only for FILS,
+		 * OWE/SAE OFFLOAD cases
+		 */
+		if (info->attrs[NL80211_ATTR_FILS_CACHE_ID] &&
+		    (info->genlhdr->cmd == NL80211_CMD_DEL_PMKSA ||
 		    info->attrs[NL80211_ATTR_PMK])) {
+			pmksa.cache_id =
+				nla_data(info->attrs[NL80211_ATTR_FILS_CACHE_ID]);
+		} else if ((info->genlhdr->cmd == NL80211_CMD_DEL_PMKSA) &&
+		    (!wiphy_ext_feature_isset(
+		    &rdev->wiphy, NL80211_EXT_FEATURE_SAE_OFFLOAD) &&
+		    (!wiphy_ext_feature_isset(
+		    &rdev->wiphy,NL80211_EXT_FEATURE_OWE_OFFLOAD)))){
+			return -EINVAL;
+		}
 		pmksa.ssid = nla_data(info->attrs[NL80211_ATTR_SSID]);
 		pmksa.ssid_len = nla_len(info->attrs[NL80211_ATTR_SSID]);
-		pmksa.cache_id =
-			nla_data(info->attrs[NL80211_ATTR_FILS_CACHE_ID]);
 	} else {
 		return -EINVAL;
 	}
+
 	if (info->attrs[NL80211_ATTR_PMK]) {
 		pmksa.pmk = nla_data(info->attrs[NL80211_ATTR_PMK]);
 		pmksa.pmk_len = nla_len(info->attrs[NL80211_ATTR_PMK]);
-- 
2.32.0


[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4218 bytes --]

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

* Re: [PATCH 1/1] wifi:nl80211: Extend del pmksa support for SAE and OWE security
  2023-11-07  6:40 [PATCH 1/1] wifi:nl80211: Extend del pmksa support for SAE and OWE security Vinayak Yadawad
@ 2023-11-07 14:15 ` Kalle Valo
  2023-11-08  6:52   ` Vinayak Yadawad
  0 siblings, 1 reply; 3+ messages in thread
From: Kalle Valo @ 2023-11-07 14:15 UTC (permalink / raw)
  To: Vinayak Yadawad; +Cc: johannes, linux-wireless, jithu.jance

Vinayak Yadawad <vinayak.yadawad@broadcom.com> writes:

> Current handling of del pmksa with SSID is limited to FILS
> security. In the current change the del pmksa support is extended
> to SAE/OWE security offloads as well. For OWE/SAE offloads, the
> PMK is generated and cached at driver/FW, so user app needs the
> capability to request cache deletion based on SSID for drivers
> supporting SAE/OWE offload.
>
> Signed-off-by: Vinayak Yadawad <vinayak.yadawad@broadcom.com>

There should be a space after "wifi:" in the title. Not sure if Johannes
can fix that or if he prefers to submit a new version.

-- 
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 1/1] wifi:nl80211: Extend del pmksa support for SAE and OWE security
  2023-11-07 14:15 ` Kalle Valo
@ 2023-11-08  6:52   ` Vinayak Yadawad
  0 siblings, 0 replies; 3+ messages in thread
From: Vinayak Yadawad @ 2023-11-08  6:52 UTC (permalink / raw)
  To: Kalle Valo; +Cc: johannes, linux-wireless, jithu.jance

[-- Attachment #1: Type: text/plain, Size: 1082 bytes --]

Hi Kalle,

Thanks for the review comment.
I have addressed the comment in version 2 of the patch "[PATCH v2 1/1]
wifi: nl80211: Extend del pmksa support for SAE and OWE security"

Regards,
Vinayak


On Tue, Nov 7, 2023 at 7:45 PM Kalle Valo <kvalo@kernel.org> wrote:
>
> Vinayak Yadawad <vinayak.yadawad@broadcom.com> writes:
>
> > Current handling of del pmksa with SSID is limited to FILS
> > security. In the current change the del pmksa support is extended
> > to SAE/OWE security offloads as well. For OWE/SAE offloads, the
> > PMK is generated and cached at driver/FW, so user app needs the
> > capability to request cache deletion based on SSID for drivers
> > supporting SAE/OWE offload.
> >
> > Signed-off-by: Vinayak Yadawad <vinayak.yadawad@broadcom.com>
>
> There should be a space after "wifi:" in the title. Not sure if Johannes
> can fix that or if he prefers to submit a new version.
>
> --
> https://patchwork.kernel.org/project/linux-wireless/list/
>
> https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches

[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4218 bytes --]

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

end of thread, other threads:[~2023-11-08  6:52 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-11-07  6:40 [PATCH 1/1] wifi:nl80211: Extend del pmksa support for SAE and OWE security Vinayak Yadawad
2023-11-07 14:15 ` Kalle Valo
2023-11-08  6:52   ` Vinayak Yadawad

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox