From patchwork Fri May 26 20:17:12 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Kees Cook X-Patchwork-Id: 9751089 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id D3C3560246 for ; Fri, 26 May 2017 20:19:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C46C428334 for ; Fri, 26 May 2017 20:19:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B898E28347; Fri, 26 May 2017 20:19:12 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from mother.openwall.net (mother.openwall.net [195.42.179.200]) by mail.wl.linuxfoundation.org (Postfix) with SMTP id B604028334 for ; Fri, 26 May 2017 20:19:11 +0000 (UTC) Received: (qmail 7749 invoked by uid 550); 26 May 2017 20:18:32 -0000 Mailing-List: contact kernel-hardening-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Delivered-To: mailing list kernel-hardening@lists.openwall.com Received: (qmail 7660 invoked from network); 26 May 2017 20:18:31 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=r5F/S9mfT1WNDV0+bUCYeSN0/wfsrjKyIwccuHn6IUg=; b=QvrRv/q64sMCIqJ9Xjx1Q6S5o1xzuuIyU4gbqJLWJsVFnrdMmGhQy/K+fqe9ERW74M kP9AvSGV5zP84LMYXnOb+WX9emWykyAZH7XcTgY1OtRVe6jmR8IJRKsVefkJwVjDbJe1 yA3zOhI0N7gXIUrDOAofKLbU5h8MGpGY+CPA0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=r5F/S9mfT1WNDV0+bUCYeSN0/wfsrjKyIwccuHn6IUg=; b=AXHAcg0wt2N95LKksEfMx5dIW5YPOEM6Pf5Em+o+0GQ3zLw3x53yBVIapYITi3mGkX QqK93QAJvzcu4DoLaF/ccHKQ/usiukq0sXHs10v02rJaAdLcpqwgdO4Ji06YVJUQsNT6 +4Riou+Lxa4a8bblP+uXc90TZ1lv1fPHoH+5rDg4YDWmOmitseKXtfP23UN5IZgxlNTU cwEWFssARBNdo4ILqu8/muQp2QQkvLcrg5v+y4BmdN63nNIyqnEEggB/4zhkMscf2XID WZhaCzL3TSYZZDQ9fv1+/B76Uf7VXfeDRxucqAn6pD1BYR4ErVry1CTRzCKV5JrzI4OG eB4Q== X-Gm-Message-State: AODbwcABrId/BO9Q3SXoTt9GwhayE9AlwPLic+fXnks4/u+4obkQZmdA xZiDjXJB8B7KZF2m X-Received: by 10.84.248.73 with SMTP id e9mr60613782pln.76.1495829899402; Fri, 26 May 2017 13:18:19 -0700 (PDT) From: Kees Cook To: kernel-hardening@lists.openwall.com Cc: Kees Cook , "David S . Miller" , Laura Abbott , x86@kernel.org, linux-kernel@vger.kernel.org Date: Fri, 26 May 2017 13:17:12 -0700 Message-Id: <1495829844-69341-9-git-send-email-keescook@chromium.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1495829844-69341-1-git-send-email-keescook@chromium.org> References: <1495829844-69341-1-git-send-email-keescook@chromium.org> MIME-Version: 1.0 Subject: [kernel-hardening] [PATCH v2 08/20] randstruct: Whitelist NIU struct page overloading X-Virus-Scanned: ClamAV using ClamSMTP 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 --- scripts/gcc-plugins/randomize_layout_plugin.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/gcc-plugins/randomize_layout_plugin.c b/scripts/gcc-plugins/randomize_layout_plugin.c index 5f4e59a78eeb..f777ead58ba8 100644 --- a/scripts/gcc-plugins/randomize_layout_plugin.c +++ b/scripts/gcc-plugins/randomize_layout_plugin.c @@ -43,6 +43,8 @@ struct whitelist_entry { }; static const struct whitelist_entry whitelist[] = { + /* NIU overloads mapping with page struct */ + { "drivers/net/ethernet/sun/niu.c", "page", "address_space" }, /* unix_skb_parms via UNIXCB() buffer */ { "net/unix/af_unix.c", "unix_skb_parms", "char" }, /* big_key payload.data struct splashing */