From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932130AbdE0BMA (ORCPT ); Fri, 26 May 2017 21:12:00 -0400 Received: from mail-pf0-f171.google.com ([209.85.192.171]:33965 "EHLO mail-pf0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S944875AbdEZUSX (ORCPT ); Fri, 26 May 2017 16:18:23 -0400 From: Kees Cook To: kernel-hardening@lists.openwall.com Cc: Kees Cook , Laura Abbott , x86@kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 11/20] randstruct: Disable randomization of ACPICA structs 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> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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))); -- 2.7.4