diff options
author | Kees Cook <keescook@chromium.org> | 2017-05-26 00:44:38 -0400 |
---|---|---|
committer | Kees Cook <keescook@chromium.org> | 2017-06-22 19:21:43 -0400 |
commit | 1854c19cae0d108637c40f90ee0bb9b7c1adbc0a (patch) | |
tree | a25be4ad05ab2eeff5bb88ab4ef5b36fa411eca5 /scripts/gcc-plugins/randomize_layout_plugin.c | |
parent | 802762cdfff256b6bf3fdb624ac2c56ec043c4f0 (diff) |
randstruct: Whitelist NIU struct page overloading
The NIU ethernet driver intentionally stores a page struct pointer on
top of the "mapping" field. Whitelist this case:
drivers/net/ethernet/sun/niu.c: In function ‘niu_rx_pkt_ignore’:
drivers/net/ethernet/sun/niu.c:3402:10: note: found mismatched ssa struct pointer types: ‘struct page’ and ‘struct address_space’
*link = (struct page *) page->mapping;
~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Cc: David S. Miller <davem@davemloft.net>
Signed-off-by: Kees Cook <keescook@chromium.org>
Diffstat (limited to 'scripts/gcc-plugins/randomize_layout_plugin.c')
-rw-r--r-- | scripts/gcc-plugins/randomize_layout_plugin.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/scripts/gcc-plugins/randomize_layout_plugin.c b/scripts/gcc-plugins/randomize_layout_plugin.c index c07818dac401..cdaac8c66734 100644 --- a/scripts/gcc-plugins/randomize_layout_plugin.c +++ b/scripts/gcc-plugins/randomize_layout_plugin.c | |||
@@ -46,6 +46,8 @@ struct whitelist_entry { | |||
46 | }; | 46 | }; |
47 | 47 | ||
48 | static const struct whitelist_entry whitelist[] = { | 48 | static const struct whitelist_entry whitelist[] = { |
49 | /* NIU overloads mapping with page struct */ | ||
50 | { "drivers/net/ethernet/sun/niu.c", "page", "address_space" }, | ||
49 | /* unix_skb_parms via UNIXCB() buffer */ | 51 | /* unix_skb_parms via UNIXCB() buffer */ |
50 | { "net/unix/af_unix.c", "unix_skb_parms", "char" }, | 52 | { "net/unix/af_unix.c", "unix_skb_parms", "char" }, |
51 | /* big_key payload.data struct splashing */ | 53 | /* big_key payload.data struct splashing */ |