Skip to content

Commit

Permalink
randstruct: Whitelist big_key path struct overloading
Browse files Browse the repository at this point in the history
The big_key payload structure intentionally stores a struct path in
two void pointers to avoid header soup. Whitelist this case:

security/keys/big_key.c: In function ‘big_key_read’:
security/keys/big_key.c:293:16: note: found mismatched rhs struct pointer types: ‘struct path’ and ‘void *’

   struct path *path = (struct path *)&key->payload.data[big_key_path];
                ^~~~

Cc: David Howells <[email protected]>
Signed-off-by: Kees Cook <[email protected]>
  • Loading branch information
kees committed Jun 22, 2017
1 parent b07b658 commit 802762c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions scripts/gcc-plugins/randomize_layout_plugin.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ struct whitelist_entry {
static const struct whitelist_entry whitelist[] = {
/* unix_skb_parms via UNIXCB() buffer */
{ "net/unix/af_unix.c", "unix_skb_parms", "char" },
/* big_key payload.data struct splashing */
{ "security/keys/big_key.c", "path", "void *" },
/* walk struct security_hook_heads as an array of struct list_head */
{ "security/security.c", "list_head", "security_hook_heads" },
{ }
Expand Down

0 comments on commit 802762c

Please sign in to comment.