[lkml]   [2017]   [Sep]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Subject[PATCH v3 0/3] x86/fpu: prevent leaking FPU registers via invalid FPU state
From: Eric Biggers <>

This series fixes the bug found by syzkaller where the ptrace syscall
can be used to set invalid bits in a task's FPU state. I also found
that an equivalent bug was reachable using the sigreturn syscall, so the
first patch fixes the bug in both cases.

The other two patches start validating the other parts of the
xstate_header and make it so that invalid FPU states can no longer be
abused to leak the FPU registers of other processes.

Changes since v2:
- Use an exception handler to handle invalid FPU states
(suggested by Andy Lutomirski)
- Check the size of xstate_header.reserved at build time
(suggested by Dave Hansen)

Eric Biggers (3):
x86/fpu: don't let userspace set bogus xcomp_bv
x86/fpu: tighten validation of user-supplied xstate_header
x86/fpu: reinitialize FPU registers if restoring FPU state fails

arch/x86/include/asm/fpu/internal.h | 51 +++++++++++--------------------------
arch/x86/include/asm/fpu/xstate.h | 25 ++++++++++++++++++
arch/x86/kernel/fpu/regset.c | 20 +++++++--------
arch/x86/kernel/fpu/signal.c | 15 ++++++++---
arch/x86/kernel/fpu/xstate.c | 27 ++++++++------------
arch/x86/mm/extable.c | 24 +++++++++++++++++
6 files changed, 94 insertions(+), 68 deletions(-)


 \ /
  Last update: 2017-09-21 20:54    [W:0.148 / U:12.220 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site