]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commitdiff
x86/asm: Remove unnecessary \n\t in front of CC_SET() from asm templates
authorUros Bizjak <ubizjak@gmail.com>
Wed, 6 Sep 2017 15:18:08 +0000 (17:18 +0200)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Sat, 6 Jan 2018 12:22:29 +0000 (13:22 +0100)
CVE-2017-5754

There is no need for \n\t in front of CC_SET(), as the macro already includes these two.

Signed-off-by: Uros Bizjak <ubizjak@gmail.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/20170906151808.5634-1-ubizjak@gmail.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
(backported from commit 3c52b5c64326d9dcfee4e10611c53ec1b1b20675)
Signed-off-by: Andy Whitcroft <apw@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
arch/x86/include/asm/archrandom.h
arch/x86/include/asm/bitops.h
arch/x86/include/asm/percpu.h
arch/x86/include/asm/rmwcc.h

index 5b0579abb39829ce3c6a1b4f00e73dd9295c26dc..3ac991d81e74d9c7293d66c19a0f66eb1ca7b436 100644 (file)
@@ -45,7 +45,7 @@ static inline bool rdrand_long(unsigned long *v)
        bool ok;
        unsigned int retry = RDRAND_RETRY_LOOPS;
        do {
-               asm volatile(RDRAND_LONG "\n\t"
+               asm volatile(RDRAND_LONG
                             CC_SET(c)
                             : CC_OUT(c) (ok), "=a" (*v));
                if (ok)
@@ -59,7 +59,7 @@ static inline bool rdrand_int(unsigned int *v)
        bool ok;
        unsigned int retry = RDRAND_RETRY_LOOPS;
        do {
-               asm volatile(RDRAND_INT "\n\t"
+               asm volatile(RDRAND_INT
                             CC_SET(c)
                             : CC_OUT(c) (ok), "=a" (*v));
                if (ok)
@@ -71,7 +71,7 @@ static inline bool rdrand_int(unsigned int *v)
 static inline bool rdseed_long(unsigned long *v)
 {
        bool ok;
-       asm volatile(RDSEED_LONG "\n\t"
+       asm volatile(RDSEED_LONG
                     CC_SET(c)
                     : CC_OUT(c) (ok), "=a" (*v));
        return ok;
@@ -80,7 +80,7 @@ static inline bool rdseed_long(unsigned long *v)
 static inline bool rdseed_int(unsigned int *v)
 {
        bool ok;
-       asm volatile(RDSEED_INT "\n\t"
+       asm volatile(RDSEED_INT
                     CC_SET(c)
                     : CC_OUT(c) (ok), "=a" (*v));
        return ok;
index 854022772c5be4d49d2697bd2b66b454f49c9e6f..8cee8db6dffbdfc72c151a9e8c475435b6f10dd7 100644 (file)
@@ -142,7 +142,7 @@ static __always_inline void __clear_bit(long nr, volatile unsigned long *addr)
 static __always_inline bool clear_bit_unlock_is_negative_byte(long nr, volatile unsigned long *addr)
 {
        bool negative;
-       asm volatile(LOCK_PREFIX "andb %2,%1\n\t"
+       asm volatile(LOCK_PREFIX "andb %2,%1"
                CC_SET(s)
                : CC_OUT(s) (negative), ADDR
                : "ir" ((char) ~(1 << nr)) : "memory");
@@ -245,7 +245,7 @@ static __always_inline bool __test_and_set_bit(long nr, volatile unsigned long *
 {
        bool oldbit;
 
-       asm("bts %2,%1\n\t"
+       asm("bts %2,%1"
            CC_SET(c)
            : CC_OUT(c) (oldbit), ADDR
            : "Ir" (nr));
@@ -285,7 +285,7 @@ static __always_inline bool __test_and_clear_bit(long nr, volatile unsigned long
 {
        bool oldbit;
 
-       asm volatile("btr %2,%1\n\t"
+       asm volatile("btr %2,%1"
                     CC_SET(c)
                     : CC_OUT(c) (oldbit), ADDR
                     : "Ir" (nr));
@@ -297,7 +297,7 @@ static __always_inline bool __test_and_change_bit(long nr, volatile unsigned lon
 {
        bool oldbit;
 
-       asm volatile("btc %2,%1\n\t"
+       asm volatile("btc %2,%1"
                     CC_SET(c)
                     : CC_OUT(c) (oldbit), ADDR
                     : "Ir" (nr) : "memory");
@@ -328,7 +328,7 @@ static __always_inline bool variable_test_bit(long nr, volatile const unsigned l
 {
        bool oldbit;
 
-       asm volatile("bt %2,%1\n\t"
+       asm volatile("bt %2,%1"
                     CC_SET(c)
                     : CC_OUT(c) (oldbit)
                     : "m" (*(unsigned long *)addr), "Ir" (nr));
index 9fa03604b2b37bcdd9b40df0bf841e36dcc569cd..b21a475fd7ed6aea7d3514829817a59a3fd7ef68 100644 (file)
@@ -525,7 +525,7 @@ static inline bool x86_this_cpu_variable_test_bit(int nr,
 {
        bool oldbit;
 
-       asm volatile("bt "__percpu_arg(2)",%1\n\t"
+       asm volatile("bt "__percpu_arg(2)",%1"
                        CC_SET(c)
                        : CC_OUT(c) (oldbit)
                        : "m" (*(unsigned long __percpu *)addr), "Ir" (nr));
index 661dd305694af8878b8cdcd8b9396b9c7da3b646..dd7ba5aa8dca66de6412a7b2a19293aa08265cee 100644 (file)
@@ -28,7 +28,7 @@ cc_label:                                                             \
 #define __GEN_RMWcc(fullop, var, cc, ...)                              \
 do {                                                                   \
        bool c;                                                         \
-       asm volatile (fullop ";" CC_SET(cc)                             \
+       asm volatile (fullop CC_SET(cc)                                 \
                        : "+m" (var), CC_OUT(cc) (c)                    \
                        : __VA_ARGS__ : "memory");                      \
        return c;                                                       \