[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20180226202153.589811845@linuxfoundation.org>
Date: Mon, 26 Feb 2018 21:21:40 +0100
From: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To: linux-kernel@...r.kernel.org
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
stable@...r.kernel.org, Patrick McLean <chutzpah@...too.org>,
Linus Torvalds <torvalds@...ux-foundation.org>,
"Maciej S. Szmigiero" <mail@...iej.szmigiero.name>,
Kees Cook <keescook@...omium.org>
Subject: [PATCH 4.15 03/64] kconfig.h: Include compiler types to avoid missed struct attributes
4.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Kees Cook <keescook@...omium.org>
commit 28128c61e08eaeced9cc8ec0e6b5d677b5b94690 upstream.
The header files for some structures could get included in such a way
that struct attributes (specifically __randomize_layout from path.h) would
be parsed as variable names instead of attributes. This could lead to
some instances of a structure being unrandomized, causing nasty GPFs, etc.
This patch makes sure the compiler_types.h header is included in
kconfig.h so that we've always got types and struct attributes defined,
since kconfig.h is included from the compiler command line.
Reported-by: Patrick McLean <chutzpah@...too.org>
Root-caused-by: Maciej S. Szmigiero <mail@...iej.szmigiero.name>
Suggested-by: Linus Torvalds <torvalds@...ux-foundation.org>
Tested-by: Maciej S. Szmigiero <mail@...iej.szmigiero.name>
Fixes: 3859a271a003 ("randstruct: Mark various structs for randomization")
Signed-off-by: Kees Cook <keescook@...omium.org>
Signed-off-by: Linus Torvalds <torvalds@...ux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
---
include/linux/kconfig.h | 3 +++
1 file changed, 3 insertions(+)
--- a/include/linux/kconfig.h
+++ b/include/linux/kconfig.h
@@ -64,4 +64,7 @@
*/
#define IS_ENABLED(option) __or(IS_BUILTIN(option), IS_MODULE(option))
+/* Make sure we always have all types and struct attributes defined. */
+#include <linux/compiler_types.h>
+
#endif /* __LINUX_KCONFIG_H */
Powered by blists - more mailing lists