diff mbox series

[1/2] nl80211: Allow transmitting auth frames with random TA

Message ID 20220708165212.2069149-1-quic_vjakkam@quicinc.com (mailing list archive)
State Changes Requested
Delegated to: Johannes Berg
Headers show
Series [1/2] nl80211: Allow transmitting auth frames with random TA | expand

Commit Message

Veerendranath Jakkam July 8, 2022, 4:52 p.m. UTC
Allow authentication frames with a random local address as transmit
address if the driver supports.

This is required for below cases:
- Enabling use of randomized transmit address for PASN authentication
  frames improve privacy of WLAN clients.
- To allow user space to use link address indicated by driver as
  transmit address for authentication frames triggered by
  NL80211_CMD_EXTERNAL_AUTH for MLO connection.

Signed-off-by: Veerendranath Jakkam <quic_vjakkam@quicinc.com>
---
 include/uapi/linux/nl80211.h |  4 ++++
 net/wireless/mlme.c          | 11 +++++++++++
 2 files changed, 15 insertions(+)

Comments

Johannes Berg Aug. 26, 2022, 8:47 a.m. UTC | #1
Hi,

This patch doesn't apply now, sorry I let it linger across a lot of MLO
work.

> - To allow user space to use link address indicated by driver as
>   transmit address for authentication frames triggered by
>   NL80211_CMD_EXTERNAL_AUTH for MLO connection.

Maybe this is already covered by the changes that are actually
responsible for it not applying any more?

You can use the link address now, due to commit 6df2810ac9a9 ("wifi:
cfg80211: Allow MLO TX with link source address").


The PASN privacy thing seems something that would be desirable also for
mac80211, how would you think it would work there? Also for hwsim
testing I guess :)


>  	if (!ether_addr_equal(mgmt->sa, wdev_address(wdev))) {
> +		/* Allow random TA to be used with authentication frames if the
> +		 * driver has indicated support for this. Otherwise, only allow
> +		 * the local address to be used.
> +		 */
> +		if (ieee80211_is_auth(mgmt->frame_control) &&
> +		    wiphy_ext_feature_isset(
> +			   &rdev->wiphy,
> +			   NL80211_EXT_FEATURE_AUTH_TX_RANDOM_TA))
> +			goto out_tx;

Could use else/if instead of goto? Not sure that's better though :)

johannes
Veerendranath Jakkam Sept. 1, 2022, 10:33 a.m. UTC | #2
On 8/26/2022 2:17 PM, Johannes Berg wrote:
>
>> - To allow user space to use link address indicated by driver as
>>    transmit address for authentication frames triggered by
>>    NL80211_CMD_EXTERNAL_AUTH for MLO connection.
> Maybe this is already covered by the changes that are actually
> responsible for it not applying any more?
>
> You can use the link address now, due to commit 6df2810ac9a9 ("wifi:
> cfg80211: Allow MLO TX with link source address").


The pointed commit changes not helpful in external authentication case 
due to WDEV won't have link addresses information when external 
authentication triggered. The link addresses in WDEV gets updated only 
after association during connect response processing.


>
> The PASN privacy thing seems something that would be desirable also for
> mac80211, how would you think it would work there? Also for hwsim
> testing I guess :)
>

Need to check what additional changes needed in mac80211 to support this 
feature. I will check and post required mac80211 changes in v2 series.

>>   	if (!ether_addr_equal(mgmt->sa, wdev_address(wdev))) {
>> +		/* Allow random TA to be used with authentication frames if the
>> +		 * driver has indicated support for this. Otherwise, only allow
>> +		 * the local address to be used.
>> +		 */
>> +		if (ieee80211_is_auth(mgmt->frame_control) &&
>> +		    wiphy_ext_feature_isset(
>> +			   &rdev->wiphy,
>> +			   NL80211_EXT_FEATURE_AUTH_TX_RANDOM_TA))
>> +			goto out_tx;
> Could use else/if instead of goto? Not sure that's better though :)


sure, will do required changes in v2 series

- veeru
diff mbox series

Patch

diff --git a/include/uapi/linux/nl80211.h b/include/uapi/linux/nl80211.h
index 279f9715919e..9e665f7b3e23 100644
--- a/include/uapi/linux/nl80211.h
+++ b/include/uapi/linux/nl80211.h
@@ -6225,6 +6225,9 @@  enum nl80211_feature_flags {
  * @NL80211_EXT_FEATURE_RADAR_BACKGROUND: Device supports background radar/CAC
  *	detection.
  *
+ * @NL80211_EXT_FEATURE_AUTH_TX_RANDOM_TA: Device supports randomized TA
+ *	for authentication frames in @NL80211_CMD_FRAME.
+ *
  * @NUM_NL80211_EXT_FEATURES: number of extended features.
  * @MAX_NL80211_EXT_FEATURES: highest extended feature index.
  */
@@ -6292,6 +6295,7 @@  enum nl80211_ext_feature_index {
 	NL80211_EXT_FEATURE_BSS_COLOR,
 	NL80211_EXT_FEATURE_FILS_CRYPTO_OFFLOAD,
 	NL80211_EXT_FEATURE_RADAR_BACKGROUND,
+	NL80211_EXT_FEATURE_AUTH_TX_RANDOM_TA,
 
 	/* add new features before the definition below */
 	NUM_NL80211_EXT_FEATURES,
diff --git a/net/wireless/mlme.c b/net/wireless/mlme.c
index 2bb4da97b66a..176513a75ddf 100644
--- a/net/wireless/mlme.c
+++ b/net/wireless/mlme.c
@@ -736,6 +736,16 @@  int cfg80211_mlme_mgmt_tx(struct cfg80211_registered_device *rdev,
 	}
 
 	if (!ether_addr_equal(mgmt->sa, wdev_address(wdev))) {
+		/* Allow random TA to be used with authentication frames if the
+		 * driver has indicated support for this. Otherwise, only allow
+		 * the local address to be used.
+		 */
+		if (ieee80211_is_auth(mgmt->frame_control) &&
+		    wiphy_ext_feature_isset(
+			   &rdev->wiphy,
+			   NL80211_EXT_FEATURE_AUTH_TX_RANDOM_TA))
+			goto out_tx;
+
 		/* Allow random TA to be used with Public Action frames if the
 		 * driver has indicated support for this. Otherwise, only allow
 		 * the local address to be used.
@@ -755,6 +765,7 @@  int cfg80211_mlme_mgmt_tx(struct cfg80211_registered_device *rdev,
 			return -EINVAL;
 	}
 
+out_tx:
 	/* Transmit the Action frame as requested by user space */
 	return rdev_mgmt_tx(rdev, wdev, params, cookie);
 }