From: Kees Cook Date: Tue, 4 Apr 2017 23:50:45 +0000 (-0700) Subject: randstruct: Whitelist struct security_hook_heads cast X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=fd466e068e5adef5922b76f24374c96ba01faaa2;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git randstruct: Whitelist struct security_hook_heads cast The LSM initialization routines walk security_hook_heads as an array of struct list_head instead of via names to avoid a ton of needless source. Whitelist this to avoid the false positive warning from the plugin: security/security.c: In function ‘security_init’: security/security.c:59:20: note: found mismatched op0 struct pointer types: ‘struct list_head’ and ‘struct security_hook_heads’ struct list_head *list = (struct list_head *) &security_hook_heads; ^ Cc: Tetsuo Handa Cc: James Morris Signed-off-by: Kees Cook --- diff --git a/scripts/gcc-plugins/randomize_layout_plugin.c b/scripts/gcc-plugins/randomize_layout_plugin.c index e1d1ba28739f..dc0df3765a8f 100644 --- a/scripts/gcc-plugins/randomize_layout_plugin.c +++ b/scripts/gcc-plugins/randomize_layout_plugin.c @@ -46,6 +46,8 @@ struct whitelist_entry { }; static const struct whitelist_entry whitelist[] = { + /* walk struct security_hook_heads as an array of struct list_head */ + { "security/security.c", "list_head", "security_hook_heads" }, { } };