0094-x86-entry-64-Remove-the-RESTORE_._REGS-infrastructur.patch 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. From 8837585aa116d1aa832e524442a1e9953d17a196 Mon Sep 17 00:00:00 2001
  2. From: Andy Lutomirski <[email protected]>
  3. Date: Thu, 2 Nov 2017 00:59:06 -0700
  4. Subject: [PATCH 094/242] x86/entry/64: Remove the RESTORE_..._REGS
  5. infrastructure
  6. MIME-Version: 1.0
  7. Content-Type: text/plain; charset=UTF-8
  8. Content-Transfer-Encoding: 8bit
  9. CVE-2017-5754
  10. All users of RESTORE_EXTRA_REGS, RESTORE_C_REGS and such, and
  11. REMOVE_PT_GPREGS_FROM_STACK are gone. Delete the macros.
  12. Signed-off-by: Andy Lutomirski <[email protected]>
  13. Cc: Borislav Petkov <[email protected]>
  14. Cc: Brian Gerst <[email protected]>
  15. Cc: Dave Hansen <[email protected]>
  16. Cc: Linus Torvalds <[email protected]>
  17. Cc: Peter Zijlstra <[email protected]>
  18. Cc: Thomas Gleixner <[email protected]>
  19. Link: http://lkml.kernel.org/r/c32672f6e47c561893316d48e06c7656b1039a36.1509609304.git.luto@kernel.org
  20. Signed-off-by: Ingo Molnar <[email protected]>
  21. (cherry picked from commit c39858de696f0cc160a544455e8403d663d577e9)
  22. Signed-off-by: Andy Whitcroft <[email protected]>
  23. Signed-off-by: Kleber Sacilotto de Souza <[email protected]>
  24. (cherry picked from commit d248c62028c5467cd5a5ce06d344e3fb330da3ec)
  25. Signed-off-by: Fabian Grünbichler <[email protected]>
  26. ---
  27. arch/x86/entry/calling.h | 52 ------------------------------------------------
  28. 1 file changed, 52 deletions(-)
  29. diff --git a/arch/x86/entry/calling.h b/arch/x86/entry/calling.h
  30. index 0b9dd8123701..1895a685d3dd 100644
  31. --- a/arch/x86/entry/calling.h
  32. +++ b/arch/x86/entry/calling.h
  33. @@ -141,16 +141,6 @@ For 32-bit we have the following conventions - kernel is built with
  34. UNWIND_HINT_REGS offset=\offset
  35. .endm
  36. - .macro RESTORE_EXTRA_REGS offset=0
  37. - movq 0*8+\offset(%rsp), %r15
  38. - movq 1*8+\offset(%rsp), %r14
  39. - movq 2*8+\offset(%rsp), %r13
  40. - movq 3*8+\offset(%rsp), %r12
  41. - movq 4*8+\offset(%rsp), %rbp
  42. - movq 5*8+\offset(%rsp), %rbx
  43. - UNWIND_HINT_REGS offset=\offset extra=0
  44. - .endm
  45. -
  46. .macro POP_EXTRA_REGS
  47. popq %r15
  48. popq %r14
  49. @@ -172,48 +162,6 @@ For 32-bit we have the following conventions - kernel is built with
  50. popq %rdi
  51. .endm
  52. - .macro RESTORE_C_REGS_HELPER rstor_rax=1, rstor_rcx=1, rstor_r11=1, rstor_r8910=1, rstor_rdx=1
  53. - .if \rstor_r11
  54. - movq 6*8(%rsp), %r11
  55. - .endif
  56. - .if \rstor_r8910
  57. - movq 7*8(%rsp), %r10
  58. - movq 8*8(%rsp), %r9
  59. - movq 9*8(%rsp), %r8
  60. - .endif
  61. - .if \rstor_rax
  62. - movq 10*8(%rsp), %rax
  63. - .endif
  64. - .if \rstor_rcx
  65. - movq 11*8(%rsp), %rcx
  66. - .endif
  67. - .if \rstor_rdx
  68. - movq 12*8(%rsp), %rdx
  69. - .endif
  70. - movq 13*8(%rsp), %rsi
  71. - movq 14*8(%rsp), %rdi
  72. - UNWIND_HINT_IRET_REGS offset=16*8
  73. - .endm
  74. - .macro RESTORE_C_REGS
  75. - RESTORE_C_REGS_HELPER 1,1,1,1,1
  76. - .endm
  77. - .macro RESTORE_C_REGS_EXCEPT_RAX
  78. - RESTORE_C_REGS_HELPER 0,1,1,1,1
  79. - .endm
  80. - .macro RESTORE_C_REGS_EXCEPT_RCX
  81. - RESTORE_C_REGS_HELPER 1,0,1,1,1
  82. - .endm
  83. - .macro RESTORE_C_REGS_EXCEPT_R11
  84. - RESTORE_C_REGS_HELPER 1,1,0,1,1
  85. - .endm
  86. - .macro RESTORE_C_REGS_EXCEPT_RCX_R11
  87. - RESTORE_C_REGS_HELPER 1,0,0,1,1
  88. - .endm
  89. -
  90. - .macro REMOVE_PT_GPREGS_FROM_STACK addskip=0
  91. - subq $-(15*8+\addskip), %rsp
  92. - .endm
  93. -
  94. .macro icebp
  95. .byte 0xf1
  96. .endm
  97. --
  98. 2.14.2