From patchwork Fri May 26 20:17:15 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kees Cook X-Patchwork-Id: 9751093 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 929A860246 for ; Fri, 26 May 2017 20:19:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8577C28334 for ; Fri, 26 May 2017 20:19:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 79D0928347; Fri, 26 May 2017 20:19: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 7F8D728334 for ; Fri, 26 May 2017 20:19:27 +0000 (UTC) Received: (qmail 8061 invoked by uid 550); 26 May 2017 20:18:36 -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 7888 invoked from network); 26 May 2017 20:18:34 -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=StwIUuGPC4dDJsuFiK+V5T4Kw2vDmmNNSkn4Ila/yUGKm6v+r+GOC/nihxwrvcygsM dB21u/bd9FhRTPYChanxIP2/cVovEi7SVRZMKMd/S6X/cxJm/NPS2eMmO0xVQ9pNvIt/ X8kT8YUycv/+XH6cCcZfVRJacwmrNTochizu4= 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=fQk1PsMCUkCYqfl9Yn96Xk2dMSNjk8PVuO/Jx/HFb/konAUpqm7+9mt80cJDNInlfw pokGZIH5U4TdRt1YSbB3Uz2rBEIYnMNUjDMPyJ/ibPtTNhzx95fvJxhTvnxlN0tR+ucC +0UzsOg5dwdra3j2TIIvYEb1sfdy69flFhfIhPVW5HjoAtB76zpjH2g1a3ChxKatdbN5 uP4pJa3gUiU9gxvp5pwpQvK537M1lVGw85eDqNvccT+L4yOAeIuJ9CYbNLJz1VesmPdl rdcBrXHM3r8e0KvmuoM3Ol2QwR2ruxJ1TziiY9K5jeGu9WAt09ngIYvD9rmP2S2zVRgu T7bQ== X-Gm-Message-State: AODbwcAnkORS1XJrTVcMTsVT7XYahDXHeSf0ixViwDM830SMl29V1yJm jdDY3xU6O72NFzRt X-Received: by 10.84.239.23 with SMTP id w23mr59510182plk.73.1495829902761; Fri, 26 May 2017 13:18:22 -0700 (PDT) From: Kees Cook To: kernel-hardening@lists.openwall.com Cc: Kees Cook , Laura Abbott , x86@kernel.org, linux-kernel@vger.kernel.org Date: Fri, 26 May 2017 13:17:15 -0700 Message-Id: <1495829844-69341-12-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> Subject: [kernel-hardening] [PATCH v2 11/20] 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)));