Skip to contentSkip to conversation

wifi: remove zero-length arrays

PATCH Applied Carlos Llamas 2 participants 3 messages Jun 8 – Jun 9 Stable branch

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 wifi: remove zero-length arrays

From: Johannes Berg <[email protected]>

commit a85b8544d46390469b6ca72d6bfd3ecb7be985ff upstream.

All of these are really meant to be variable-length, and in the case of s1g_beacon it's actually accessed. Make that one in particular, and a couple of others (that aren't used as arrays now), actually variable.

Reported-by [email protected]
Fixes 1e1f706fc2ce ("wifi: cfg80211/mac80211: correctly parse S1G beacon optional elements")
Change-Id I699f1aaaf11005b45a189bfe164e65c5e2c8a6ce
---
 include/linux/ieee80211.h | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)
include/linux/ieee80211.h +9 -9
index abb069aa5fa5..85bf3ac6db57 100644
@@ -1266,7 +1266,7 @@ struct ieee80211_ext {
 			u8 sa[ETH_ALEN];
 			__le32 timestamp;
 			u8 change_seq;
-			u8 variable[0];
+			u8 variable[];
 		} __packed s1g_beacon;
 	} u;
 } __packed __aligned(2);
@@ -1522,7 +1522,7 @@ struct ieee80211_mgmt {
 					u8 action_code;
 					u8 dialog_token;
 					__le16 capability;
-					u8 variable[0];
+					u8 variable[];
 				} __packed tdls_discover_resp;
 				struct {
 					u8 action_code;
@@ -1690,35 +1690,35 @@ struct ieee80211_tdls_data {
 		struct {
 			u8 dialog_token;
 			__le16 capability;
-			u8 variable[0];
+			u8 variable[];
 		} __packed setup_req;
 		struct {
 			__le16 status_code;
 			u8 dialog_token;
 			__le16 capability;
-			u8 variable[0];
+			u8 variable[];
 		} __packed setup_resp;
 		struct {
 			__le16 status_code;
 			u8 dialog_token;
-			u8 variable[0];
+			u8 variable[];
 		} __packed setup_cfm;
 		struct {
 			__le16 reason_code;
-			u8 variable[0];
+			u8 variable[];
 		} __packed teardown;
 		struct {
 			u8 dialog_token;
-			u8 variable[0];
+			u8 variable[];
 		} __packed discover_req;
 		struct {
 			u8 target_channel;
 			u8 oper_class;
-			u8 variable[0];
+			u8 variable[];
 		} __packed chan_switch_req;
 		struct {
 			__le16 status_code;
-			u8 variable[0];
+			u8 variable[];
 		} __packed chan_switch_resp;
 	} u;
 } __packed;
Signature · 1 line
2.54.0.1032.g2f8565e1d1-goog
maintainer Applied
#1 lore raw
Quoted 1 line

[PATCH 6.12.y] wifi: remove zero-length arrays

Queued for 6.12, thanks. I dropped the leftover "Change-Id:" trailer from the commit message while applying.

--
Thanks,
Sasha

#2 lore raw
Quoted 4 lines · Sasha Levin
Quoted 1 line

[PATCH 6.12.y] wifi: remove zero-length arrays

Queued for 6.12, thanks. I dropped the leftover "Change-Id:" trailer from the commit message while applying.

Oops, sorry about that. I was working from a gerrit mirror. Thanks for fixing it.
--
Carlos Llamas