History

af_unix: Silence randstruct GCC plugin warning

While preparing for Clang randstruct support (which duplicated many of the warnings the randstruct GCC plugin warned about), one strange one remained only for the randstruct GCC plugin. Eliminating this rids the plugin of the last exception. It seems the plugin is happy to dereference individual members of a cross-struct cast, but it is upset about casting to a whole object pointer. This only manifests in one place in the kernel, so just replace the variable with individual member accesses. There is no change in executable instruction output. Drop the last exception from the randstruct GCC plugin.

Kees Cook committed 4 years ago

Commit b146cbf1 parent 2dcfe9e2 files · +3 −7Browse files

Showing the changes to scripts (1 of 2 files). Show all

Unified · Split

scripts/gcc-plugins/randomize_layout_plugin.c+0−2
@@ -46,8 +46,6 @@ struct whitelist_entry { · 45 unmodified lines
4646 };
4747
4848 static const struct whitelist_entry whitelist[] = {
49− /* unix_skb_parms via UNIXCB() buffer */
50− { "net/unix/af_unix.c", "unix_skb_parms", "char" },
5149 { }
5250 };
5351