From patchwork Mon Jun 19 20:56:40 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kees Cook X-Patchwork-Id: 9797819 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 AD9E46020B for ; Mon, 19 Jun 2017 20:58:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B83C42846A for ; Mon, 19 Jun 2017 20:58:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AC8012846B; Mon, 19 Jun 2017 20:58:28 +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 3CF5128459 for ; Mon, 19 Jun 2017 20:58:25 +0000 (UTC) Received: (qmail 30295 invoked by uid 550); 19 Jun 2017 20:58:19 -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 Delivered-To: moderator for kernel-hardening@lists.openwall.com Received: (qmail 25635 invoked from network); 19 Jun 2017 20:57:07 -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; bh=vaOVRewhCBJGsJwRWXPjE0HUwpEvZD5a2wp8xvUzi7I=; b=IncEeSE3RKxkpHdh+YZTfqurny3t+YwbH4O02VnAjSJftG74M6TT5BaZGQl1TiiGh+ TzhlWed0VU53jraRnIJHw3RJ1onwI5u8o2Jg35RmjaZhtW7WndB5HEDcm7keunaeRyay DYJLOs5+eJqKA6Oy3JtxGjBGAb7dMx8Jw5Lfw= 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; bh=vaOVRewhCBJGsJwRWXPjE0HUwpEvZD5a2wp8xvUzi7I=; b=OUyKjjoM31AoBy2i15ILuq+PKzATWfGUwYIksQ60DqX/HCv05nu3vAjHZMiYRPezsL RgSQ3JXG5FmrOtEc1IFzQwz/6AUB/Vmlr6tnmRyQe6Awxdw7jb9JjUPdT7ZDNeBE8fXA 1OsbYrvcqaFdqCHs/EqCZLGjTNh7tas+8YOQU57HoxtlvYL/6Wnqbqyt8etXGoY7nsxE GnP7CkeL1Kmk/UW4yvMs6xhJGrbKB4AqBpa87nKAfZmxIX/rdYuD2NuoUaMsx2PDULd9 xXf3+WLWQSDSzzSyOYTaflRCl1cDhePuAU6Jvw+onYfrnB/sJpt93V9b/ihNei6WIM+0 NNOg== X-Gm-Message-State: AKS2vOy0ETqhRCJmD7WyKV4HXAUxZ1PbhY5zj5blGhVNtrUNH5dw8OCe 6MD5KoAyXRa2UhID X-Received: by 10.99.2.144 with SMTP id 138mr27735279pgc.265.1497905815689; Mon, 19 Jun 2017 13:56:55 -0700 (PDT) From: Kees Cook To: kernel-hardening@lists.openwall.com Cc: Kees Cook , linux-kernel@vger.kernel.org Date: Mon, 19 Jun 2017 13:56:40 -0700 Message-Id: <1497905801-69164-4-git-send-email-keescook@chromium.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1497905801-69164-1-git-send-email-keescook@chromium.org> References: <1497905801-69164-1-git-send-email-keescook@chromium.org> Subject: [kernel-hardening] [PATCH 3/4] randstruct: Disable randomization of ACPICA structs X-Virus-Scanned: ClamAV using ClamSMTP Since the ACPICA source is maintained externally to the kernel, we can neither switch it to designated initializers nor mark it __no_randomize_layout. Until ACPICA-upstream changes[1] land to handle the designated initialization, explicitly skip it in the plugin. [1] https://github.com/acpica/acpica/pull/248 Signed-off-by: Kees Cook --- scripts/gcc-plugins/randomize_layout_plugin.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scripts/gcc-plugins/randomize_layout_plugin.c b/scripts/gcc-plugins/randomize_layout_plugin.c index f777ead58ba8..e6e02a40d522 100644 --- a/scripts/gcc-plugins/randomize_layout_plugin.c +++ b/scripts/gcc-plugins/randomize_layout_plugin.c @@ -346,6 +346,10 @@ static int relayout_struct(tree type) !strcmp((const char *)ORIG_TYPE_NAME(type), "RAWPCIFACTORY")) return 0; + /* Skip ACPICA structs until refreshed with designated_init. */ + if (!strcmp((const char *)ORIG_TYPE_NAME(type), "acpi_sleep_functions")) + return 0; + /* throw out any structs in uapi */ xloc = expand_location(DECL_SOURCE_LOCATION(TYPE_FIELDS(type)));