linux/scripts/gcc-plugins
Kees Cook b07b65846b 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>
2017-06-22 16:21:41 -07:00
..
.gitignore gcc-plugins: Add the randstruct plugin 2017-06-22 16:15:45 -07:00
cyc_complexity_plugin.c gcc-plugins: consolidate on PASS_INFO macro 2017-01-13 14:20:03 -08:00
gcc-common.h gcc-plugins: Add the randstruct plugin 2017-06-22 16:15:45 -07:00
gcc-generate-gimple-pass.h GCC plugin infrastructure 2016-06-07 22:57:10 +02:00
gcc-generate-ipa-pass.h GCC plugin infrastructure 2016-06-07 22:57:10 +02:00
gcc-generate-rtl-pass.h GCC plugin infrastructure 2016-06-07 22:57:10 +02:00
gcc-generate-simple_ipa-pass.h GCC plugin infrastructure 2016-06-07 22:57:10 +02:00
gen-random-seed.sh gcc-plugins: Add the randstruct plugin 2017-06-22 16:15:45 -07:00
latent_entropy_plugin.c gcc-plugins: consolidate on PASS_INFO macro 2017-01-13 14:20:03 -08:00
Makefile gcc-plugins: Add the randstruct plugin 2017-06-22 16:15:45 -07:00
randomize_layout_plugin.c randstruct: Whitelist UNIXCB cast 2017-06-22 16:21:41 -07:00
sancov_plugin.c gcc-plugins: fix sancov_plugin for gcc-5 2017-02-27 14:10:10 -08:00
structleak_plugin.c gcc-plugins: Add structleak for more stack initialization 2017-01-18 12:02:35 -08:00