]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
wifi: iwlegacy: work around excessive stack usage on clang/kasan
authorArnd Bergmann <arnd@arndb.de>
Fri, 20 Jun 2025 11:39:42 +0000 (13:39 +0200)
committerJohannes Berg <johannes.berg@intel.com>
Tue, 24 Jun 2025 07:04:42 +0000 (09:04 +0200)
In some rare randconfig builds, I seem to trigger a bug in clang where
it unrolls a loop but then runs out of registers, which then get
spilled to the stack:

net/wireless/intel/iwlegacy/4965-rs.c:2262:1: error: stack frame size (1696) exceeds limit (1280) in 'il4965_rs_rate_init' [-Werror,-Wframe-larger-than]

This seems to be the same one I saw in the omapdrm driver, and there is
an easy workaround by not inlining the il4965_rs_rate_scale_clear_win
function.

Link: https://github.com/llvm/llvm-project/issues/143908
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Stanislaw Gruszka <stf_xl@wp.pl>
Link: https://patch.msgid.link/20250620113946.3987160-1-arnd@kernel.org
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
drivers/net/wireless/intel/iwlegacy/4965-rs.c

index 0e5130d1fccd38693c1552b2fb785ad83f637605..031d88bf6393a48e7d3c48d70a87e63a059c15b6 100644 (file)
@@ -203,7 +203,8 @@ il4965_rs_extract_rate(u32 rate_n_flags)
        return (u8) (rate_n_flags & 0xFF);
 }
 
-static void
+/* noinline works around https://github.com/llvm/llvm-project/issues/143908 */
+static noinline_for_stack void
 il4965_rs_rate_scale_clear_win(struct il_rate_scale_data *win)
 {
        win->data = 0;