0058-x86-xen-Add-unwind-hint-annotations.patch 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. From b90136e442c889a7344992acc34764729936ab92 Mon Sep 17 00:00:00 2001
  2. From: Josh Poimboeuf <[email protected]>
  3. Date: Mon, 18 Sep 2017 21:43:36 -0500
  4. Subject: [PATCH 058/242] x86/xen: Add unwind hint annotations
  5. MIME-Version: 1.0
  6. Content-Type: text/plain; charset=UTF-8
  7. Content-Transfer-Encoding: 8bit
  8. CVE-2017-5754
  9. Add unwind hint annotations to the xen head code so the ORC unwinder can
  10. read head_64.o.
  11. hypercall_page needs empty annotations at 32-byte intervals to match the
  12. 'xen_hypercall_*' ELF functions at those locations.
  13. Signed-off-by: Josh Poimboeuf <[email protected]>
  14. Cc: Andy Lutomirski <[email protected]>
  15. Cc: Boris Ostrovsky <[email protected]>
  16. Cc: Jiri Slaby <[email protected]>
  17. Cc: Juergen Gross <[email protected]>
  18. Cc: Linus Torvalds <[email protected]>
  19. Cc: Peter Zijlstra <[email protected]>
  20. Cc: Thomas Gleixner <[email protected]>
  21. Link: http://lkml.kernel.org/r/70ed2eb516fe9266be766d953f93c2571bca88cc.1505764066.git.jpoimboe@redhat.com
  22. Signed-off-by: Ingo Molnar <[email protected]>
  23. (cherry picked from commit abbe1cac6214d81d2f4e149aba64a8760703144e)
  24. Signed-off-by: Andy Whitcroft <[email protected]>
  25. Signed-off-by: Kleber Sacilotto de Souza <[email protected]>
  26. (cherry picked from commit 9f099a90cb39eaff9b3187e8a6d8151c8af53db1)
  27. Signed-off-by: Fabian Grünbichler <[email protected]>
  28. ---
  29. arch/x86/xen/xen-head.S | 7 ++++++-
  30. 1 file changed, 6 insertions(+), 1 deletion(-)
  31. diff --git a/arch/x86/xen/xen-head.S b/arch/x86/xen/xen-head.S
  32. index 2f0cff2cc265..ad189ab2c329 100644
  33. --- a/arch/x86/xen/xen-head.S
  34. +++ b/arch/x86/xen/xen-head.S
  35. @@ -9,6 +9,7 @@
  36. #include <asm/boot.h>
  37. #include <asm/asm.h>
  38. #include <asm/page_types.h>
  39. +#include <asm/unwind_hints.h>
  40. #include <xen/interface/elfnote.h>
  41. #include <xen/interface/features.h>
  42. @@ -19,6 +20,7 @@
  43. #ifdef CONFIG_XEN_PV
  44. __INIT
  45. ENTRY(startup_xen)
  46. + UNWIND_HINT_EMPTY
  47. cld
  48. /* Clear .bss */
  49. @@ -40,7 +42,10 @@ END(startup_xen)
  50. .pushsection .text
  51. .balign PAGE_SIZE
  52. ENTRY(hypercall_page)
  53. - .skip PAGE_SIZE
  54. + .rept (PAGE_SIZE / 32)
  55. + UNWIND_HINT_EMPTY
  56. + .skip 32
  57. + .endr
  58. #define HYPERCALL(n) \
  59. .equ xen_hypercall_##n, hypercall_page + __HYPERVISOR_##n * 32; \
  60. --
  61. 2.14.2