]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
task_struct: only use anon struct under randstruct plugin
authorKees Cook <keescook@chromium.org>
Tue, 10 Apr 2018 23:32:44 +0000 (16:32 -0700)
committerKhalid Elmously <khalid.elmously@canonical.com>
Wed, 6 Jun 2018 15:47:55 +0000 (11:47 -0400)
commitade6ec5d9c1c9064853273c3369860e38d8a956a
tree5908236e9540f896244892de8650a3b2c0c71d2c
parent4271c74394545498315273431ddcf81f2c00c15b
task_struct: only use anon struct under randstruct plugin

BugLink: http://bugs.launchpad.net/bugs/1773233
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>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Acked-by: Khalid Elmously <khalid.elmously@canonical.com>
Acked-by: Brad Figg <brad.figg@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
include/linux/compiler-clang.h
include/linux/compiler-gcc.h