]> git.proxmox.com Git - pve-kernel.git/blob - patches/kernel/0051-x86-asm-Remove-unnecessary-n-t-in-front-of-CC_SET-fr.patch
caefd88cb1ff38a0e22ccd40dbaa64c350d65c83
[pve-kernel.git] / patches / kernel / 0051-x86-asm-Remove-unnecessary-n-t-in-front-of-CC_SET-fr.patch
1 From 7d7ea8398b5f0cf22b8faec46c95543031c5fe94 Mon Sep 17 00:00:00 2001
2 From: Uros Bizjak <ubizjak@gmail.com>
3 Date: Wed, 6 Sep 2017 17:18:08 +0200
4 Subject: [PATCH 051/233] x86/asm: Remove unnecessary \n\t in front of CC_SET()
5 from asm templates
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 There is no need for \n\t in front of CC_SET(), as the macro already includes these two.
13
14 Signed-off-by: Uros Bizjak <ubizjak@gmail.com>
15 Cc: Linus Torvalds <torvalds@linux-foundation.org>
16 Cc: Peter Zijlstra <peterz@infradead.org>
17 Cc: Thomas Gleixner <tglx@linutronix.de>
18 Link: http://lkml.kernel.org/r/20170906151808.5634-1-ubizjak@gmail.com
19 Signed-off-by: Ingo Molnar <mingo@kernel.org>
20 (backported from commit 3c52b5c64326d9dcfee4e10611c53ec1b1b20675)
21 Signed-off-by: Andy Whitcroft <apw@canonical.com>
22 Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
23 (cherry picked from commit 1c3f29ec5586e3aecfde2c6f83b8786e1aecd9ac)
24 Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
25 ---
26 arch/x86/include/asm/archrandom.h | 8 ++++----
27 arch/x86/include/asm/bitops.h | 10 +++++-----
28 arch/x86/include/asm/percpu.h | 2 +-
29 arch/x86/include/asm/rmwcc.h | 2 +-
30 4 files changed, 11 insertions(+), 11 deletions(-)
31
32 diff --git a/arch/x86/include/asm/archrandom.h b/arch/x86/include/asm/archrandom.h
33 index 5b0579abb398..3ac991d81e74 100644
34 --- a/arch/x86/include/asm/archrandom.h
35 +++ b/arch/x86/include/asm/archrandom.h
36 @@ -45,7 +45,7 @@ static inline bool rdrand_long(unsigned long *v)
37 bool ok;
38 unsigned int retry = RDRAND_RETRY_LOOPS;
39 do {
40 - asm volatile(RDRAND_LONG "\n\t"
41 + asm volatile(RDRAND_LONG
42 CC_SET(c)
43 : CC_OUT(c) (ok), "=a" (*v));
44 if (ok)
45 @@ -59,7 +59,7 @@ static inline bool rdrand_int(unsigned int *v)
46 bool ok;
47 unsigned int retry = RDRAND_RETRY_LOOPS;
48 do {
49 - asm volatile(RDRAND_INT "\n\t"
50 + asm volatile(RDRAND_INT
51 CC_SET(c)
52 : CC_OUT(c) (ok), "=a" (*v));
53 if (ok)
54 @@ -71,7 +71,7 @@ static inline bool rdrand_int(unsigned int *v)
55 static inline bool rdseed_long(unsigned long *v)
56 {
57 bool ok;
58 - asm volatile(RDSEED_LONG "\n\t"
59 + asm volatile(RDSEED_LONG
60 CC_SET(c)
61 : CC_OUT(c) (ok), "=a" (*v));
62 return ok;
63 @@ -80,7 +80,7 @@ static inline bool rdseed_long(unsigned long *v)
64 static inline bool rdseed_int(unsigned int *v)
65 {
66 bool ok;
67 - asm volatile(RDSEED_INT "\n\t"
68 + asm volatile(RDSEED_INT
69 CC_SET(c)
70 : CC_OUT(c) (ok), "=a" (*v));
71 return ok;
72 diff --git a/arch/x86/include/asm/bitops.h b/arch/x86/include/asm/bitops.h
73 index 854022772c5b..8cee8db6dffb 100644
74 --- a/arch/x86/include/asm/bitops.h
75 +++ b/arch/x86/include/asm/bitops.h
76 @@ -142,7 +142,7 @@ static __always_inline void __clear_bit(long nr, volatile unsigned long *addr)
77 static __always_inline bool clear_bit_unlock_is_negative_byte(long nr, volatile unsigned long *addr)
78 {
79 bool negative;
80 - asm volatile(LOCK_PREFIX "andb %2,%1\n\t"
81 + asm volatile(LOCK_PREFIX "andb %2,%1"
82 CC_SET(s)
83 : CC_OUT(s) (negative), ADDR
84 : "ir" ((char) ~(1 << nr)) : "memory");
85 @@ -245,7 +245,7 @@ static __always_inline bool __test_and_set_bit(long nr, volatile unsigned long *
86 {
87 bool oldbit;
88
89 - asm("bts %2,%1\n\t"
90 + asm("bts %2,%1"
91 CC_SET(c)
92 : CC_OUT(c) (oldbit), ADDR
93 : "Ir" (nr));
94 @@ -285,7 +285,7 @@ static __always_inline bool __test_and_clear_bit(long nr, volatile unsigned long
95 {
96 bool oldbit;
97
98 - asm volatile("btr %2,%1\n\t"
99 + asm volatile("btr %2,%1"
100 CC_SET(c)
101 : CC_OUT(c) (oldbit), ADDR
102 : "Ir" (nr));
103 @@ -297,7 +297,7 @@ static __always_inline bool __test_and_change_bit(long nr, volatile unsigned lon
104 {
105 bool oldbit;
106
107 - asm volatile("btc %2,%1\n\t"
108 + asm volatile("btc %2,%1"
109 CC_SET(c)
110 : CC_OUT(c) (oldbit), ADDR
111 : "Ir" (nr) : "memory");
112 @@ -328,7 +328,7 @@ static __always_inline bool variable_test_bit(long nr, volatile const unsigned l
113 {
114 bool oldbit;
115
116 - asm volatile("bt %2,%1\n\t"
117 + asm volatile("bt %2,%1"
118 CC_SET(c)
119 : CC_OUT(c) (oldbit)
120 : "m" (*(unsigned long *)addr), "Ir" (nr));
121 diff --git a/arch/x86/include/asm/percpu.h b/arch/x86/include/asm/percpu.h
122 index 9fa03604b2b3..b21a475fd7ed 100644
123 --- a/arch/x86/include/asm/percpu.h
124 +++ b/arch/x86/include/asm/percpu.h
125 @@ -525,7 +525,7 @@ static inline bool x86_this_cpu_variable_test_bit(int nr,
126 {
127 bool oldbit;
128
129 - asm volatile("bt "__percpu_arg(2)",%1\n\t"
130 + asm volatile("bt "__percpu_arg(2)",%1"
131 CC_SET(c)
132 : CC_OUT(c) (oldbit)
133 : "m" (*(unsigned long __percpu *)addr), "Ir" (nr));
134 diff --git a/arch/x86/include/asm/rmwcc.h b/arch/x86/include/asm/rmwcc.h
135 index 661dd305694a..dd7ba5aa8dca 100644
136 --- a/arch/x86/include/asm/rmwcc.h
137 +++ b/arch/x86/include/asm/rmwcc.h
138 @@ -28,7 +28,7 @@ cc_label: \
139 #define __GEN_RMWcc(fullop, var, cc, ...) \
140 do { \
141 bool c; \
142 - asm volatile (fullop ";" CC_SET(cc) \
143 + asm volatile (fullop CC_SET(cc) \
144 : "+m" (var), CC_OUT(cc) (c) \
145 : __VA_ARGS__ : "memory"); \
146 return c; \
147 --
148 2.14.2
149