From patchwork Fri May 26 20:17:09 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Kees Cook X-Patchwork-Id: 9751083 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 32E6760246 for ; Fri, 26 May 2017 20:18:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1B48A28179 for ; Fri, 26 May 2017 20:18:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0CFC2281C3; Fri, 26 May 2017 20:18:55 +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 BEACE28179 for ; Fri, 26 May 2017 20:18:53 +0000 (UTC) Received: (qmail 5298 invoked by uid 550); 26 May 2017 20:18:17 -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 5228 invoked from network); 26 May 2017 20:18:15 -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=jE0lPDa7by/vpQX2fUNoCNk6cl6RZVA5/Psel+ToVuc=; b=VoM2XRor0+dXKx4EiquDOy9EztKDAz8K7eWAlXlNl90HF2FBxgL79YnAD6pBytwcRT lpJU/SwOWTFzT6E5Zs8ZON0hiHo4udzX5mkgkWHjpLbJZ7MFPhwNVryPsgzmnDUOCZxm sp4opjB1CxMQ8FIqv0TaQhofzwhRPVQfYxaPM= 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=jE0lPDa7by/vpQX2fUNoCNk6cl6RZVA5/Psel+ToVuc=; b=hQtM097MTn+gFOYpStzwyYMr7tZVKfCAByLYQ+daY8NIF5Qvn7Z9a58LOhGKVJG6EV gUyljJNwPwR49fY0ZK2r9HmZ2lBcwPVQq4I3+VHYUgNnjtPN8yxvuQ1NnzVKOZ2pN1+8 wAGpwEGiHk7Sl0Vghqy5pYZZFVYbW2uOAYurFBlYNml29DvQhyHw0sSkOY6Dji6wgQWT IP1YjMg+7X8vt9gceTozk+LSh0A2xKZDdpXrpsApEcJdEa0zgPkDhLQo3bi9P2QuDO4O RgVJws6P4vbvscsGJUJRRV4Tw/H0oWvyWf94UxIEaGGiizfiXVDXaIymJuEGihOL9T9U 04cQ== X-Gm-Message-State: AODbwcBlbvj+qt45LErlcKfZX0uyOEIGfycT7U7baFO+67a6XlcCpQVn getH/r34RweCEcBX X-Received: by 10.98.152.214 with SMTP id d83mr4442932pfk.7.1495829883883; Fri, 26 May 2017 13:18:03 -0700 (PDT) From: Kees Cook To: kernel-hardening@lists.openwall.com Cc: Kees Cook , Tetsuo Handa , James Morris , Laura Abbott , x86@kernel.org, linux-kernel@vger.kernel.org Date: Fri, 26 May 2017 13:17:09 -0700 Message-Id: <1495829844-69341-6-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 05/20] randstruct: Whitelist struct security_hook_heads cast X-Virus-Scanned: ClamAV using ClamSMTP The LSM initialization routines walk security_hook_heads as an array of struct list_head instead of via names to avoid a ton of needless source. Whitelist this to avoid the false positive warning from the plugin: security/security.c: In function ‘security_init’: security/security.c:59:20: note: found mismatched op0 struct pointer types: ‘struct list_head’ and ‘struct security_hook_heads’ struct list_head *list = (struct list_head *) &security_hook_heads; ^ Cc: Tetsuo Handa Cc: James Morris 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 bccbec2af0e4..e126ac7874af 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[] = { + /* walk struct security_hook_heads as an array of struct list_head */ + { "security/security.c", "list_head", "security_hook_heads" }, { } };