randstruct: Whitelist NIU struct page overloading
authorKees Cook <keescook@chromium.org>
Fri, 26 May 2017 04:44:38 +0000 (21:44 -0700)
committerKees Cook <keescook@chromium.org>
Thu, 22 Jun 2017 23:21:43 +0000 (16:21 -0700)
commit1854c19cae0d108637c40f90ee0bb9b7c1adbc0a
treea25be4ad05ab2eeff5bb88ab4ef5b36fa411eca5
parent802762cdfff256b6bf3fdb624ac2c56ec043c4f0
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>
scripts/gcc-plugins/randomize_layout_plugin.c