diff mbox series

wifi: wilc1000: fix for absent RSN capabilities WFA testcase

Message ID 20230405173555.6041-1-amisha.patel@microchip.com (mailing list archive)
State Changes Requested
Delegated to: Kalle Valo
Headers show
Series wifi: wilc1000: fix for absent RSN capabilities WFA testcase | expand

Commit Message

Amisha.Patel@microchip.com April 5, 2023, 5:37 p.m. UTC
Enable the RSN flag to pass cipher suite and AMK information, even when
RSN capabilities field not present (as it's optional).

Fixes: cd21d99e595e ("wifi: wilc1000: validate pairwise and authentication suite offsets")
Signed-off-by: Amisha Patel <amisha.patel@microchip.com>
---
 drivers/net/wireless/microchip/wilc1000/hif.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

Comments

Kalle Valo April 14, 2023, 12:28 p.m. UTC | #1
<Amisha.Patel@microchip.com> wrote:

> Enable the RSN flag to pass cipher suite and AMK information, even when
> RSN capabilities field not present (as it's optional).
> 
> Fixes: cd21d99e595e ("wifi: wilc1000: validate pairwise and authentication suite offsets")
> Signed-off-by: Amisha Patel <amisha.patel@microchip.com>

The commit log should always answer to "Why?". What issue does this fix?
Amisha.Patel@microchip.com April 16, 2023, 4:34 p.m. UTC | #2
On 4/14/23 08:28, Kalle Valo wrote:
> EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
> 
> <Amisha.Patel@microchip.com> wrote:
> 
>> Enable the RSN flag to pass cipher suite and AMK information, even when
>> RSN capabilities field not present (as it's optional).
>>
>> Fixes: cd21d99e595e ("wifi: wilc1000: validate pairwise and authentication suite offsets")
>> Signed-off-by: Amisha Patel <amisha.patel@microchip.com>
> 
> The commit log should always answer to "Why?". What issue does this fix?
> 

Mandatory WFA testcase 
CT_Security_WPA2Personal_STA_RSNEBoundsVerfication-AbsentRSNCap, 
performs bounds verification on Beacon and/or Probe response frames. It 
failed and observed the reason to be absence of cipher suite and AKM 
suite in RSN information. Enable the RSN flag before extracting RSN 
capabilities fixes the issue.

I'll resubmit the patch v2 with new commit log.

> --
> https://patchwork.kernel.org/project/linux-wireless/patch/20230405173555.6041-1-amisha.patel@microchip.com/
> 
> https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
>
diff mbox series

Patch

diff --git a/drivers/net/wireless/microchip/wilc1000/hif.c b/drivers/net/wireless/microchip/wilc1000/hif.c
index 5adc69d5bcae..a28da5938481 100644
--- a/drivers/net/wireless/microchip/wilc1000/hif.c
+++ b/drivers/net/wireless/microchip/wilc1000/hif.c
@@ -485,6 +485,9 @@  void *wilc_parse_join_bss_param(struct cfg80211_bss *bss,
 		int rsn_ie_len = sizeof(struct element) + rsn_ie[1];
 		int offset = 8;
 
+		param->mode_802_11i = 2;
+		param->rsn_found = true;
+
 		/* extract RSN capabilities */
 		if (offset < rsn_ie_len) {
 			/* skip over pairwise suites */
@@ -494,11 +497,8 @@  void *wilc_parse_join_bss_param(struct cfg80211_bss *bss,
 				/* skip over authentication suites */
 				offset += (rsn_ie[offset] * 4) + 2;
 
-				if (offset + 1 < rsn_ie_len) {
-					param->mode_802_11i = 2;
-					param->rsn_found = true;
+				if (offset + 1 < rsn_ie_len)
 					memcpy(param->rsn_cap, &rsn_ie[offset], 2);
-				}
 			}
 		}
 	}