diff options
author | Dan Williams <dan.j.williams@intel.com> | 2018-02-05 17:18:05 -0800 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2018-02-06 08:30:27 +0100 |
commit | 8e1eb3fa009aa7c0b944b3c8b26b07de0efb3200 (patch) | |
tree | 20779c15b88810040de2ebe7fb811bf5634a87fc /drivers/ntb/hw | |
parent | b2ac58f90540e39324e7a29a7ad471407ae0bf48 (diff) | |
download | op-kernel-dev-8e1eb3fa009aa7c0b944b3c8b26b07de0efb3200.zip op-kernel-dev-8e1eb3fa009aa7c0b944b3c8b26b07de0efb3200.tar.gz |
x86/entry/64: Clear extra registers beyond syscall arguments, to reduce speculation attack surface
At entry userspace may have (maliciously) populated the extra registers
outside the syscall calling convention with arbitrary values that could
be useful in a speculative execution (Spectre style) attack.
Clear these registers to minimize the kernel's attack surface.
Note, this only clears the extra registers and not the unused
registers for syscalls less than 6 arguments, since those registers are
likely to be clobbered well before their values could be put to use
under speculation.
Note, Linus found that the XOR instructions can be executed with
minimized cost if interleaved with the PUSH instructions, and Ingo's
analysis found that R10 and R11 should be included in the register
clearing beyond the typical 'extra' syscall calling convention
registers.
Suggested-by: Linus Torvalds <torvalds@linux-foundation.org>
Reported-by: Andi Kleen <ak@linux.intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Cc: <stable@vger.kernel.org>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Brian Gerst <brgerst@gmail.com>
Cc: Denys Vlasenko <dvlasenk@redhat.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Josh Poimboeuf <jpoimboe@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/151787988577.7847.16733592218894189003.stgit@dwillia2-desk3.amr.corp.intel.com
[ Made small improvements to the changelog and the code comments. ]
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'drivers/ntb/hw')
0 files changed, 0 insertions, 0 deletions