From patchwork Sun Feb 4 17:34:38 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Valdis_Kl=C4=93tnieks?= X-Patchwork-Id: 10199385 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 386276020F for ; Sun, 4 Feb 2018 17:35:05 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0A722285A5 for ; Sun, 4 Feb 2018 17:35:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EEDD1285C3; Sun, 4 Feb 2018 17:35:04 +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=-2.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, THIS_AD 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 A5F3F285A5 for ; Sun, 4 Feb 2018 17:35:02 +0000 (UTC) Received: (qmail 14227 invoked by uid 550); 4 Feb 2018 17:34:58 -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 14183 invoked from network); 4 Feb 2018 17:34:57 -0000 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:mime-version:date:message-id; bh=QPVwTxOniS1xOM6ictjFNyuXVLeCgoSDVIjhUgMrz5Y=; b=nvjp8jcME7tggo1wqp3OMsQd8+tKO8D5XOf2Ervs5Zc/75nWSwyex4ti/3jZIuexPA 9oRbQOfnjU8DG2GHJaHEmBFYHA1VxNpH8GuvuKLxTQkg2V184ePUwsod5EeCV3PM8vDA ze+tgU8bahB7tRjf0U4l7kpCr3Q5+rwVsbGyUjVLNBPsdOWRu/thfJOGhj8dP38uiVlK ItRqYRAetgk2oGEHEVcmnctHXyoT+ZlOXy6NgNPXTCihwY0LylQgNMGWTWmEgAaG67GM yAf33Fez1NDXgLyZxpMBlNQBU0D1R4RXMlDNnzK0AaCmy99k+V1fvlKy4Wdm1wkB2pRT 6MRg== X-Gm-Message-State: AKwxytf2hkv+CwEhWaFu6DwJ28G2JKvXGsEa88e5xqRI56OfdGodvphM wp04fBnWSpdXFkLImsXUXJi8oexPQegq/AnNW/dDeHkEgDh5RWkVICsHwfI29mQe7c9/prm65ir vxYuLm2P3cUXeGFHPtUApPte2d8b5tYr4j72rfbu6D9vX X-Received: by 10.55.16.9 with SMTP id a9mr20047832qkh.358.1517765680758; Sun, 04 Feb 2018 09:34:40 -0800 (PST) X-Google-Smtp-Source: AH8x2240lGW7YY5cEu4UMz9Uk7LQ7icgT0f/1AuQ23w6IjVGIdYTWmcwfm/gW9Ic7GCtYvz4mNj0DQ== X-Received: by 10.55.16.9 with SMTP id a9mr20047819qkh.358.1517765680553; Sun, 04 Feb 2018 09:34:40 -0800 (PST) X-Mailer: exmh version 2.8.0 04/21/2017 with nmh-1.7+dev From: valdis.kletnieks@vt.edu To: Kees Cook , kernel-hardening@lists.openwall.com cc: linux-kernel@vger.kernel.org Subject: [PATCH 2/2] GCC release 8 support for gcc-plugins Mime-Version: 1.0 Date: Sun, 04 Feb 2018 12:34:38 -0500 Message-ID: <123377.1517765678@turing-police.cc.vt.edu> X-Virus-Scanned: ClamAV using ClamSMTP For reasons totally beyond my understanding, gcc 8 changed the order of two structure member, which leads to an error: HOSTCXX -fPIC scripts/gcc-plugins/latent_entropy_plugin.o scripts/gcc-plugins/latent_entropy_plugin.c:269:1: error: designator order for field 'attribute_spec::affects_type_identity' does not match declaration order in 'attribute_spec' }; ^ make[1]: *** [scripts/Makefile.host:141: scripts/gcc-plugins/latent_entropy_plugin.o] Error 1 Maybe we'll get lucky and they'll undo that change before official release, so all this ad-crock #ifdef-ery won't be needed. Do we know any gcc experts to ask? Signed-off-by: Valdis Kletnieks --- diff --git a/scripts/gcc-plugins/latent_entropy_plugin.c b/scripts/gcc-plugins/latent_entropy_plugin.c index 65264960910d..15a6df3592c5 100644 --- a/scripts/gcc-plugins/latent_entropy_plugin.c +++ b/scripts/gcc-plugins/latent_entropy_plugin.c @@ -262,10 +262,17 @@ static struct attribute_spec latent_entropy_attr = { .decl_required = true, .type_required = false, .function_type_required = false, +#if BUILDING_GCC_VERSION >= 8000 + .affects_type_identity = false, .handler = handle_latent_entropy_attribute, +#else #if BUILDING_GCC_VERSION >= 4007 - .affects_type_identity = false -#endif + .handler = handle_latent_entropy_attribute, + .affects_type_identity = false, +#else + .handler = handle_latent_entropy_attribute, +#endif /* >= 4007 */ +#endif /* >= 8000 */ }; static void register_attributes(void *event_data __unused, void *data __unused) diff --git a/scripts/gcc-plugins/structleak_plugin.c b/scripts/gcc-plugins/structleak_plugin.c index 3f8dd4868178..f700bc059050 100644 --- a/scripts/gcc-plugins/structleak_plugin.c +++ b/scripts/gcc-plugins/structleak_plugin.c @@ -64,10 +64,17 @@ static struct attribute_spec user_attr = { .decl_required = false, .type_required = false, .function_type_required = false, - .handler = handle_user_attribute, +#if BUILDING_GCC_VERSION >= 8000 + .affects_type_identity = false, + .handler = handle_latent_entropy_attribute, +#else #if BUILDING_GCC_VERSION >= 4007 - .affects_type_identity = true -#endif + .handler = handle_latent_entropy_attribute, + .affects_type_identity = false, +#else + .handler = handle_latent_entropy_attribute, +#endif /* >= 4007 */ +#endif /* >= 8000 */ }; static void register_attributes(void *event_data, void *data) diff --git a/scripts/gcc-plugins/randomize_layout_plugin.c b/scripts/gcc-plugins/randomize_layout_plugin.c index 0073af326449..1dafa102a907 100644 --- a/scripts/gcc-plugins/randomize_layout_plugin.c +++ b/scripts/gcc-plugins/randomize_layout_plugin.c @@ -589,10 +589,17 @@ static struct attribute_spec randomize_layout_attr = { // need type declaration .type_required = true, .function_type_required = false, - .handler = handle_randomize_layout_attr, +#if BUILDING_GCC_VERSION >= 8000 + .affects_type_identity = false, + .handler = handle_latent_entropy_attribute, +#else #if BUILDING_GCC_VERSION >= 4007 - .affects_type_identity = true -#endif + .handler = handle_latent_entropy_attribute, + .affects_type_identity = false, +#else + .handler = handle_latent_entropy_attribute, +#endif /* >= 4007 */ +#endif /* >= 8000 */ }; static struct attribute_spec no_randomize_layout_attr = { @@ -604,10 +611,17 @@ static struct attribute_spec no_randomize_layout_attr = { // need type declaration .type_required = true, .function_type_required = false, - .handler = handle_randomize_layout_attr, +#if BUILDING_GCC_VERSION >= 8000 + .affects_type_identity = false, + .handler = handle_latent_entropy_attribute, +#else #if BUILDING_GCC_VERSION >= 4007 - .affects_type_identity = true -#endif + .handler = handle_latent_entropy_attribute, + .affects_type_identity = false, +#else + .handler = handle_latent_entropy_attribute, +#endif /* >= 4007 */ +#endif /* >= 8000 */ }; static struct attribute_spec randomize_considered_attr = { @@ -619,10 +633,17 @@ static struct attribute_spec randomize_considered_attr = { // need type declaration .type_required = true, .function_type_required = false, - .handler = handle_randomize_considered_attr, +#if BUILDING_GCC_VERSION >= 8000 + .affects_type_identity = false, + .handler = handle_latent_entropy_attribute, +#else #if BUILDING_GCC_VERSION >= 4007 - .affects_type_identity = false -#endif + .handler = handle_latent_entropy_attribute, + .affects_type_identity = false, +#else + .handler = handle_latent_entropy_attribute, +#endif /* >= 4007 */ +#endif /* >= 8000 */ }; static struct attribute_spec randomize_performed_attr = { @@ -634,10 +655,17 @@ static struct attribute_spec randomize_performed_attr = { // need type declaration .type_required = true, .function_type_required = false, - .handler = handle_randomize_performed_attr, +#if BUILDING_GCC_VERSION >= 8000 + .affects_type_identity = false, + .handler = handle_latent_entropy_attribute, +#else #if BUILDING_GCC_VERSION >= 4007 - .affects_type_identity = false -#endif + .handler = handle_latent_entropy_attribute, + .affects_type_identity = false, +#else + .handler = handle_latent_entropy_attribute, +#endif /* >= 4007 */ +#endif /* >= 8000 */ }; static void register_attributes(void *event_data, void *data)