x86/signal: Use fpu::__state_user_size for sigalt stack validation
authorThomas Gleixner <tglx@linutronix.de>
Thu, 21 Oct 2021 22:55:12 +0000 (15:55 -0700)
committerBorislav Petkov <bp@suse.de>
Tue, 26 Oct 2021 08:18:09 +0000 (10:18 +0200)
commit4b7ca609a33dd8696bcbd2f1ad949e26a591592f
treef6a57508f14ddcbe80104396373f99cd8df55a2e
parent23686ef25d4ae81bc12fe3994d1905191fcf71f8
x86/signal: Use fpu::__state_user_size for sigalt stack validation

Use the current->group_leader->fpu to check for pending permissions to use
extended features and validate against the resulting user space size which
is stored in the group leaders fpu struct as well.

This prevents a task from installing a too small sized sigaltstack after
permissions to use dynamically enabled features have been granted, but
the task has not (yet) used a related instruction.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Chang S. Bae <chang.seok.bae@intel.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Link: https://lkml.kernel.org/r/20211021225527.10184-9-chang.seok.bae@intel.com
arch/x86/kernel/signal.c