[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <tip-aa5d1b81500e6059190f18fe25a7617682321910@git.kernel.org>
Date: Tue, 25 Jul 2017 06:49:02 -0700
From: tip-bot for Kees Cook <tipbot@...or.com>
To: linux-tip-commits@...r.kernel.org
Cc: elena.reshetova@...el.com, akpm@...ux-foundation.org,
dave@...olabs.net, adobriyan@...il.com, ebiggers3@...il.com,
jannh@...gle.com, torvalds@...ux-foundation.org,
jpoimboe@...hat.com, manfred@...orfullife.com,
peterz@...radead.org, serge@...lyn.com, ebiederm@...ssion.com,
gregkh@...uxfoundation.org, hpa@...or.com, tglx@...utronix.de,
ishkamiel@...il.com, keescook@...omium.org, davem@...emloft.net,
linux-arch@...r.kernel.org, linux-kernel@...r.kernel.org,
riel@...hat.com, arnd@...db.de, mingo@...nel.org,
hch@...radead.org, James.Bottomley@...senpartnership.com
Subject: [tip:x86/asm] x86/asm: Add ASM_UNREACHABLE
Commit-ID: aa5d1b81500e6059190f18fe25a7617682321910
Gitweb: http://git.kernel.org/tip/aa5d1b81500e6059190f18fe25a7617682321910
Author: Kees Cook <keescook@...omium.org>
AuthorDate: Mon, 24 Jul 2017 11:35:48 -0700
Committer: Ingo Molnar <mingo@...nel.org>
CommitDate: Tue, 25 Jul 2017 11:18:09 +0200
x86/asm: Add ASM_UNREACHABLE
This creates an unreachable annotation in asm for CONFIG_STACK_VALIDATION=y.
While here, adjust earlier uses of \t\n into \n\t.
Suggested-by: Josh Poimboeuf <jpoimboe@...hat.com>
Signed-off-by: Kees Cook <keescook@...omium.org>
Cc: Alexey Dobriyan <adobriyan@...il.com>
Cc: Andrew Morton <akpm@...ux-foundation.org>
Cc: Arnd Bergmann <arnd@...db.de>
Cc: Christoph Hellwig <hch@...radead.org>
Cc: David S. Miller <davem@...emloft.net>
Cc: Davidlohr Bueso <dave@...olabs.net>
Cc: Elena Reshetova <elena.reshetova@...el.com>
Cc: Eric Biggers <ebiggers3@...il.com>
Cc: Eric W. Biederman <ebiederm@...ssion.com>
Cc: Greg KH <gregkh@...uxfoundation.org>
Cc: Hans Liljestrand <ishkamiel@...il.com>
Cc: James Bottomley <James.Bottomley@...senpartnership.com>
Cc: Jann Horn <jannh@...gle.com>
Cc: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: Manfred Spraul <manfred@...orfullife.com>
Cc: Peter Zijlstra <peterz@...radead.org>
Cc: Rik van Riel <riel@...hat.com>
Cc: Serge E. Hallyn <serge@...lyn.com>
Cc: Thomas Gleixner <tglx@...utronix.de>
Cc: arozansk@...hat.com
Cc: axboe@...nel.dk
Cc: kernel-hardening@...ts.openwall.com
Cc: linux-arch <linux-arch@...r.kernel.org>
Link: http://lkml.kernel.org/r/1500921349-10803-3-git-send-email-keescook@chromium.org
Signed-off-by: Ingo Molnar <mingo@...nel.org>
---
include/linux/compiler-gcc.h | 13 +++++++++----
include/linux/compiler.h | 3 +++
2 files changed, 12 insertions(+), 4 deletions(-)
diff --git a/include/linux/compiler-gcc.h b/include/linux/compiler-gcc.h
index cd4bbe8..179375b 100644
--- a/include/linux/compiler-gcc.h
+++ b/include/linux/compiler-gcc.h
@@ -203,11 +203,16 @@
#ifdef CONFIG_STACK_VALIDATION
#define annotate_unreachable() ({ \
- asm("%c0:\t\n" \
- ".pushsection .discard.unreachable\t\n" \
- ".long %c0b - .\t\n" \
- ".popsection\t\n" : : "i" (__LINE__)); \
+ asm("%c0:\n\t" \
+ ".pushsection .discard.unreachable\n\t" \
+ ".long %c0b - .\n\t" \
+ ".popsection\n\t" : : "i" (__LINE__)); \
})
+#define ASM_UNREACHABLE \
+ "999:\n\t" \
+ ".pushsection .discard.unreachable\n\t" \
+ ".long 999b - .\n\t" \
+ ".popsection\n\t"
#else
#define annotate_unreachable()
#endif
diff --git a/include/linux/compiler.h b/include/linux/compiler.h
index 219f82f..641f591 100644
--- a/include/linux/compiler.h
+++ b/include/linux/compiler.h
@@ -185,6 +185,9 @@ void ftrace_likely_update(struct ftrace_likely_data *f, int val,
#endif
/* Unreachable code */
+#ifndef ASM_UNREACHABLE
+# define ASM_UNREACHABLE
+#endif
#ifndef unreachable
# define unreachable() do { } while (1)
#endif
Powered by blists - more mailing lists