From 8e89bf80ce8d8780bd3db165a50fa5b5bca5875c Mon Sep 17 00:00:00 2001 From: Alexander Potapenko Date: Tue, 12 Nov 2019 13:26:51 +0100 Subject: [PATCH] ANDROID: fix allmodconfig build commit e0c6791d049e ("BACKPORT: security: Create "kernel hardening" config area") introduced an x86 build breakage in allmodconfig mode. Copying the definition of GCC_PLUGIN_STRUCTLEAK_BYREF_ALL from upstream version of security/Kconfig.hardening fixes the build. Change-Id: I2def59283b829b8af8fa343eb1d4ebaa3f2e145d Reported-by: Todd Kjos Signed-off-by: Alexander Potapenko Bug: 143965122 Fixes: e0c6791d049e ("BACKPORT: security: Create "kernel hardening" config area) Test: manual - run `make allmodconfig && make -j64` Signed-off-by: Todd Kjos --- security/Kconfig.hardening | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/security/Kconfig.hardening b/security/Kconfig.hardening index 754278de395d..c532516c557f 100644 --- a/security/Kconfig.hardening +++ b/security/Kconfig.hardening @@ -43,12 +43,15 @@ choice and information exposures. config GCC_PLUGIN_STRUCTLEAK_BYREF_ALL - bool "Force initialize all struct type variables passed by reference" - depends on GCC_PLUGIN_STRUCTLEAK - depends on !COMPILE_TEST + bool "zero-init anything passed by reference (very strong)" + depends on GCC_PLUGINS + select GCC_PLUGIN_STRUCTLEAK help - Zero initialize any struct type local variable that may - be passed by reference without having been initialized. + Zero-initialize any stack variables that may be passed + by reference and had not already been explicitly + initialized. This is intended to eliminate all classes + of uninitialized stack variable exploits and information + exposures. config INIT_STACK_ALL bool "0xAA-init everything on the stack (strongest)"