All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] x86/sev-es: Check for trusted regs->sp in __sev_es_ist_enter()
@ 2021-02-17 12:01 ` Joerg Roedel
  0 siblings, 0 replies; 26+ messages in thread
From: Joerg Roedel @ 2021-02-17 12:01 UTC (permalink / raw)
  To: x86
  Cc: Joerg Roedel, Joerg Roedel, hpa, Andy Lutomirski, Dave Hansen,
	Peter Zijlstra, Jiri Slaby, Dan Williams, Tom Lendacky,
	Juergen Gross, Kees Cook, David Rientjes, Cfir Cohen,
	Erdem Aktas, Masami Hiramatsu, Mike Stunes, Sean Christopherson,
	Martin Radev, Arvind Sankar, linux-kernel, kvm, virtualization

From: Joerg Roedel <jroedel@suse.de>

Hi,

here are some changes to the Linux SEV-ES code to check whether the
value in regs->sp can be trusted, before checking whether it points to
the #VC IST stack.

Andy Lutomirski reported that it is entirely possible to reach this
function with a regs->sp value which was set by user-space. So check
for this condition and don't use regs->sp if it can't be trusted.

Also improve the comments around __sev_es_ist_enter/exit() to better
explain what these function do and why they are there.

Please review.

Thanks,

	Joerg

Joerg Roedel (3):
  x86/sev-es: Introduce from_syscall_gap() helper
  x86/sev-es: Check if regs->sp is trusted before adjusting #VC IST
    stack
  x86/sev-es: Improve comments in and around __sev_es_ist_enter/exit()

 arch/x86/include/asm/ptrace.h |  8 ++++++++
 arch/x86/kernel/sev-es.c      | 27 +++++++++++++++++++--------
 arch/x86/kernel/traps.c       |  3 +--
 3 files changed, 28 insertions(+), 10 deletions(-)

-- 
2.30.0


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

end of thread, other threads:[~2021-02-19 11:06 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-17 12:01 [PATCH 0/3] x86/sev-es: Check for trusted regs->sp in __sev_es_ist_enter() Joerg Roedel
2021-02-17 12:01 ` Joerg Roedel
2021-02-17 12:01 ` [PATCH 1/3] x86/sev-es: Introduce from_syscall_gap() helper Joerg Roedel
2021-02-17 12:01   ` Joerg Roedel
2021-02-17 17:59   ` Borislav Petkov
2021-02-17 17:59     ` Borislav Petkov
2021-02-17 12:01 ` [PATCH 2/3] x86/sev-es: Check if regs->sp is trusted before adjusting #VC IST stack Joerg Roedel
2021-02-17 12:01   ` Joerg Roedel
2021-02-17 18:00   ` Borislav Petkov
2021-02-17 18:00     ` Borislav Petkov
2021-02-17 18:09   ` Andy Lutomirski
2021-02-17 18:09     ` Andy Lutomirski
2021-02-18 11:25     ` Joerg Roedel
2021-02-18 11:25       ` Joerg Roedel
2021-02-18 17:49       ` Andy Lutomirski
2021-02-18 17:49         ` Andy Lutomirski
2021-02-18 19:21         ` Joerg Roedel
2021-02-18 19:21           ` Joerg Roedel
2021-02-19  0:28           ` Andy Lutomirski
2021-02-19  0:28             ` Andy Lutomirski
2021-02-19 11:05             ` Joerg Roedel
2021-02-19 11:05               ` Joerg Roedel
2021-02-17 12:01 ` [PATCH 3/3] x86/sev-es: Improve comments in and around __sev_es_ist_enter/exit() Joerg Roedel
2021-02-17 12:01   ` Joerg Roedel
2021-02-17 18:00   ` Borislav Petkov
2021-02-17 18:00     ` Borislav Petkov

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.