mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v6 00/13] spectre variant1 mitigations for tip/x86/pti
@ 2018-01-30  1:02 Dan Williams
  2018-01-30  1:02 ` [PATCH v6 01/13] Documentation: document array_index_nospec Dan Williams
                   ` (12 more replies)
  0 siblings, 13 replies; 31+ messages in thread
From: Dan Williams @ 2018-01-30  1:02 UTC (permalink / raw)
  To: tglx, mingo
  Cc: Mark Rutland, Cyril Novikov, kernel-hardening, Peter Zijlstra,
	Catalin Marinas, Will Deacon, H. Peter Anvin, Jiri Slaby,
	Elena Reshetova, linux-arch, Andi Kleen, Jonathan Corbet, x86,
	Russell King, Ingo Molnar, Andrew Honig, alan, Tom Lendacky,
	Kees Cook, Al Viro, Andy Lutomirski, Jim Mattson,
	Christian Lamparter, gregkh, linux-wireless, linux-kernel,
	Paolo Bonzini, Johannes Berg, torvalds, David S. Miller

Hi Thomas, Ingo,

Here is another spin of the Spectre variant1 mitigations.

Changes since v5 [1]:
* Use the _nospec suffix for all new infrastructure, i.e.
  s/ifence/barrier_nospec/, s/array_idx/array_index_nospec/,
  and s/array_idx_mask/array_index_mask_nospec/. (Ingo)

* Fix up array_index_mask_nospec() to have a proper kernel doc comment
  (Thomas)

* Fix up copyright attribution in include/linux/nospec.h (Ingo)

* Spell out 'index' and 'size' throughout the patch set rather than
  'idx' and 'sz'. (Ingo).

* Clarify placement of barrier_nospec() relative to stac() in
  __uaccess_begin_nospec() (Ingo)

* Drop the syscall fast path elimination patch out of this series since
  Andy is handling that separately. (Andy)

* Simplify the x86 array_index_mask_nospec() assembly, no need for a
  separate 32-bit version (Ingo)

* Clarify that the 'cmp, sbb' sequence in the get_user_<size> variants
  are effectively open coded array_index_nospec() instances where the
  array base is the user pointer and the array limit is the task address
  limit. (Ingo)

* Replace '<function identifier>' with <function identifier>()
  throughout the series. (Ingo)

* Comment and whitespace fixups in asm/barrier.h (Ingo)

* Split the definition of barrier_nospec() into its own patch separate
  from its new usages with __uaccess_begin_nospec(). (Ingo)

* Split the __uaccess_begin_nospec() patch into one that cleans up open
  coded stac/clac usage and one that uses the new
  __uaccess_begin_nospec() helper. (Ingo)

* Change the contents of the 'bug/spectre_v1' sysfs file to:
  "Mitigation: __user pointer sanitization" since these changes do raise
  the kernel's defenses. (Ingo)

[1]: https://www.spinics.net/lists/linux-arch/msg44193.html

---

Dan Williams (12):
      array_index_nospec: sanitize speculative array de-references
      x86: implement array_index_mask_nospec
      x86: introduce barrier_nospec
      x86: introduce __uaccess_begin_nospec
      x86, usercopy: replace open coded stac/clac with __uaccess_{begin,end}
      x86, __get_user: use __uaccess_begin_nospec
      x86, get_user: use pointer masking to limit speculation
      x86: sanitize syscall table de-references under speculation
      vfs, fdtable: prevent bounds-check bypass via speculative execution
      kvm, x86: update spectre-v1 mitigation
      nl80211: sanitize array index in parse_txq_params
      x86/spectre: report get_user mitigation for spectre_v1

Mark Rutland (1):
      Documentation: document array_index_nospec


 Documentation/speculation.txt     |   90 +++++++++++++++++++++++++++++++++++++
 arch/x86/entry/common.c           |    5 ++
 arch/x86/include/asm/barrier.h    |   28 ++++++++++++
 arch/x86/include/asm/msr.h        |    3 -
 arch/x86/include/asm/uaccess.h    |   15 +++++-
 arch/x86/include/asm/uaccess_32.h |    6 +-
 arch/x86/include/asm/uaccess_64.h |   12 ++---
 arch/x86/kernel/cpu/bugs.c        |    2 -
 arch/x86/kvm/vmx.c                |   14 ++++--
 arch/x86/lib/getuser.S            |   10 ++++
 arch/x86/lib/usercopy_32.c        |    8 ++-
 include/linux/fdtable.h           |    5 ++
 include/linux/nospec.h            |   72 ++++++++++++++++++++++++++++++
 net/wireless/nl80211.c            |    9 ++--
 14 files changed, 251 insertions(+), 28 deletions(-)
 create mode 100644 Documentation/speculation.txt
 create mode 100644 include/linux/nospec.h

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

end of thread, other threads:[~2018-02-16  8:55 UTC | newest]

Thread overview: 31+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-30  1:02 [PATCH v6 00/13] spectre variant1 mitigations for tip/x86/pti Dan Williams
2018-01-30  1:02 ` [PATCH v6 01/13] Documentation: document array_index_nospec Dan Williams
2018-01-30 22:33   ` [tip:x86/pti] Documentation: Document array_index_nospec tip-bot for Mark Rutland
2018-01-30  1:02 ` [PATCH v6 02/13] array_index_nospec: sanitize speculative array de-references Dan Williams
2018-01-30 22:34   ` [tip:x86/pti] array_index_nospec: Sanitize " tip-bot for Dan Williams
2018-02-16  8:55   ` [PATCH v6 02/13] array_index_nospec: sanitize " Christian Borntraeger
2018-01-30  1:02 ` [PATCH v6 03/13] x86: implement array_index_mask_nospec Dan Williams
2018-01-30 22:34   ` [tip:x86/pti] x86: Implement array_index_mask_nospec tip-bot for Dan Williams
2018-01-30  1:02 ` [PATCH v6 04/13] x86: introduce barrier_nospec Dan Williams
2018-01-30 22:35   ` [tip:x86/pti] x86: Introduce barrier_nospec tip-bot for Dan Williams
2018-01-30  1:02 ` [PATCH v6 05/13] x86: introduce __uaccess_begin_nospec Dan Williams
2018-01-30 22:35   ` [tip:x86/pti] x86: Introduce __uaccess_begin_nospec() and uaccess_try_nospec tip-bot for Dan Williams
2018-01-30  1:02 ` [PATCH v6 06/13] x86, usercopy: replace open coded stac/clac with __uaccess_{begin, end} Dan Williams
2018-01-30 22:35   ` [tip:x86/pti] x86/usercopy: Replace " tip-bot for Dan Williams
2018-01-30  1:02 ` [PATCH v6 07/13] x86, __get_user: use __uaccess_begin_nospec Dan Williams
2018-01-30 22:36   ` [tip:x86/pti] x86/uaccess: Use __uaccess_begin_nospec() and uaccess_try_nospec tip-bot for Dan Williams
2018-01-30  1:02 ` [PATCH v6 08/13] x86, get_user: use pointer masking to limit speculation Dan Williams
2018-01-30 22:36   ` [tip:x86/pti] x86/get_user: Use " tip-bot for Dan Williams
2018-01-30  1:02 ` [PATCH v6 09/13] x86: sanitize syscall table de-references under speculation Dan Williams
2018-01-30 22:37   ` [tip:x86/pti] x86/syscall: Sanitize " tip-bot for Dan Williams
2018-01-30  1:03 ` [PATCH v6 10/13] vfs, fdtable: prevent bounds-check bypass via speculative execution Dan Williams
2018-01-30 22:37   ` [tip:x86/pti] vfs, fdtable: Prevent " tip-bot for Dan Williams
2018-01-30  1:03 ` [PATCH v6 11/13] kvm, x86: update spectre-v1 mitigation Dan Williams
2018-01-31  3:22   ` Dan Williams
2018-01-31  8:07     ` Thomas Gleixner
2018-01-31 13:49       ` Paolo Bonzini
2018-01-31 15:42         ` Thomas Gleixner
2018-01-30  1:03 ` [PATCH v6 12/13] nl80211: sanitize array index in parse_txq_params Dan Williams
2018-01-30 22:38   ` [tip:x86/pti] nl80211: Sanitize " tip-bot for Dan Williams
2018-01-30  1:03 ` [PATCH v6 13/13] x86/spectre: report get_user mitigation for spectre_v1 Dan Williams
2018-01-30 22:38   ` [tip:x86/pti] x86/spectre: Report " tip-bot for Dan Williams

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome