summaryrefslogtreecommitdiff
path: root/include/linux/compiler-clang.h
diff options
context:
space:
mode:
authorKees Cook <keescook@chromium.org>2018-04-11 02:32:44 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-04-24 10:36:22 +0300
commit6337067b2ab66c91b18b895c2399139b28f13fb7 (patch)
treecce2b39b1f692832eaac3ea43bc145d5dcb0ed79 /include/linux/compiler-clang.h
parent28cb085f1598956b5b29edb7f220ce9e0d827762 (diff)
downloadlinux-6337067b2ab66c91b18b895c2399139b28f13fb7.tar.xz
task_struct: only use anon struct under randstruct plugin
commit 2cfe0d3009418a132b93d78642a8059a38fe5944 upstream. The original intent for always adding the anonymous struct in task_struct was to make sure we had compiler coverage. However, this caused pathological padding of 40 bytes at the start of task_struct. Instead, move the anonymous struct to being only used when struct layout randomization is enabled. Link: http://lkml.kernel.org/r/20180327213609.GA2964@beast Fixes: 29e48ce87f1e ("task_struct: Allow randomized") Signed-off-by: Kees Cook <keescook@chromium.org> Reported-by: Peter Zijlstra <peterz@infradead.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Ingo Molnar <mingo@kernel.org> Cc: <stable@vger.kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include/linux/compiler-clang.h')
-rw-r--r--include/linux/compiler-clang.h3
1 files changed, 0 insertions, 3 deletions
diff --git a/include/linux/compiler-clang.h b/include/linux/compiler-clang.h
index be3aef6839f6..070f85d92c15 100644
--- a/include/linux/compiler-clang.h
+++ b/include/linux/compiler-clang.h
@@ -17,9 +17,6 @@
*/
#define __UNIQUE_ID(prefix) __PASTE(__PASTE(__UNIQUE_ID_, prefix), __COUNTER__)
-#define randomized_struct_fields_start struct {
-#define randomized_struct_fields_end };
-
/* Clang doesn't have a way to turn it off per-function, yet. */
#ifdef __noretpoline
#undef __noretpoline