From: John Johansen Date: Mon, 16 Jan 2017 21:21:27 +0000 (-0800) Subject: apparmor: fix undefined reference to `aa_g_hash_policy' X-Git-Tag: C0P2-H0.0--20200415~6858 X-Git-Url: https://git.somdevices.com/?a=commitdiff_plain;h=ab71bee531fd7f760fc919a3fa8801261f91b4c8;p=linux.git apparmor: fix undefined reference to `aa_g_hash_policy' [ Upstream commit 3ccb76c5dfe0d25c1d0168d5b726d0b43d19a485 ] The kernel build bot turned up a bad config combination when CONFIG_SECURITY_APPARMOR is y and CONFIG_SECURITY_APPARMOR_HASH is n, resulting in the build error security/built-in.o: In function `aa_unpack': (.text+0x841e2): undefined reference to `aa_g_hash_policy' Signed-off-by: John Johansen Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- diff --git a/security/apparmor/lsm.c b/security/apparmor/lsm.c index 41b8cb115801..7d3a98b2d55a 100644 --- a/security/apparmor/lsm.c +++ b/security/apparmor/lsm.c @@ -671,9 +671,9 @@ enum profile_mode aa_g_profile_mode = APPARMOR_ENFORCE; module_param_call(mode, param_set_mode, param_get_mode, &aa_g_profile_mode, S_IRUSR | S_IWUSR); -#ifdef CONFIG_SECURITY_APPARMOR_HASH /* whether policy verification hashing is enabled */ bool aa_g_hash_policy = IS_ENABLED(CONFIG_SECURITY_APPARMOR_HASH_DEFAULT); +#ifdef CONFIG_SECURITY_APPARMOR_HASH module_param_named(hash_policy, aa_g_hash_policy, aabool, S_IRUSR | S_IWUSR); #endif