0163-x86-Kconfig-Limit-NR_CPUS-on-32-bit-to-a-sane-amount.patch 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. From 883f164f2205159613e17e6550c7ff44cef0ff01 Mon Sep 17 00:00:00 2001
  2. From: Thomas Gleixner <[email protected]>
  3. Date: Wed, 20 Dec 2017 18:02:34 +0100
  4. Subject: [PATCH 163/232] x86/Kconfig: Limit NR_CPUS on 32-bit to a sane amount
  5. MIME-Version: 1.0
  6. Content-Type: text/plain; charset=UTF-8
  7. Content-Transfer-Encoding: 8bit
  8. CVE-2017-5754
  9. The recent cpu_entry_area changes fail to compile on 32-bit when BIGSMP=y
  10. and NR_CPUS=512, because the fixmap area becomes too big.
  11. Limit the number of CPUs with BIGSMP to 64, which is already way to big for
  12. 32-bit, but it's at least a working limitation.
  13. We performed a quick survey of 32-bit-only machines that might be affected
  14. by this change negatively, but found none.
  15. Signed-off-by: Thomas Gleixner <[email protected]>
  16. Cc: Andy Lutomirski <[email protected]>
  17. Cc: Borislav Petkov <[email protected]>
  18. Cc: Dave Hansen <[email protected]>
  19. Cc: H. Peter Anvin <[email protected]>
  20. Cc: Josh Poimboeuf <[email protected]>
  21. Cc: Juergen Gross <[email protected]>
  22. Cc: Linus Torvalds <[email protected]>
  23. Cc: Peter Zijlstra <[email protected]>
  24. Cc: [email protected]
  25. Signed-off-by: Ingo Molnar <[email protected]>
  26. (cherry picked from commit 7bbcbd3d1cdcbacd0f9f8dc4c98d550972f1ca30)
  27. Signed-off-by: Andy Whitcroft <[email protected]>
  28. Signed-off-by: Kleber Sacilotto de Souza <[email protected]>
  29. (cherry picked from commit 8ea88ee6f0d058835bfb5685be1ec1beb51177c2)
  30. Signed-off-by: Fabian Grünbichler <[email protected]>
  31. ---
  32. arch/x86/Kconfig | 3 ++-
  33. 1 file changed, 2 insertions(+), 1 deletion(-)
  34. diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
  35. index 8b5499bb24bb..51003e53e738 100644
  36. --- a/arch/x86/Kconfig
  37. +++ b/arch/x86/Kconfig
  38. @@ -923,7 +923,8 @@ config MAXSMP
  39. config NR_CPUS
  40. int "Maximum number of CPUs" if SMP && !MAXSMP
  41. range 2 8 if SMP && X86_32 && !X86_BIGSMP
  42. - range 2 512 if SMP && !MAXSMP && !CPUMASK_OFFSTACK
  43. + range 2 64 if SMP && X86_32 && X86_BIGSMP
  44. + range 2 512 if SMP && !MAXSMP && !CPUMASK_OFFSTACK && X86_64
  45. range 2 8192 if SMP && !MAXSMP && CPUMASK_OFFSTACK && X86_64
  46. default "1" if !SMP
  47. default "8192" if MAXSMP
  48. --
  49. 2.14.2