From patchwork Fri May 26 20:17:11 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Kees Cook X-Patchwork-Id: 9751087 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 8D1C060246 for ; Fri, 26 May 2017 20:19:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7F94C28179 for ; Fri, 26 May 2017 20:19:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 741D3281C3; Fri, 26 May 2017 20:19:06 +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 979EE28179 for ; Fri, 26 May 2017 20:19:05 +0000 (UTC) Received: (qmail 7527 invoked by uid 550); 26 May 2017 20:18:29 -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 7432 invoked from network); 26 May 2017 20:18:28 -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=H/xQ+yMVKuauTvK0dtM8RygEj+4OhKN1mU37Xc4i8NY=; b=FRbrykB85QNfdCecaj+1pnCSS5Mc9zSl4tGpU1LddMhxWnCPu57/hhbA3kLWC7Udob +FPz5fjbG4/AtcOdJUzQjbbRntgRn5Tf/wl5svu4vJLRUyMhW/Q1OPRy3HYdiVIdr/AX v/CUEJA4jn0nepqMctB6xGQrZrPI3exG/qCf8= 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=H/xQ+yMVKuauTvK0dtM8RygEj+4OhKN1mU37Xc4i8NY=; b=DEW+Cc9FRWbR1c4jcCIIBfWLrHrwg86LbVCXGqgjRIaopZfL8pEewh0s0qMUS06Bik cWYXjeJGBfZ87Tm3rZ3qnDxryLs9Jw0MfAulrFLPfHVWNo8gT02KR5O7uqI6aRSNsHfV MrctZb58pJc1MAY2Ll3Ghzvdvka75Bj/1BpX8ArrKeedJUjZara067ssVXBqtWAs7EoI wIKdGu4YpQ1xrQsF1ZcuCfN/rAMT0uZyIw8HM8jQB9WYLEICxwMz7b69XkkRz6mDCsc8 6SWWG7uiMlbhLjuhljsFgLbBd3YTGHg8Y3rZzkc+0litpK1N0uN91xhd+j3SkwURPe+V Dhbw== X-Gm-Message-State: AODbwcDo292G5Ewd9YpUwQAFePJ+dqLPVsQVRJqvq0hRpIeQ8KF+1aRW ZA/CVeZO7GcmnIREkAd+1A== X-Received: by 10.98.211.87 with SMTP id q84mr4500275pfg.126.1495829896849; Fri, 26 May 2017 13:18:16 -0700 (PDT) From: Kees Cook To: kernel-hardening@lists.openwall.com Cc: Kees Cook , David Howells , Laura Abbott , x86@kernel.org, linux-kernel@vger.kernel.org Date: Fri, 26 May 2017 13:17:11 -0700 Message-Id: <1495829844-69341-8-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 07/20] randstruct: Whitelist big_key path struct overloading X-Virus-Scanned: ClamAV using ClamSMTP The big_key payload structure intentionally stores a struct path in two void pointers to avoid header soup. Whitelist this case: security/keys/big_key.c: In function ‘big_key_read’: security/keys/big_key.c:293:16: note: found mismatched rhs struct pointer types: ‘struct path’ and ‘void *’ struct path *path = (struct path *)&key->payload.data[big_key_path]; ^~~~ Cc: David Howells 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 bf110915a5aa..5f4e59a78eeb 100644 --- a/scripts/gcc-plugins/randomize_layout_plugin.c +++ b/scripts/gcc-plugins/randomize_layout_plugin.c @@ -45,6 +45,8 @@ struct whitelist_entry { static const struct whitelist_entry whitelist[] = { /* unix_skb_parms via UNIXCB() buffer */ { "net/unix/af_unix.c", "unix_skb_parms", "char" }, + /* big_key payload.data struct splashing */ + { "security/keys/big_key.c", "path", "void *" }, /* walk struct security_hook_heads as an array of struct list_head */ { "security/security.c", "list_head", "security_hook_heads" }, { }