x86: Implement thread_struct whitelist for hardened usercopy
authorKees Cook <keescook@chromium.org>
Wed, 16 Aug 2017 20:26:03 +0000 (13:26 -0700)
committerKees Cook <keescook@chromium.org>
Mon, 15 Jan 2018 20:08:05 +0000 (12:08 -0800)
commitf7d83c1cf3c77ae45876792aee5285ae970413ac
tree885c783c6717503e5935338a0fe9f4387b52a9ec
parent5905429ad85657c28d93ec3d826ddeea1f44c3ce
x86: Implement thread_struct whitelist for hardened usercopy

This whitelists the FPU register state portion of the thread_struct for
copying to userspace, instead of the default entire struct. This is needed
because FPU register state is dynamically sized, so it doesn't bypass the
hardened usercopy checks.

Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: x86@kernel.org
Cc: Borislav Petkov <bp@suse.de>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: Mathias Krause <minipli@googlemail.com>
Signed-off-by: Kees Cook <keescook@chromium.org>
Acked-by: Rik van Riel <riel@redhat.com>
arch/x86/Kconfig
arch/x86/include/asm/processor.h