2022-10-06 19:22:05

by Kees Cook

[permalink] [raw]
Subject: [PATCH] ath9k: Remove -Warray-bounds exception

GCC-12 emits false positive -Warray-bounds warnings with
CONFIG_UBSAN_SHIFT (-fsanitize=shift). This is fixed in GCC 13[1],
and there is top-level Makefile logic to remove -Warray-bounds for
known-bad GCC versions staring with commit f0be87c42cbd ("gcc-12: disable
'-Warray-bounds' universally for now").

Remove the local work-around.

[1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105679

Signed-off-by: Kees Cook <[email protected]>
---
drivers/net/wireless/ath/ath9k/Makefile | 5 -----
1 file changed, 5 deletions(-)

diff --git a/drivers/net/wireless/ath/ath9k/Makefile b/drivers/net/wireless/ath/ath9k/Makefile
index 9bdfcee2f448..eff94bcd1f0a 100644
--- a/drivers/net/wireless/ath/ath9k/Makefile
+++ b/drivers/net/wireless/ath/ath9k/Makefile
@@ -45,11 +45,6 @@ ath9k_hw-y:= \
ar9003_eeprom.o \
ar9003_paprd.o

-# FIXME: temporarily silence -Warray-bounds on non W=1+ builds
-ifndef KBUILD_EXTRA_WARN
-CFLAGS_mac.o += -Wno-array-bounds
-endif
-
ath9k_hw-$(CONFIG_ATH9K_WOW) += ar9003_wow.o

ath9k_hw-$(CONFIG_ATH9K_BTCOEX_SUPPORT) += btcoex.o \


2022-10-07 17:32:06

by Toke Høiland-Jørgensen

[permalink] [raw]
Subject: Re: [PATCH] ath9k: Remove -Warray-bounds exception

Kees Cook <[email protected]> writes:

> GCC-12 emits false positive -Warray-bounds warnings with
> CONFIG_UBSAN_SHIFT (-fsanitize=shift). This is fixed in GCC 13[1],
> and there is top-level Makefile logic to remove -Warray-bounds for
> known-bad GCC versions staring with commit f0be87c42cbd ("gcc-12: disable
> '-Warray-bounds' universally for now").
>
> Remove the local work-around.
>
> [1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105679
>
> Signed-off-by: Kees Cook <[email protected]>

Acked-by: Toke Høiland-Jørgensen <[email protected]>

2022-10-11 04:42:57

by Kalle Valo

[permalink] [raw]
Subject: Re: [PATCH] ath9k: Remove -Warray-bounds exception

Kees Cook <[email protected]> wrote:

> GCC-12 emits false positive -Warray-bounds warnings with
> CONFIG_UBSAN_SHIFT (-fsanitize=shift). This is fixed in GCC 13[1],
> and there is top-level Makefile logic to remove -Warray-bounds for
> known-bad GCC versions staring with commit f0be87c42cbd ("gcc-12: disable
> '-Warray-bounds' universally for now").
>
> Remove the local work-around.
>
> [1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105679
>
> Signed-off-by: Kees Cook <[email protected]>
> Acked-by: Toke Høiland-Jørgensen <[email protected]>
> Signed-off-by: Kalle Valo <[email protected]>

Patch applied to ath-next branch of ath.git, thanks.

d174768932a8 wifi: ath9k: Remove -Warray-bounds exception

--
https://patchwork.kernel.org/project/linux-wireless/patch/[email protected]/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches