Skip to content

Commit 802762c

Browse files
committed
randstruct: Whitelist big_key path struct overloading
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]>
1 parent b07b658 commit 802762c

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
@@ -48,6 +48,8 @@ struct whitelist_entry {
4848
static const struct whitelist_entry whitelist[] = {
4949
/* unix_skb_parms via UNIXCB() buffer */
5050
{ "net/unix/af_unix.c", "unix_skb_parms", "char" },
51+
/* big_key payload.data struct splashing */
52+
{ "security/keys/big_key.c", "path", "void *" },
5153
/* walk struct security_hook_heads as an array of struct list_head */
5254
{ "security/security.c", "list_head", "security_hook_heads" },
5355
{ }

0 commit comments

Comments
 (0)