[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20250310222332.work.202-kees@kernel.org>
Date: Mon, 10 Mar 2025 15:23:32 -0700
From: Kees Cook <kees@...nel.org>
To: Brian Norris <briannorris@...omium.org>
Cc: Kees Cook <kees@...nel.org>,
Francesco Dolcini <francesco@...cini.it>,
Johannes Berg <johannes@...solutions.net>,
Thomas Gleixner <tglx@...utronix.de>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Allison Randal <allison@...utok.net>,
linux-wireless@...r.kernel.org,
linux-kernel@...r.kernel.org,
linux-hardening@...r.kernel.org
Subject: [PATCH] wifi: mwifiex: Add __nonstring annotations for unterminated strings
When a character array without a terminating NUL character has a static
initializer, GCC 15's -Wunterminated-string-initialization will only
warn if the array lacks the "nonstring" attribute[1]. Mark the arrays
with __nonstring to and correctly identify the char array as "not a C
string" and thereby eliminate the warning.
Link: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117178 [1]
Cc: Brian Norris <briannorris@...omium.org>
Cc: Francesco Dolcini <francesco@...cini.it>
Cc: Johannes Berg <johannes@...solutions.net>
Cc: Thomas Gleixner <tglx@...utronix.de>
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc: Allison Randal <allison@...utok.net>
Cc: linux-wireless@...r.kernel.org
Signed-off-by: Kees Cook <kees@...nel.org>
---
drivers/net/wireless/marvell/mwifiex/cfp.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/wireless/marvell/mwifiex/cfp.c b/drivers/net/wireless/marvell/mwifiex/cfp.c
index d39092b99212..d7fd79214bcf 100644
--- a/drivers/net/wireless/marvell/mwifiex/cfp.c
+++ b/drivers/net/wireless/marvell/mwifiex/cfp.c
@@ -150,7 +150,7 @@ static const u16 ac_mcs_rate_nss2[8][10] = {
struct region_code_mapping {
u8 code;
- u8 region[IEEE80211_COUNTRY_STRING_LEN];
+ u8 region[IEEE80211_COUNTRY_STRING_LEN] __nonstring;
};
static struct region_code_mapping region_code_mapping_t[] = {
--
2.34.1
Powered by blists - more mailing lists