From patchwork Thu Apr 6 21:18:29 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kees Cook X-Patchwork-Id: 9668477 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 7309E602B3 for ; Thu, 6 Apr 2017 21:21:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AF19C285CF for ; Thu, 6 Apr 2017 21:21:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A3E71285E9; Thu, 6 Apr 2017 21:21:49 +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 BB213285CF for ; Thu, 6 Apr 2017 21:21:48 +0000 (UTC) Received: (qmail 1342 invoked by uid 550); 6 Apr 2017 21:19:47 -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 30015 invoked from network); 6 Apr 2017 21:19:26 -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=i/v3MOGxoFfJIKs9M0grTPBmZctsvUHzlws+fNSRJJU=; b=gNG16z+k1BqHur21MYS3aMK3TYfOce+9D2beg2oJYahaRMDDury/EYs7YCsx43yUMW 7K9GF68lO1Q+1hgZrq++wS0OUs3CnGQ1DOaEqxyeaqq+k8bxPROyV35lUUuWOm1M4pAn DgBjwQLAgfjDDb5Lcr2Ac9QAlCvPs1Vpcb4mk= 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=i/v3MOGxoFfJIKs9M0grTPBmZctsvUHzlws+fNSRJJU=; b=T7pIIpHHkapHjpae2+SrDpXHB7+MTjbnPbkXGOq0BaTAlgieEUtWRZFtQKC0RgGv55 NGCXsA7tvIahaSTWzzu7LUzDLllH31h7r+vPFdr7ReWI6aODJAdkltOMOFpYCtQh4Pcn 1BMu0GIvBNJxwZpHViasAWtMMFhysut8L1SMi+JUZdf04gBETL4blJ8L5L/TmHGCTuGc wdcfWjHdvjIfiDoUgEApp2LSEEkKRJ69dJByrfSmD7lohdCv7zCDSwDUgpg1RIDMWeml dWyv65q4bCNWd3QeL/qUz3NtwfoKZJVmAIv1WifzVPar0rB9/0g4WwBMrsuRXhDCl0nf +4Rw== X-Gm-Message-State: AFeK/H3SCbZjY6cuwqXfFKt6NuFrhPwqbp3Wbq+9YYTRQAP8RvJACdDaZ9KfEjsrLquWVEtg X-Received: by 10.84.245.2 with SMTP id i2mr45689712pll.131.1491513550254; Thu, 06 Apr 2017 14:19:10 -0700 (PDT) From: Kees Cook To: kernel-hardening@lists.openwall.com Cc: Kees Cook , Michael Leibowitz Date: Thu, 6 Apr 2017 14:18:29 -0700 Message-Id: <1491513513-84351-15-git-send-email-keescook@chromium.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1491513513-84351-1-git-send-email-keescook@chromium.org> References: <1491513513-84351-1-git-send-email-keescook@chromium.org> Subject: [kernel-hardening] [PATCH 14/18] 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 land to handle the designated initialization, explicitly skip it in the plugin. 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 a2d7e933c33f..cbde695e392a 100644 --- a/scripts/gcc-plugins/randomize_layout_plugin.c +++ b/scripts/gcc-plugins/randomize_layout_plugin.c @@ -329,6 +329,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)));