]> git.proxmox.com Git - pve-kernel.git/blob - patches/kernel/0108-bitops-Revert-cbe96375025e-bitops-Add-clear-set_bit3.patch
KPTI: add follow-up fixes
[pve-kernel.git] / patches / kernel / 0108-bitops-Revert-cbe96375025e-bitops-Add-clear-set_bit3.patch
1 From 8c2a040e8b66b43da2a517410a5f26929a404df4 Mon Sep 17 00:00:00 2001
2 From: Thomas Gleixner <tglx@linutronix.de>
3 Date: Thu, 2 Nov 2017 13:30:03 +0100
4 Subject: [PATCH 108/241] 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
10 CVE-2017-5754
11
12 These ops are not endian safe and may break on architectures which have
13 aligment requirements.
14
15 Reverts: cbe96375025e ("bitops: Add clear/set_bit32() to linux/bitops.h")
16 Reported-by: Peter Zijlstra <peterz@infradead.org>
17 Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
18 Cc: Andi Kleen <ak@linux.intel.com>
19 (cherry picked from commit 1943dc07b45e347c52c1bfdd4a37e04a86e399aa)
20 Signed-off-by: Andy Whitcroft <apw@canonical.com>
21 Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
22 (cherry picked from commit adb64d8c852206281ea6ee6590ae35076a219409)
23 Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
24 ---
25 include/linux/bitops.h | 26 --------------------------
26 1 file changed, 26 deletions(-)
27
28 diff --git a/include/linux/bitops.h b/include/linux/bitops.h
29 index eb257a96db6d..a83c822c35c2 100644
30 --- a/include/linux/bitops.h
31 +++ b/include/linux/bitops.h
32 @@ -226,32 +226,6 @@ static inline unsigned long __ffs64(u64 word)
33 return __ffs((unsigned long)word);
34 }
35
36 -/*
37 - * clear_bit32 - Clear a bit in memory for u32 array
38 - * @nr: Bit to clear
39 - * @addr: u32 * address of bitmap
40 - *
41 - * Same as clear_bit, but avoids needing casts for u32 arrays.
42 - */
43 -
44 -static __always_inline void clear_bit32(long nr, volatile u32 *addr)
45 -{
46 - clear_bit(nr, (volatile unsigned long *)addr);
47 -}
48 -
49 -/*
50 - * set_bit32 - Set a bit in memory for u32 array
51 - * @nr: Bit to clear
52 - * @addr: u32 * address of bitmap
53 - *
54 - * Same as set_bit, but avoids needing casts for u32 arrays.
55 - */
56 -
57 -static __always_inline void set_bit32(long nr, volatile u32 *addr)
58 -{
59 - set_bit(nr, (volatile unsigned long *)addr);
60 -}
61 -
62 #ifdef __KERNEL__
63
64 #ifndef set_mask_bits
65 --
66 2.14.2
67