0214-x86-mm-pti-Add-Kconfig.patch 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. From 0692cf84257a92f7be9553af55d65c668e2b3bc8 Mon Sep 17 00:00:00 2001
  2. From: Dave Hansen <[email protected]>
  3. Date: Mon, 4 Dec 2017 15:08:03 +0100
  4. Subject: [PATCH 214/242] x86/mm/pti: Add Kconfig
  5. MIME-Version: 1.0
  6. Content-Type: text/plain; charset=UTF-8
  7. Content-Transfer-Encoding: 8bit
  8. CVE-2017-5754
  9. Finally allow CONFIG_PAGE_TABLE_ISOLATION to be enabled.
  10. PARAVIRT generally requires that the kernel not manage its own page tables.
  11. It also means that the hypervisor and kernel must agree wholeheartedly
  12. about what format the page tables are in and what they contain.
  13. PAGE_TABLE_ISOLATION, unfortunately, changes the rules and they
  14. can not be used together.
  15. I've seen conflicting feedback from maintainers lately about whether they
  16. want the Kconfig magic to go first or last in a patch series. It's going
  17. last here because the partially-applied series leads to kernels that can
  18. not boot in a bunch of cases. I did a run through the entire series with
  19. CONFIG_PAGE_TABLE_ISOLATION=y to look for build errors, though.
  20. [ tglx: Removed SMP and !PARAVIRT dependencies as they not longer exist ]
  21. Signed-off-by: Dave Hansen <[email protected]>
  22. Signed-off-by: Thomas Gleixner <[email protected]>
  23. Cc: Andy Lutomirski <[email protected]>
  24. Cc: Boris Ostrovsky <[email protected]>
  25. Cc: Borislav Petkov <[email protected]>
  26. Cc: Brian Gerst <[email protected]>
  27. Cc: David Laight <[email protected]>
  28. Cc: Denys Vlasenko <[email protected]>
  29. Cc: Eduardo Valentin <[email protected]>
  30. Cc: Greg KH <[email protected]>
  31. Cc: H. Peter Anvin <[email protected]>
  32. Cc: Josh Poimboeuf <[email protected]>
  33. Cc: Juergen Gross <[email protected]>
  34. Cc: Linus Torvalds <[email protected]>
  35. Cc: Peter Zijlstra <[email protected]>
  36. Cc: Will Deacon <[email protected]>
  37. Cc: [email protected]
  38. Cc: [email protected]
  39. Cc: [email protected]
  40. Cc: [email protected]
  41. Cc: [email protected]
  42. Signed-off-by: Ingo Molnar <[email protected]>
  43. (cherry picked from commit 385ce0ea4c078517fa51c261882c4e72fba53005)
  44. Signed-off-by: Andy Whitcroft <[email protected]>
  45. Signed-off-by: Kleber Sacilotto de Souza <[email protected]>
  46. (cherry picked from commit ce12963b837e809f6ae048587d9377a298c1094d)
  47. Signed-off-by: Fabian Grünbichler <[email protected]>
  48. ---
  49. security/Kconfig | 10 ++++++++++
  50. 1 file changed, 10 insertions(+)
  51. diff --git a/security/Kconfig b/security/Kconfig
  52. index 305b496ff6a3..91cb8f611a0d 100644
  53. --- a/security/Kconfig
  54. +++ b/security/Kconfig
  55. @@ -96,6 +96,16 @@ config SECURITY_NETWORK
  56. implement socket and networking access controls.
  57. If you are unsure how to answer this question, answer N.
  58. +config PAGE_TABLE_ISOLATION
  59. + bool "Remove the kernel mapping in user mode"
  60. + depends on X86_64 && !UML
  61. + help
  62. + This feature reduces the number of hardware side channels by
  63. + ensuring that the majority of kernel addresses are not mapped
  64. + into userspace.
  65. +
  66. + See Documentation/x86/pagetable-isolation.txt for more details.
  67. +
  68. config SECURITY_INFINIBAND
  69. bool "Infiniband Security Hooks"
  70. depends on SECURITY && INFINIBAND
  71. --
  72. 2.14.2