Skip to content

Commit fd466e0

Browse files
committed
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 <[email protected]> Cc: James Morris <[email protected]> Signed-off-by: Kees Cook <[email protected]>
1 parent 313dd1b commit fd466e0

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

scripts/gcc-plugins/randomize_layout_plugin.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ struct whitelist_entry {
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

0 commit comments

Comments
 (0)