mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-08 04:42:04 -04:00
randstruct: Whitelist UNIXCB cast
This is another false positive in bad cast detection:
net/unix/af_unix.c: In function ‘unix_skb_scm_eq’:
net/unix/af_unix.c:1621:31: note: found mismatched rhs struct pointer types: ‘struct unix_skb_parms’ and ‘char’
const struct unix_skb_parms *u = &UNIXCB(skb);
^
UNIXCB is:
#define UNIXCB(skb) (*(struct unix_skb_parms *)&((skb)->cb))
And ->cb is:
char cb[48] __aligned(8);
This is a rather crazy cast, but appears to be safe in the face of
randomization, so whitelist it in the plugin.
Cc: Hannes Frederic Sowa <hannes@stressinduktion.org>
Cc: David S. Miller <davem@davemloft.net>
Signed-off-by: Kees Cook <keescook@chromium.org>
This commit is contained in:
parent
fd466e068e
commit
b07b65846b
1 changed files with 2 additions and 0 deletions
|
|
@ -46,6 +46,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" },
|
||||
/* walk struct security_hook_heads as an array of struct list_head */
|
||||
{ "security/security.c", "list_head", "security_hook_heads" },
|
||||
{ }
|
||||
|
|
|
|||
Loading…
Reference in a new issue