diff mbox series

[v2,2/2] riscv: signal: fix signal_minsigstksz

Message ID 20241220083926.19453-3-yongxuan.wang@sifive.com (mailing list archive)
State New
Headers show
Series riscv: signal: fix the size of signal frame | expand

Checks

Context Check Description
conchuod/vmtest-for-next-PR success PR summary
conchuod/patch-2-test-1 success .github/scripts/patches/tests/build_rv32_defconfig.sh took 103.46s
conchuod/patch-2-test-2 success .github/scripts/patches/tests/build_rv64_clang_allmodconfig.sh took 1046.77s
conchuod/patch-2-test-3 success .github/scripts/patches/tests/build_rv64_gcc_allmodconfig.sh took 1238.89s
conchuod/patch-2-test-4 success .github/scripts/patches/tests/build_rv64_nommu_k210_defconfig.sh took 15.85s
conchuod/patch-2-test-5 success .github/scripts/patches/tests/build_rv64_nommu_virt_defconfig.sh took 17.81s
conchuod/patch-2-test-6 success .github/scripts/patches/tests/checkpatch.sh took 0.35s
conchuod/patch-2-test-7 success .github/scripts/patches/tests/dtb_warn_rv64.sh took 36.79s
conchuod/patch-2-test-8 success .github/scripts/patches/tests/header_inline.sh took 0.00s
conchuod/patch-2-test-9 success .github/scripts/patches/tests/kdoc.sh took 0.44s
conchuod/patch-2-test-10 success .github/scripts/patches/tests/module_param.sh took 0.01s
conchuod/patch-2-test-11 success .github/scripts/patches/tests/verify_fixes.sh took 0.01s
conchuod/patch-2-test-12 success .github/scripts/patches/tests/verify_signedoff.sh took 0.02s

Commit Message

Yong-Xuan Wang Dec. 20, 2024, 8:39 a.m. UTC
The init_rt_signal_env() funciton is called before the alternative patch
is applied, so using the alternative-related API to check the availability
of an extension within this function doesn't have the intended effect.
This patch reorders the init_rt_signal_env() and apply_boot_alternatives()
to get the correct signal_minsigstksz.

Fixes: e92f469b0771 ("riscv: signal: Report signal frame size to userspace via auxv")
Signed-off-by: Yong-Xuan Wang <yongxuan.wang@sifive.com>
Reviewed-by: Zong Li <zong.li@sifive.com>
---
 arch/riscv/kernel/setup.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Andy Chiu Dec. 20, 2024, 2:48 p.m. UTC | #1
Hi Yong-Xuan,

Yong-Xuan Wang <yongxuan.wang@sifive.com> 於 2024年12月20日 週五 下午4:39寫道:
>
> The init_rt_signal_env() funciton is called before the alternative patch
> is applied, so using the alternative-related API to check the availability
> of an extension within this function doesn't have the intended effect.
> This patch reorders the init_rt_signal_env() and apply_boot_alternatives()
> to get the correct signal_minsigstksz.
>
> Fixes: e92f469b0771 ("riscv: signal: Report signal frame size to userspace via auxv")
> Signed-off-by: Yong-Xuan Wang <yongxuan.wang@sifive.com>
> Reviewed-by: Zong Li <zong.li@sifive.com>

Reviewed-by: Andy Chiu <andybnac@gmail.com>

> ---
>  arch/riscv/kernel/setup.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/riscv/kernel/setup.c b/arch/riscv/kernel/setup.c
> index 016b48fcd6f2..b7c91f546453 100644
> --- a/arch/riscv/kernel/setup.c
> +++ b/arch/riscv/kernel/setup.c
> @@ -324,8 +324,8 @@ void __init setup_arch(char **cmdline_p)
>
>         riscv_init_cbo_blocksizes();
>         riscv_fill_hwcap();
> -       init_rt_signal_env();
>         apply_boot_alternatives();
> +       init_rt_signal_env();
>
>         if (IS_ENABLED(CONFIG_RISCV_ISA_ZICBOM) &&
>             riscv_isa_extension_available(NULL, ZICBOM))
> --
> 2.17.1
>

Thanks,
Andy
diff mbox series

Patch

diff --git a/arch/riscv/kernel/setup.c b/arch/riscv/kernel/setup.c
index 016b48fcd6f2..b7c91f546453 100644
--- a/arch/riscv/kernel/setup.c
+++ b/arch/riscv/kernel/setup.c
@@ -324,8 +324,8 @@  void __init setup_arch(char **cmdline_p)
 
 	riscv_init_cbo_blocksizes();
 	riscv_fill_hwcap();
-	init_rt_signal_env();
 	apply_boot_alternatives();
+	init_rt_signal_env();
 
 	if (IS_ENABLED(CONFIG_RISCV_ISA_ZICBOM) &&
 	    riscv_isa_extension_available(NULL, ZICBOM))