History

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; ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Kees Cook committed 9 years ago

Commit 1854c191 parent 802762c1 file · +2 −0Browse files

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

Unified · Split

scripts/gcc-plugins/randomize_layout_plugin.c+2−0
@@ -46,6 +46,8 @@ struct whitelist_entry { · 45 unmodified lines
46};46};
47 47
48static const struct whitelist_entry whitelist[] = {48static 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 */