0199-x86-entry-Align-entry-text-section-to-PMD-boundary.patch 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. From 1b3d3968bb45b557ce76eaf3edf894aead9e9c03 Mon Sep 17 00:00:00 2001
  2. From: Thomas Gleixner <[email protected]>
  3. Date: Mon, 4 Dec 2017 15:07:46 +0100
  4. Subject: [PATCH 199/242] x86/entry: Align entry text section to PMD boundary
  5. MIME-Version: 1.0
  6. Content-Type: text/plain; charset=UTF-8
  7. Content-Transfer-Encoding: 8bit
  8. CVE-2017-5754
  9. The (irq)entry text must be visible in the user space page tables. To allow
  10. simple PMD based sharing, make the entry text PMD aligned.
  11. Signed-off-by: Thomas Gleixner <[email protected]>
  12. Cc: Andy Lutomirski <[email protected]>
  13. Cc: Boris Ostrovsky <[email protected]>
  14. Cc: Borislav Petkov <[email protected]>
  15. Cc: Brian Gerst <[email protected]>
  16. Cc: Dave Hansen <[email protected]>
  17. Cc: David Laight <[email protected]>
  18. Cc: Denys Vlasenko <[email protected]>
  19. Cc: Eduardo Valentin <[email protected]>
  20. Cc: Greg KH <[email protected]>
  21. Cc: H. Peter Anvin <[email protected]>
  22. Cc: Josh Poimboeuf <[email protected]>
  23. Cc: Juergen Gross <[email protected]>
  24. Cc: Linus Torvalds <[email protected]>
  25. Cc: Peter Zijlstra <[email protected]>
  26. Cc: Will Deacon <[email protected]>
  27. Cc: [email protected]
  28. Cc: [email protected]
  29. Cc: [email protected]
  30. Cc: [email protected]
  31. Signed-off-by: Ingo Molnar <[email protected]>
  32. (cherry picked from commit 2f7412ba9c6af5ab16bdbb4a3fdb1dcd2b4fd3c2)
  33. Signed-off-by: Andy Whitcroft <[email protected]>
  34. Signed-off-by: Kleber Sacilotto de Souza <[email protected]>
  35. (cherry picked from commit 3cf72b14b56834882ebe731d5fa84d249c56a188)
  36. Signed-off-by: Fabian Grünbichler <[email protected]>
  37. ---
  38. arch/x86/kernel/vmlinux.lds.S | 8 ++++++++
  39. 1 file changed, 8 insertions(+)
  40. diff --git a/arch/x86/kernel/vmlinux.lds.S b/arch/x86/kernel/vmlinux.lds.S
  41. index 423aa36f0150..f505d8dbdccf 100644
  42. --- a/arch/x86/kernel/vmlinux.lds.S
  43. +++ b/arch/x86/kernel/vmlinux.lds.S
  44. @@ -60,11 +60,17 @@ jiffies_64 = jiffies;
  45. . = ALIGN(HPAGE_SIZE); \
  46. __end_rodata_hpage_align = .;
  47. +#define ALIGN_ENTRY_TEXT_BEGIN . = ALIGN(PMD_SIZE);
  48. +#define ALIGN_ENTRY_TEXT_END . = ALIGN(PMD_SIZE);
  49. +
  50. #else
  51. #define X64_ALIGN_RODATA_BEGIN
  52. #define X64_ALIGN_RODATA_END
  53. +#define ALIGN_ENTRY_TEXT_BEGIN
  54. +#define ALIGN_ENTRY_TEXT_END
  55. +
  56. #endif
  57. PHDRS {
  58. @@ -101,8 +107,10 @@ SECTIONS
  59. CPUIDLE_TEXT
  60. LOCK_TEXT
  61. KPROBES_TEXT
  62. + ALIGN_ENTRY_TEXT_BEGIN
  63. ENTRY_TEXT
  64. IRQENTRY_TEXT
  65. + ALIGN_ENTRY_TEXT_END
  66. SOFTIRQENTRY_TEXT
  67. *(.fixup)
  68. *(.gnu.warning)
  69. --
  70. 2.14.2