aboutsummaryrefslogtreecommitdiff
path: root/arch/x86/kernel/signal.c
diff options
context:
space:
mode:
authorGravatar Chang S. Bae <chang.seok.bae@intel.com> 2021-05-18 13:03:17 -0700
committerGravatar Borislav Petkov <bp@suse.de> 2021-05-19 12:18:45 +0200
commit1c33bb0507508af24fd754dd7123bd8e997fab2f (patch)
tree0a245b44e47ae22c57669af809f34ff1d9549314 /arch/x86/kernel/signal.c
parentx86/signal: Introduce helpers to get the maximum signal frame size (diff)
downloadlinux-1c33bb0507508af24fd754dd7123bd8e997fab2f.tar.gz
linux-1c33bb0507508af24fd754dd7123bd8e997fab2f.tar.bz2
linux-1c33bb0507508af24fd754dd7123bd8e997fab2f.zip
x86/elf: Support a new ELF aux vector AT_MINSIGSTKSZ
Historically, signal.h defines MINSIGSTKSZ (2KB) and SIGSTKSZ (8KB), for use by all architectures with sigaltstack(2). Over time, the hardware state size grew, but these constants did not evolve. Today, literal use of these constants on several architectures may result in signal stack overflow, and thus user data corruption. A few years ago, the ARM team addressed this issue by establishing getauxval(AT_MINSIGSTKSZ). This enables the kernel to supply a value at runtime that is an appropriate replacement on current and future hardware. Add getauxval(AT_MINSIGSTKSZ) support to x86, analogous to the support added for ARM in 94b07c1f8c39 ("arm64: signal: Report signal frame size to userspace via auxv"). Also, include a documentation to describe x86-specific auxiliary vectors. Signed-off-by: Chang S. Bae <chang.seok.bae@intel.com> Signed-off-by: Borislav Petkov <bp@suse.de> Reviewed-by: Len Brown <len.brown@intel.com> Acked-by: Thomas Gleixner <tglx@linutronix.de> Link: https://lkml.kernel.org/r/20210518200320.17239-4-chang.seok.bae@intel.com
Diffstat (limited to 'arch/x86/kernel/signal.c')
-rw-r--r--arch/x86/kernel/signal.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/arch/x86/kernel/signal.c b/arch/x86/kernel/signal.c
index 689a4b6dd18f..86e53868159a 100644
--- a/arch/x86/kernel/signal.c
+++ b/arch/x86/kernel/signal.c
@@ -718,6 +718,11 @@ void __init init_sigframe_size(void)
pr_info("max sigframe size: %lu\n", max_frame_size);
}
+unsigned long get_sigframe_size(void)
+{
+ return max_frame_size;
+}
+
static inline int is_ia32_compat_frame(struct ksignal *ksig)
{
return IS_ENABLED(CONFIG_IA32_EMULATION) &&