* [PATCH] ARM: unwind: modules: Fix the mismatch between .ARM.exidx* and .text
@ 2026-08-06 4:10 Xie Yuanbin
2026-08-06 4:22 ` sashiko-bot
2026-08-06 9:40 ` Petr Pavlu
0 siblings, 2 replies; 4+ messages in thread
From: Xie Yuanbin @ 2026-08-06 4:10 UTC (permalink / raw)
To: linux, linusw, jpoimboe, rostedt, mcgrof, petr.pavlu, da.gomez,
samitolvanen, atomlin
Cc: linux-arm-kernel, linux-kernel, linux-modules, lilinjie8,
liaohua4, Xie Yuanbin, Xiao Junzhe
For the new version of the compilers, C code that does not explicitly
declare the section attribute may be split into sections other than
".text", such as ".text.unlikely" and ".text.hot". If unwind is enabled,
this will also split the ".ARM.exidx.text.*" sections.
As scripts/module.lds.S, ".text.[0-9a-zA-Z_]*" sections will be merged
into ".text" section. However, ".ARM.exidx.text.*" sections will not be
merged.
For the following module code, using the gcc-16 compiler and the
latest linux-next code, will result in dump_stack() failure.
```c
void noinline stack_func_issue(void)
{
dump_stack();
pr_emerg("dump stack finish!\n");
}
EXPORT_SYMBOL(stack_func_issue);
static int __init mmodule_init(void)
{
stack_func_issue();
return 0;
}
module_init(mmodule_init);
```
```log
root@(none):/# busybox/usr/bin/busybox insmod test2.ko
[ 10.846774] test: loading out-of-tree module taints kernel.
[ 10.851840] CPU: 0 UID: 0 PID: 93 Comm: busybox Tainted: G W O 7.2.0-rc6-next-20260805-00002-g3d7269e6e98c #3 VOLUNTARY
[ 10.852350] Tainted: [W]=WARN, [O]=OOT_MODULE
[ 10.852405] Hardware name: Generic DT based system
[ 10.852516] Call trace:
[ 10.852939] unwind_backtrace from show_stack+0x10/0x14
[ 10.853487] show_stack from dump_stack_lvl+0x54/0x68
[ 10.853512] dump_stack_lvl from stack_func_issue+0x8/0xc0 [test]
[ 10.854134] unwind: Index not found bf000008
[ 10.858157] dump stack finish!
```
Merge ".ARM.extab.text.[0-9a-z-A-Z_]*" sections into ".ARM.extab" section
and merge ".ARM.exidx.text.[0-9a-z-A-Z_]*" sections into ".ARM.exidx"
section to fix the issue.
Signed-off-by: Xiao Junzhe <xiaojunzhe1@h-partners.com>
Signed-off-by: Xie Yuanbin <xieyuanbin1@huawei.com>
---
scripts/module.lds.S | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/scripts/module.lds.S b/scripts/module.lds.S
index d0f200428957..0ccf0c205d00 100644
--- a/scripts/module.lds.S
+++ b/scripts/module.lds.S
@@ -39,6 +39,10 @@ SECTIONS {
.text 0 : {
*(.text .text.[0-9a-zA-Z_]*)
}
+#if defined(CONFIG_ARM) && defined(CONFIG_ARM_UNWIND)
+ .ARM.extab : {*(.ARM.extab .ARM.extab.text.[0-9a-z-A-Z_]*) }
+ .ARM.exidx : {*(.ARM.exidx .ARM.exidx.text.[0-9a-z-A-Z_]*) }
+#endif
#endif
.bss 0 : {
--
2.55.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] ARM: unwind: modules: Fix the mismatch between .ARM.exidx* and .text
2026-08-06 4:10 [PATCH] ARM: unwind: modules: Fix the mismatch between .ARM.exidx* and .text Xie Yuanbin
@ 2026-08-06 4:22 ` sashiko-bot
2026-08-06 9:40 ` Petr Pavlu
1 sibling, 0 replies; 4+ messages in thread
From: sashiko-bot @ 2026-08-06 4:22 UTC (permalink / raw)
To: Xie Yuanbin; +Cc: linux-modules
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] Typo in the wildcard pattern `[0-9a-z-A-Z_]*` introduces an unintended literal hyphen and diverges from the `.text` pattern syntax.
--
--- Patch [1]: [PATCH] ARM: unwind: modules: Fix the mismatch between .ARM.exidx* and .text ---
commit 77bfa32ad8c348a1008e578b132ff69e6108ddd2
Author: Xie Yuanbin <xieyuanbin1@huawei.com>
ARM: unwind: modules: Fix the mismatch between .ARM.exidx* and .text
This commit modifies the module linker script for ARM to merge
.ARM.extab.text.* and .ARM.exidx.text.* sections. It addresses a stack
unwinding failure caused by newer compilers splitting sections.
> diff --git a/scripts/module.lds.S b/scripts/module.lds.S
> index d0f2004289576..0ccf0c205d005 100644
> --- a/scripts/module.lds.S
> +++ b/scripts/module.lds.S
> @@ -39,6 +39,10 @@ SECTIONS {
> .text 0 : {
> *(.text .text.[0-9a-zA-Z_]*)
> }
> +#if defined(CONFIG_ARM) && defined(CONFIG_ARM_UNWIND)
> + .ARM.extab : {*(.ARM.extab .ARM.extab.text.[0-9a-z-A-Z_]*) }
> + .ARM.exidx : {*(.ARM.exidx .ARM.exidx.text.[0-9a-z-A-Z_]*) }
[Severity: Low]
This isn't a bug, but there appears to be an extra hyphen in the wildcard
pattern between z and A. Could this be corrected to match the [0-9a-zA-Z_]*
pattern used in the .text section just above?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260806041001.143888-1-xieyuanbin1@huawei.com?part=1
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] ARM: unwind: modules: Fix the mismatch between .ARM.exidx* and .text
2026-08-06 4:10 [PATCH] ARM: unwind: modules: Fix the mismatch between .ARM.exidx* and .text Xie Yuanbin
2026-08-06 4:22 ` sashiko-bot
@ 2026-08-06 9:40 ` Petr Pavlu
2026-08-06 9:58 ` Xie Yuanbin
1 sibling, 1 reply; 4+ messages in thread
From: Petr Pavlu @ 2026-08-06 9:40 UTC (permalink / raw)
To: Xie Yuanbin
Cc: linux, linusw, jpoimboe, rostedt, mcgrof, da.gomez, samitolvanen,
atomlin, Xiao Junzhe, linux-arm-kernel, linux-kernel,
linux-modules, lilinjie8, liaohua4, Xiao Junzhe
On 8/6/26 6:10 AM, Xie Yuanbin wrote:
> For the new version of the compilers, C code that does not explicitly
> declare the section attribute may be split into sections other than
> ".text", such as ".text.unlikely" and ".text.hot". If unwind is enabled,
> this will also split the ".ARM.exidx.text.*" sections.
>
> As scripts/module.lds.S, ".text.[0-9a-zA-Z_]*" sections will be merged
> into ".text" section. However, ".ARM.exidx.text.*" sections will not be
> merged.
>
> For the following module code, using the gcc-16 compiler and the
> latest linux-next code, will result in dump_stack() failure.
> ```c
> void noinline stack_func_issue(void)
> {
> dump_stack();
> pr_emerg("dump stack finish!\n");
> }
> EXPORT_SYMBOL(stack_func_issue);
>
> static int __init mmodule_init(void)
> {
> stack_func_issue();
> return 0;
> }
>
> module_init(mmodule_init);
> ```
> ```log
> root@(none):/# busybox/usr/bin/busybox insmod test2.ko
> [ 10.846774] test: loading out-of-tree module taints kernel.
> [ 10.851840] CPU: 0 UID: 0 PID: 93 Comm: busybox Tainted: G W O 7.2.0-rc6-next-20260805-00002-g3d7269e6e98c #3 VOLUNTARY
> [ 10.852350] Tainted: [W]=WARN, [O]=OOT_MODULE
> [ 10.852405] Hardware name: Generic DT based system
> [ 10.852516] Call trace:
> [ 10.852939] unwind_backtrace from show_stack+0x10/0x14
> [ 10.853487] show_stack from dump_stack_lvl+0x54/0x68
> [ 10.853512] dump_stack_lvl from stack_func_issue+0x8/0xc0 [test]
> [ 10.854134] unwind: Index not found bf000008
> [ 10.858157] dump stack finish!
> ```
>
> Merge ".ARM.extab.text.[0-9a-z-A-Z_]*" sections into ".ARM.extab" section
> and merge ".ARM.exidx.text.[0-9a-z-A-Z_]*" sections into ".ARM.exidx"
> section to fix the issue.
A fix for this issue was posted previously:
https://lore.kernel.org/linux-modules/tencent_08845B64E5F38EB7FA1779982A071AB4A607@qq.com/
--
Thanks,
Petr
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] ARM: unwind: modules: Fix the mismatch between .ARM.exidx* and .text
2026-08-06 9:40 ` Petr Pavlu
@ 2026-08-06 9:58 ` Xie Yuanbin
0 siblings, 0 replies; 4+ messages in thread
From: Xie Yuanbin @ 2026-08-06 9:58 UTC (permalink / raw)
To: petr.pavlu
Cc: atomlin, da.gomez, egg12138, jpoimboe, liaohua4, lilinjie8,
linusw, linux-arm-kernel, linux-kernel, linux-modules, linux,
mcgrof, rostedt, samitolvanen, xiaojunzhe1, xieyuanbin1
On Thu, 6 Aug 2026 11:40:23 +0200, Petr Pavlu wrote:
> A fix for this issue was posted previously:
>
> https://lore.kernel.org/linux-modules/tencent_08845B64E5F38EB7FA1779982A071AB4A607@qq.com/
Oh, sorry, I didn't know about this. Let's discuss it on
previously posted patch. :)
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2026-08-06 9:59 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-06 4:10 [PATCH] ARM: unwind: modules: Fix the mismatch between .ARM.exidx* and .text Xie Yuanbin
2026-08-06 4:22 ` sashiko-bot
2026-08-06 9:40 ` Petr Pavlu
2026-08-06 9:58 ` Xie Yuanbin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox