From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750941AbdE1Rha (ORCPT ); Sun, 28 May 2017 13:37:30 -0400 Received: from mail-it0-f46.google.com ([209.85.214.46]:37834 "EHLO mail-it0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750824AbdE1Rh2 (ORCPT ); Sun, 28 May 2017 13:37:28 -0400 MIME-Version: 1.0 In-Reply-To: <20170528081541.GE22193@infradead.org> References: <1495829844-69341-1-git-send-email-keescook@chromium.org> <1495829844-69341-9-git-send-email-keescook@chromium.org> <20170528081541.GE22193@infradead.org> From: Kees Cook Date: Sun, 28 May 2017 10:37:26 -0700 X-Google-Sender-Auth: M7SitEYjOj_T-pOdsGxIhOFuACE Message-ID: Subject: Re: [PATCH v2 08/20] randstruct: Whitelist NIU struct page overloading To: Christoph Hellwig , Linux-MM , Network Development Cc: "kernel-hardening@lists.openwall.com" , "David S . Miller" , Laura Abbott , "x86@kernel.org" , LKML Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by mail.home.local id v4SHbXWh032746 [trying again with correct linux-mm address...] On Sun, May 28, 2017 at 1:15 AM, Christoph Hellwig wrote: > On Fri, May 26, 2017 at 01:17:12PM -0700, Kees Cook wrote: >> 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 >> Signed-off-by: Kees Cook > > 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