Skip to content

Commit 24cf4d2

Browse files
committed
patches: Update for merge of iwlwifi patch
Remove the patch from mainline and update the metadata of the patch in stable to signify that it has been merged in mainline. Signed-off-by: Nathan Chancellor <[email protected]>
1 parent 821864c commit 24cf4d2

5 files changed

+55
-188
lines changed

patches/mainline/series

Lines changed: 0 additions & 1 deletion
This file was deleted.

patches/mainline/v2_20250425_kees_wifi_iwlwifi_mld_work_around_clang_loop_unrolling_bug.patch

Lines changed: 0 additions & 93 deletions
This file was deleted.
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
From 368556dd234dc4a506a35a0c99c0eee2ab475c77 Mon Sep 17 00:00:00 2001
2+
From: Kees Cook <[email protected]>
3+
Date: Mon, 21 Apr 2025 13:41:57 -0700
4+
Subject: wifi: iwlwifi: mld: Work around Clang loop unrolling bug
5+
6+
The nested loop in iwl_mld_send_proto_offload() confuses Clang into
7+
thinking there could be a final loop iteration past the end of the
8+
"nsc" array (which is only 4 entries). The FORTIFY checking in memcmp()
9+
(via ipv6_addr_cmp()) notices this (due to the available bytes in the
10+
out-of-bounds position of &nsc[4] being 0), and errors out, failing
11+
the build. For some reason (likely due to architectural loop unrolling
12+
configurations), this is only exposed on ARM builds currently. Due to
13+
Clang's lack of inline tracking[1], the warning is not very helpful:
14+
15+
include/linux/fortify-string.h:719:4: error: call to '__read_overflow' declared with 'error' attribute: detected read beyond size of object (1st parameter)
16+
719 | __read_overflow();
17+
| ^
18+
1 error generated.
19+
20+
But this was tracked down to iwl_mld_send_proto_offload()'s
21+
ipv6_addr_cmp() call.
22+
23+
An upstream Clang bug has been filed[2] to track this. For now fix the
24+
build by explicitly bounding the inner loop by "n_nsc", which is what
25+
"c" is already limited to.
26+
27+
Reported-by: Nathan Chancellor <[email protected]>
28+
Closes: https://github.com/ClangBuiltLinux/linux/issues/2076
29+
Link: https://github.com/llvm/llvm-project/pull/73552 [1]
30+
Link: https://github.com/llvm/llvm-project/issues/136603 [2]
31+
Link: https://lore.kernel.org/r/[email protected]
32+
Signed-off-by: Kees Cook <[email protected]>
33+
---
34+
Link: https://git.kernel.org/linus/368556dd234dc4a506a35a0c99c0eee2ab475c77
35+
---
36+
drivers/net/wireless/intel/iwlwifi/mld/d3.c | 2 +-
37+
1 file changed, 1 insertion(+), 1 deletion(-)
38+
39+
diff --git a/drivers/net/wireless/intel/iwlwifi/mld/d3.c b/drivers/net/wireless/intel/iwlwifi/mld/d3.c
40+
index ee99298eebf595..7ce01ad3608e18 100644
41+
--- a/drivers/net/wireless/intel/iwlwifi/mld/d3.c
42+
+++ b/drivers/net/wireless/intel/iwlwifi/mld/d3.c
43+
@@ -1757,7 +1757,7 @@ iwl_mld_send_proto_offload(struct iwl_mld *mld,
44+
45+
addrconf_addr_solict_mult(&wowlan_data->target_ipv6_addrs[i],
46+
&solicited_addr);
47+
- for (j = 0; j < c; j++)
48+
+ for (j = 0; j < n_nsc && j < c; j++)
49+
if (ipv6_addr_cmp(&nsc[j].dest_ipv6_addr,
50+
&solicited_addr) == 0)
51+
break;
52+
--
53+
cgit 1.2.3-korg
54+

patches/stable/series

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1+
368556dd234dc4a506a35a0c99c0eee2ab475c77.patch
12
d8720235d5b5cad86c1f07f65117ef2a96f8bec7.patch
2-
v2_20250425_kees_wifi_iwlwifi_mld_work_around_clang_loop_unrolling_bug.patch

patches/stable/v2_20250425_kees_wifi_iwlwifi_mld_work_around_clang_loop_unrolling_bug.patch

Lines changed: 0 additions & 93 deletions
This file was deleted.

0 commit comments

Comments
 (0)