0037-objtool-Upgrade-libelf-devel-warning-to-error-for-CO.patch 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. From 2c9eb7028c0714c3379b58a59c60f7b5b7a5adb0 Mon Sep 17 00:00:00 2001
  2. From: Josh Poimboeuf <[email protected]>
  3. Date: Tue, 3 Oct 2017 20:10:36 -0500
  4. Subject: [PATCH 037/232] objtool: Upgrade libelf-devel warning to error for
  5. CONFIG_ORC_UNWINDER
  6. MIME-Version: 1.0
  7. Content-Type: text/plain; charset=UTF-8
  8. Content-Transfer-Encoding: 8bit
  9. CVE-2017-5754
  10. With CONFIG_ORC_UNWINDER, if the user doesn't have libelf-devel
  11. installed, and they don't see the make warning, their ORC unwinder will
  12. be silently broken. Upgrade the warning to an error.
  13. Reported-and-tested-by: Borislav Petkov <[email protected]>
  14. Signed-off-by: Josh Poimboeuf <[email protected]>
  15. Cc: Linus Torvalds <[email protected]>
  16. Cc: Peter Zijlstra <[email protected]>
  17. Cc: Thomas Gleixner <[email protected]>
  18. Link: http://lkml.kernel.org/r/d9dfc39fb8240998820f9efb233d283a1ee96084.1507079417.git.jpoimboe@redhat.com
  19. Signed-off-by: Ingo Molnar <[email protected]>
  20. (cherry picked from commit 3dd40cb320fee7c23b574ab821ce140ccd1281c9)
  21. Signed-off-by: Andy Whitcroft <[email protected]>
  22. Signed-off-by: Kleber Sacilotto de Souza <[email protected]>
  23. (cherry picked from commit c413466a72ca533ec126ebc0c5bb579ae0c96b1d)
  24. Signed-off-by: Fabian Grünbichler <[email protected]>
  25. ---
  26. Makefile | 6 +++++-
  27. 1 file changed, 5 insertions(+), 1 deletion(-)
  28. diff --git a/Makefile b/Makefile
  29. index 8e14a926fc94..490ce18685ea 100644
  30. --- a/Makefile
  31. +++ b/Makefile
  32. @@ -965,7 +965,11 @@ ifdef CONFIG_STACK_VALIDATION
  33. ifeq ($(has_libelf),1)
  34. objtool_target := tools/objtool FORCE
  35. else
  36. - $(warning "Cannot use CONFIG_STACK_VALIDATION, please install libelf-dev, libelf-devel or elfutils-libelf-devel")
  37. + ifdef CONFIG_ORC_UNWINDER
  38. + $(error "Cannot generate ORC metadata for CONFIG_ORC_UNWINDER=y, please install libelf-dev, libelf-devel or elfutils-libelf-devel")
  39. + else
  40. + $(warning "Cannot use CONFIG_STACK_VALIDATION=y, please install libelf-dev, libelf-devel or elfutils-libelf-devel")
  41. + endif
  42. SKIP_STACK_VALIDATION := 1
  43. export SKIP_STACK_VALIDATION
  44. endif
  45. --
  46. 2.14.2