History

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; ^

Kees Cook committed 9 years ago

Commit fd466e01 parent 313dd1b1 file · +2 −0Browse files

Showing the changes to scripts (1 of 1 file). Show all

Unified · Split

scripts/gcc-plugins/randomize_layout_plugin.c+2−0
@@ -46,6 +46,8 @@ struct whitelist_entry { · 45 unmodified lines
4646 };
4747
4848 static const struct whitelist_entry whitelist[] = {
49+ /* walk struct security_hook_heads as an array of struct list_head */
50+ { "security/security.c", "list_head", "security_hook_heads" },
4951 { }
5052 };
5153