]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit - arch/x86/kernel/cpu/common.c
x86/signal: Introduce helpers to get the maximum signal frame size
authorChang S. Bae <chang.seok.bae@intel.com>
Tue, 18 May 2021 20:03:16 +0000 (13:03 -0700)
committerBorislav Petkov <bp@suse.de>
Wed, 19 May 2021 09:46:27 +0000 (11:46 +0200)
commit939ef713297df2cc910592305aa26af0e87f28ac
tree346b1c50d3928c071d45e4c899b4ffef58ef7b31
parent7cd60e43a6def40ecb75deb8decc677995970d0b
x86/signal: Introduce helpers to get the maximum signal frame size

Signal frames do not have a fixed format and can vary in size when a number
of things change: supported XSAVE features, 32 vs. 64-bit apps, etc.

Add support for a runtime method for userspace to dynamically discover
how large a signal stack needs to be.

Introduce a new variable, max_frame_size, and helper functions for the
calculation to be used in a new user interface. Set max_frame_size to a
system-wide worst-case value, instead of storing multiple app-specific
values.

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>
Acked-by: H.J. Lu <hjl.tools@gmail.com>
Link: https://lkml.kernel.org/r/20210518200320.17239-3-chang.seok.bae@intel.com
arch/x86/include/asm/fpu/signal.h
arch/x86/include/asm/sigframe.h
arch/x86/kernel/cpu/common.c
arch/x86/kernel/fpu/signal.c
arch/x86/kernel/signal.c