Thread (1 message) 1 message, 1 author, 2017-05-28

Re: [PATCH v2 08/20] randstruct: Whitelist NIU struct page overloading

From: Kees Cook <hidden>
Date: 2017-05-28 17:35:38
Also in: lkml

On Sun, May 28, 2017 at 1:15 AM, Christoph Hellwig [off-list ref] wrote:
On Fri, May 26, 2017 at 01:17:12PM -0700, Kees Cook wrote:
quoted
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 <redacted>
The driver really needs to stop doing this anyway.  It would be good
to send this out to linux-mm and netdev to come up with a better scheme.
Added to To. :) I couldn't understand why it was doing what it was
doing, hence the whitelist entry.

-Kees

-- 
Kees Cook
Pixel Security
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help