0031-x86-entry-Fix-idtentry-unwind-hint.patch 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. From b368fed558634ffc92dba0d7d9e4e631d26cd92f Mon Sep 17 00:00:00 2001
  2. From: Josh Poimboeuf <[email protected]>
  3. Date: Fri, 20 Oct 2017 11:21:33 -0500
  4. Subject: [PATCH 031/232] x86/entry: Fix idtentry unwind hint
  5. MIME-Version: 1.0
  6. Content-Type: text/plain; charset=UTF-8
  7. Content-Transfer-Encoding: 8bit
  8. CVE-2017-5754
  9. This fixes the following ORC warning in the 'int3' entry code:
  10. WARNING: can't dereference iret registers at ffff8801c5f17fe0 for ip ffffffff95f0d94b
  11. The ORC metadata had the wrong stack offset for the iret registers.
  12. Their location on the stack is dependent on whether the exception has an
  13. error code.
  14. Reported-and-tested-by: Andrei Vagin <[email protected]>
  15. Signed-off-by: Josh Poimboeuf <[email protected]>
  16. Cc: Andy Lutomirski <[email protected]>
  17. Cc: Linus Torvalds <[email protected]>
  18. Cc: Peter Zijlstra <[email protected]>
  19. Cc: Thomas Gleixner <[email protected]>
  20. Fixes: 8c1f75587a18 ("x86/entry/64: Add unwind hint annotations")
  21. Link: http://lkml.kernel.org/r/931d57f0551ed7979d5e7e05370d445c8e5137f8.1508516398.git.jpoimboe@redhat.com
  22. Signed-off-by: Ingo Molnar <[email protected]>
  23. (cherry picked from commit 98990a33b77dda9babf91cb235654f6729e5702e)
  24. Signed-off-by: Andy Whitcroft <[email protected]>
  25. Signed-off-by: Kleber Sacilotto de Souza <[email protected]>
  26. (cherry picked from commit 266be2a5053230f6d0b6f27d3e8e9f28df40dd7e)
  27. Signed-off-by: Fabian Grünbichler <[email protected]>
  28. ---
  29. arch/x86/entry/entry_64.S | 2 +-
  30. 1 file changed, 1 insertion(+), 1 deletion(-)
  31. diff --git a/arch/x86/entry/entry_64.S b/arch/x86/entry/entry_64.S
  32. index c12260ef3e4b..2e4fc6425f47 100644
  33. --- a/arch/x86/entry/entry_64.S
  34. +++ b/arch/x86/entry/entry_64.S
  35. @@ -821,7 +821,7 @@ apicinterrupt IRQ_WORK_VECTOR irq_work_interrupt smp_irq_work_interrupt
  36. .macro idtentry sym do_sym has_error_code:req paranoid=0 shift_ist=-1
  37. ENTRY(\sym)
  38. - UNWIND_HINT_IRET_REGS offset=8
  39. + UNWIND_HINT_IRET_REGS offset=\has_error_code*8
  40. /* Sanity check */
  41. .if \shift_ist != -1 && \paranoid == 0
  42. --
  43. 2.14.2