summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorAndy Lutomirski <luto@kernel.org>2021-06-08 16:36:22 +0200
committerBorislav Petkov <bp@suse.de>2021-06-09 14:46:20 +0200
commitf72a249b0ba85564c6bfa94d609a70567485a061 (patch)
treea311267a2763171d12c351c156e24793f231d32f /tools
parent8919f07276991c7bf0d0802f0356331c5c62f7a2 (diff)
downloadlinux-stable-f72a249b0ba85564c6bfa94d609a70567485a061.tar.gz
linux-stable-f72a249b0ba85564c6bfa94d609a70567485a061.tar.bz2
linux-stable-f72a249b0ba85564c6bfa94d609a70567485a061.zip
x86/fpu: Add address range checks to copy_user_to_xstate()
copy_user_to_xstate() uses __copy_from_user(), which provides a negligible speedup. Fortunately, both call sites are at least almost correct. __fpu__restore_sig() checks access_ok() with xstate_sigframe_size() length and ptrace regset access uses fpu_user_xstate_size. These should be valid upper bounds on the length, so, at worst, this would cause spurious failures and not accesses to kernel memory. Nonetheless, this is far more fragile than necessary and none of these callers are in a hotpath. Use copy_from_user() instead. Signed-off-by: Andy Lutomirski <luto@kernel.org> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Borislav Petkov <bp@suse.de> Acked-by: Dave Hansen <dave.hansen@linux.intel.com> Acked-by: Rik van Riel <riel@surriel.com> Link: https://lkml.kernel.org/r/20210608144346.140254130@linutronix.de
Diffstat (limited to 'tools')
0 files changed, 0 insertions, 0 deletions