]> git.baikalelectronics.ru Git - kernel.git/commit
kconfig.h: Include compiler types to avoid missed struct attributes
authorKees Cook <keescook@chromium.org>
Thu, 22 Feb 2018 17:41:40 +0000 (09:41 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 22 Feb 2018 17:43:47 +0000 (09:43 -0800)
commit63ff67b73597eebb53b0ded1ca3c8004d0c777dd
tree9d27b7a5c6b1f9dd8a415a136b0ffef6e49c52e4
parent123ea99462ea6a241a71c256a18b00ec18dbb18b
kconfig.h: Include compiler types to avoid missed struct attributes

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@gentoo.org>
Root-caused-by: Maciej S. Szmigiero <mail@maciej.szmigiero.name>
Suggested-by: Linus Torvalds <torvalds@linux-foundation.org>
Tested-by: Maciej S. Szmigiero <mail@maciej.szmigiero.name>
Fixes: 4324d45919c2 ("randstruct: Mark various structs for randomization")
Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
include/linux/kconfig.h