0108-bitops-Revert-cbe96375025e-bitops-Add-clear-set_bit3.patch 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. From 8c2a040e8b66b43da2a517410a5f26929a404df4 Mon Sep 17 00:00:00 2001
  2. From: Thomas Gleixner <[email protected]>
  3. Date: Thu, 2 Nov 2017 13:30:03 +0100
  4. Subject: [PATCH 108/232] bitops: Revert cbe96375025e ("bitops: Add
  5. clear/set_bit32() to linux/bitops.h")
  6. MIME-Version: 1.0
  7. Content-Type: text/plain; charset=UTF-8
  8. Content-Transfer-Encoding: 8bit
  9. CVE-2017-5754
  10. These ops are not endian safe and may break on architectures which have
  11. aligment requirements.
  12. Reverts: cbe96375025e ("bitops: Add clear/set_bit32() to linux/bitops.h")
  13. Reported-by: Peter Zijlstra <[email protected]>
  14. Signed-off-by: Thomas Gleixner <[email protected]>
  15. Cc: Andi Kleen <[email protected]>
  16. (cherry picked from commit 1943dc07b45e347c52c1bfdd4a37e04a86e399aa)
  17. Signed-off-by: Andy Whitcroft <[email protected]>
  18. Signed-off-by: Kleber Sacilotto de Souza <[email protected]>
  19. (cherry picked from commit adb64d8c852206281ea6ee6590ae35076a219409)
  20. Signed-off-by: Fabian Grünbichler <[email protected]>
  21. ---
  22. include/linux/bitops.h | 26 --------------------------
  23. 1 file changed, 26 deletions(-)
  24. diff --git a/include/linux/bitops.h b/include/linux/bitops.h
  25. index eb257a96db6d..a83c822c35c2 100644
  26. --- a/include/linux/bitops.h
  27. +++ b/include/linux/bitops.h
  28. @@ -226,32 +226,6 @@ static inline unsigned long __ffs64(u64 word)
  29. return __ffs((unsigned long)word);
  30. }
  31. -/*
  32. - * clear_bit32 - Clear a bit in memory for u32 array
  33. - * @nr: Bit to clear
  34. - * @addr: u32 * address of bitmap
  35. - *
  36. - * Same as clear_bit, but avoids needing casts for u32 arrays.
  37. - */
  38. -
  39. -static __always_inline void clear_bit32(long nr, volatile u32 *addr)
  40. -{
  41. - clear_bit(nr, (volatile unsigned long *)addr);
  42. -}
  43. -
  44. -/*
  45. - * set_bit32 - Set a bit in memory for u32 array
  46. - * @nr: Bit to clear
  47. - * @addr: u32 * address of bitmap
  48. - *
  49. - * Same as set_bit, but avoids needing casts for u32 arrays.
  50. - */
  51. -
  52. -static __always_inline void set_bit32(long nr, volatile u32 *addr)
  53. -{
  54. - set_bit(nr, (volatile unsigned long *)addr);
  55. -}
  56. -
  57. #ifdef __KERNEL__
  58. #ifndef set_mask_bits
  59. --
  60. 2.14.2