All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 0/3] x86/fpu: prevent leaking FPU registers via invalid FPU state
@ 2017-09-21 18:52 ` Eric Biggers
  0 siblings, 0 replies; 21+ messages in thread
From: Eric Biggers @ 2017-09-21 18:52 UTC (permalink / raw)
  To: x86
  Cc: linux-kernel, kernel-hardening, Andy Lutomirski, Dave Hansen,
	Dmitry Vyukov, Fenghua Yu, Ingo Molnar, Kevin Hao, Oleg Nesterov,
	Wanpeng Li, Yu-cheng Yu, Michael Halcrow, Eric Biggers

From: Eric Biggers <ebiggers@google.com>

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(-)

-- 
2.14.1.821.g8fa685d3b7-goog

^ permalink raw reply	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2017-09-23 18:28 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-09-21 18:52 [PATCH v3 0/3] x86/fpu: prevent leaking FPU registers via invalid FPU state Eric Biggers
2017-09-21 18:52 ` [kernel-hardening] " Eric Biggers
2017-09-21 18:52 ` [PATCH v3 1/3] x86/fpu: don't let userspace set bogus xcomp_bv Eric Biggers
2017-09-21 18:52   ` [kernel-hardening] " Eric Biggers
2017-09-21 19:59   ` Rik van Riel
2017-09-21 18:52 ` [PATCH v3 2/3] x86/fpu: tighten validation of user-supplied xstate_header Eric Biggers
2017-09-21 18:52   ` [kernel-hardening] " Eric Biggers
2017-09-21 20:21   ` Rik van Riel
2017-09-21 18:52 ` [PATCH v3 3/3] x86/fpu: reinitialize FPU registers if restoring FPU state fails Eric Biggers
2017-09-21 18:52   ` [kernel-hardening] " Eric Biggers
2017-09-21 20:41   ` Rik van Riel
2017-09-22  5:33 ` [PATCH v3 0/3] x86/fpu: prevent leaking FPU registers via invalid FPU state Ingo Molnar
2017-09-22  5:33   ` [kernel-hardening] " Ingo Molnar
2017-09-22 17:07   ` Eric Biggers
2017-09-22 17:07     ` [kernel-hardening] " Eric Biggers
2017-09-23 10:17     ` [PATCH] x86/fpu: Simplify fpu__activate_fpstate_read() Ingo Molnar
2017-09-23 10:17       ` [kernel-hardening] " Ingo Molnar
2017-09-23 11:29       ` Ingo Molnar
2017-09-23 11:29         ` [kernel-hardening] " Ingo Molnar
2017-09-23 18:28         ` Eric Biggers
2017-09-23 18:28           ` [kernel-hardening] " Eric Biggers

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.