diff mbox series

wifi: cfg80211: Clear mlo_links info when STA disconnect

Message ID 20240327032448.15098-1-quic_deng@quicinc.com (mailing list archive)
State Changes Requested
Delegated to: Johannes Berg
Headers show
Series wifi: cfg80211: Clear mlo_links info when STA disconnect | expand

Commit Message

Xin Deng March 27, 2024, 3:24 a.m. UTC
wdev->valid_links is not cleared when upper layer disconnect from a
wdev->AP MLD. It has been observed that this would prevent offchannel
operations like remain-on-channel which would be needed for user space
operations with Public Action frame.
Clear the wdev->valid_links when STA disconnect.

Signed-off-by: Xin Deng <quic_deng@quicinc.com>
---
 net/wireless/sme.c | 1 +
 1 file changed, 1 insertion(+)


base-commit: 8027a466a77a288eccd2d11868f504e24231f3b7

Comments

Jeff Johnson March 27, 2024, 3:51 p.m. UTC | #1
On 3/26/2024 8:24 PM, Xin Deng wrote:
> wdev->valid_links is not cleared when upper layer disconnect from a
> wdev->AP MLD. It has been observed that this would prevent offchannel
> operations like remain-on-channel which would be needed for user space
> operations with Public Action frame.
> Clear the wdev->valid_links when STA disconnect.
> 
> Signed-off-by: Xin Deng <quic_deng@quicinc.com>

Reviewed-by: Jeff Johnson <quic_jjohnson@quicinc.com>
Johannes Berg April 8, 2024, 6:41 p.m. UTC | #2
On Tue, 2024-03-26 at 20:24 -0700, Xin Deng wrote:
> wdev->valid_links is not cleared when upper layer disconnect from a
> wdev->AP MLD. It has been observed that this would prevent offchannel
> operations like remain-on-channel which would be needed for user space
> operations with Public Action frame.

I agree that's a problem, we shouldn't leave the valid_links set.

> Signed-off-by: Xin Deng <quic_deng@quicinc.com>
> ---
>  net/wireless/sme.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/net/wireless/sme.c b/net/wireless/sme.c
> index 82e3ce42206c..86e837f37f8c 100644
> --- a/net/wireless/sme.c
> +++ b/net/wireless/sme.c
> @@ -492,6 +492,7 @@ void cfg80211_wdev_release_link_bsses(struct wireless_dev *wdev, u16 link_mask)
>  				 &wdev->links[link].client.current_bss->pub);
>  		wdev->links[link].client.current_bss = NULL;
>  	}
> +	wdev->valid_links = 0;
> 

But this is (very obviously, even with only the limited context shown!)
in the completely wrong place.

johannes
Jeff Johnson April 8, 2024, 7:42 p.m. UTC | #3
On 4/8/2024 11:41 AM, Johannes Berg wrote:
> On Tue, 2024-03-26 at 20:24 -0700, Xin Deng wrote:
>> wdev->valid_links is not cleared when upper layer disconnect from a
>> wdev->AP MLD. It has been observed that this would prevent offchannel
>> operations like remain-on-channel which would be needed for user space
>> operations with Public Action frame.
> 
> I agree that's a problem, we shouldn't leave the valid_links set.
> 
>> Signed-off-by: Xin Deng <quic_deng@quicinc.com>
>> ---
>>  net/wireless/sme.c | 1 +
>>  1 file changed, 1 insertion(+)
>>
>> diff --git a/net/wireless/sme.c b/net/wireless/sme.c
>> index 82e3ce42206c..86e837f37f8c 100644
>> --- a/net/wireless/sme.c
>> +++ b/net/wireless/sme.c
>> @@ -492,6 +492,7 @@ void cfg80211_wdev_release_link_bsses(struct wireless_dev *wdev, u16 link_mask)
>>  				 &wdev->links[link].client.current_bss->pub);
>>  		wdev->links[link].client.current_bss = NULL;
>>  	}
>> +	wdev->valid_links = 0;
>>
> 
> But this is (very obviously, even with only the limited context shown!)
> in the completely wrong place.

Concur, so NAK my Reviewed-by:

That function is potentially only removing a subset of links, so it should not
be setting the valid_links to 0 since not all of the links may have been removed.

/jeff
diff mbox series

Patch

diff --git a/net/wireless/sme.c b/net/wireless/sme.c
index 82e3ce42206c..86e837f37f8c 100644
--- a/net/wireless/sme.c
+++ b/net/wireless/sme.c
@@ -492,6 +492,7 @@  void cfg80211_wdev_release_link_bsses(struct wireless_dev *wdev, u16 link_mask)
 				 &wdev->links[link].client.current_bss->pub);
 		wdev->links[link].client.current_bss = NULL;
 	}
+	wdev->valid_links = 0;
 }
 
 static int cfg80211_sme_get_conn_ies(struct wireless_dev *wdev,