From patchwork Thu Mar 30 11:04:40 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 9653885 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 E3FB260349 for ; Thu, 30 Mar 2017 11:05:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D678A2857B for ; Thu, 30 Mar 2017 11:05:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C792728583; Thu, 30 Mar 2017 11:05:02 +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 A6DE12857B for ; Thu, 30 Mar 2017 11:05:00 +0000 (UTC) Received: (qmail 19542 invoked by uid 550); 30 Mar 2017 11:04:57 -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 19473 invoked from network); 30 Mar 2017 11:04:52 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=2uTw1QD4IuAOOFvE/fYKbX89RxJX1D8fhfJ5KQhJm0A=; b=rILLK/q5dc+1K3Hs/2r+qPCjrEqGAfQCrkgpdnOMHag30H2wbwgChYkkRTnpCa28Qd 4t1XVgIHnX3l0MD1vnDl7lAdq/J+c7V/BpW124uDG2yNqZVg2cdKHWriEEEs3V5b5HEp 912Rau56bdvTDi+uQ7c+NZ9f5+MYRLTvhHAFvQ8ElKjLrp3vMcZkztNCROGv1POjBVAy x1YJZ9NYVB769rGnfPW75oWZvClN440et9O1h2EuNxDAFkTugtkla+yk+HE7yd17pZn5 WhPcFoYGc3c7mSHnoHKpAqohL/666H2s2WhfrRvcnkLTGQcU2Ruu19gRPToV3BcFnokC kJlA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=2uTw1QD4IuAOOFvE/fYKbX89RxJX1D8fhfJ5KQhJm0A=; b=koC6Dsuzqgw7lKTyoJ2uWdH7RqNK2t5JfyCmS0UEyolug+bY1KXpiAW007liDybY1e +Er8xRaGCeadr5YCiavSU/WgBF4z4K/PYEF+VdwqAOlKjiQngbWCTujfN+acxAQt/0K9 ruYhsP5hwVkDswmMwj1Y/C19VQAY5/pn5tckIx7njWI/XE1mLOp9gRp4Zz7v2+oEVeCh yEcgWqA2CrScPErt61x4WcE3UkLQDRmJCFhtX+zVr9AkNt3b2jD6fWb6iJ81Z6RuyRBN WLU0WzkSy4kdA7y63lWQ031Sc2MVTkzOnYtQ882PwrNaAChAOCMYnTil0RIphqvw2qlu pyCA== X-Gm-Message-State: AFeK/H3+ALHR2ZmFuRDSP6pNtC4/kg2q995bSLoUtx5tKWGbuvNI5c5Pgzk7cbeq9CvxHFkEkji2o/zI0Y3Isg== X-Received: by 10.157.55.228 with SMTP id x91mr2809373otb.195.1490871880651; Thu, 30 Mar 2017 04:04:40 -0700 (PDT) MIME-Version: 1.0 Sender: arndbergmann@gmail.com In-Reply-To: References: <1485894263-91051-1-git-send-email-keescook@chromium.org> <1485894263-91051-2-git-send-email-keescook@chromium.org> From: Arnd Bergmann Date: Thu, 30 Mar 2017 13:04:40 +0200 X-Google-Sender-Auth: moxDxMRh3E8d7KHk59JmJpQ892Y Message-ID: To: Kees Cook Cc: Linux Kernel Mailing List , Emese Revfy , Josh Triplett , PaX Team , Masahiro Yamada , minipli@ld-linux.so, Russell King - ARM Linux , Catalin Marinas , Rasmus Villemoes , David Brown , Benjamin Herrenschmidt , Thomas Gleixner , Andrew Morton , Jeff Layton , Sam Ravnborg , kernel-hardening@lists.openwall.com Subject: [kernel-hardening] Re: [PATCH v5 1/4] gcc-plugins: Add the initify gcc plugin X-Virus-Scanned: ClamAV using ClamSMTP On Wed, Mar 29, 2017 at 10:56 AM, Arnd Bergmann wrote: > And here is a workaround that I applied locally to avoid the ICE, but > I wouldn't want to have this upstream. > > commit 8712fd8979a5730318a84922fbcb8791ea5af40e > Author: Arnd Bergmann > Date: Wed Mar 29 10:53:48 2017 +0200 > > work around initify ICE > > arch/arm/mach-mv78xx0/common.i: In function 'mv78xx0_init': > arch/arm/mach-mv78xx0/common.i:28:38: internal compiler error: in > search_constant_strings, at > git/arm-soc/scripts/gcc-plugins/initify_plugin.c:1375 > __attribute__ ((latent_entropy)) mv78xx0_init(void) > ^~~~~~~~~~~~ > 0x7fe5cd711b9d search_constant_strings > /git/arm-soc/scripts/gcc-plugins/initify_plugin.c:1375 > 0x7fe5cd711950 search_constant_strings > /git/arm-soc/scripts/gcc-plugins/initify_plugin.c:1335 > 0x7fe5cd711950 search_constant_strings > /git/arm-soc/scripts/gcc-plugins/initify_plugin.c:1367 > 0x7fe5cd712abe search_constant_strings > /git/arm-soc/scripts/gcc-plugins/initify_plugin.c:1506 Two more ICEs: a) *** WARNING *** there are active plugins, do not report this as a bug unless you can reproduce it without enabling any plugins. Event | Plugins PLUGIN_ATTRIBUTES | latent_entropy_plugin initify_plugin PLUGIN_START_UNIT | latent_entropy_plugin initify_plugin /git/arm-soc/drivers/scsi/gdth.c: In function 'gdth_search_drives': /git/arm-soc/drivers/scsi/gdth.c:1550:12: internal compiler error: in search_constant_strings, at git/arm-soc/scripts/gcc-plugins/initify_plugin.c:1375 static int gdth_search_drives(gdth_ha_str *ha) ^~~~~~~~~~~~~~~~~~ 0x2b0f7a831b9d search_constant_strings /git/arm-soc/scripts/gcc-plugins/initify_plugin.c:1375 0x2b0f7a831950 search_constant_strings /git/arm-soc/scripts/gcc-plugins/initify_plugin.c:1335 0x2b0f7a831950 search_constant_strings /git/arm-soc/scripts/gcc-plugins/initify_plugin.c:1367 0x2b0f7a832abe search_constant_strings /git/arm-soc/scripts/gcc-plugins/initify_plugin.c:1506 0x2b0f7a832abe search_var_param /git/arm-soc/scripts/gcc-plugins/initify_plugin.c:1419 0x2b0f7a832abe search_const_strs /git/arm-soc/scripts/gcc-plugins/initify_plugin.c:1471 0x2b0f7a832abe initify_function_transform /git/arm-soc/scripts/gcc-plugins/initify_plugin.c:1519 0x9b6c07 execute_one_ipa_transform_pass /home/arnd/git/gcc/gcc/passes.c:2207 0x9b6c07 execute_all_ipa_transforms() /home/arnd/git/gcc/gcc/passes.c:2249 0x734d6c cgraph_node::expand() /home/arnd/git/gcc/gcc/cgraphunit.c:2031 0x7362cc expand_all_functions /home/arnd/git/gcc/gcc/cgraphunit.c:2174 0x7362cc symbol_table::compile() /home/arnd/git/gcc/gcc/cgraphunit.c:2531 0x737d27 symbol_table::compile() /home/arnd/git/gcc/gcc/cgraphunit.c:2595 0x737d27 symbol_table::finalize_compilation_unit() /home/arnd/git/gcc/gcc/cgraphunit.c:2621 Please submit a full bug report, with preprocessed source if appropriate. This is the probably the same bug as the first, and I've worked around it incorrectly for now: Aside from these problems and the annotations I sent yesterday, the initify plugin doesn't cause any more build-time regressions for me, so I'm leaving it enabled. Arnd diff --git a/drivers/scsi/gdth.c b/drivers/scsi/gdth.c index d020a13646ae..37c9cf7a4e82 100644 --- a/drivers/scsi/gdth.c +++ b/drivers/scsi/gdth.c @@ -3846,6 +3846,8 @@ static const char *gdth_ctr_name(gdth_ha_str *ha) { TRACE2(("gdth_ctr_name()\n")); + return ""; + if (ha->type == GDT_EISA) { switch (ha->stype) { case GDT3_ID: b) *** WARNING *** there are active plugins, do not report this as a bug unless you can reproduce it without enabling any plugins. Event | Plugins PLUGIN_ATTRIBUTES | initify_plugin PLUGIN_START_UNIT | initify_plugin /git/arm-soc/arch/x86/kernel/traps.c:1049:1: internal compiler error: in set_section, at symtab.c:1514 } ^ 0x724dd6 symtab_node::set_section(char const*) /home/arnd/git/gcc/gcc/symtab.c:1514 0x2b26ed538c51 move_function_to_init_exit_text /git/arm-soc/scripts/gcc-plugins/initify_plugin.c:1751 0x2b26ed538c51 initify_execute /git/arm-soc/scripts/gcc-plugins/initify_plugin.c:1771 0x2b26ed538c51 execute /git/arm-soc/scripts/gcc-plugins/gcc-generate-ipa-pass.h:215 Please submit a full bug report, This one is different from the other two, and I don't know much about what happened, but this clearly bogus change avoids the problem: diff --git a/arch/x86/include/asm/desc.h b/arch/x86/include/asm/desc.h index d0a21b12dd58..3793900f7f73 100644 --- a/arch/x86/include/asm/desc.h +++ b/arch/x86/include/asm/desc.h @@ -508,7 +508,7 @@ static inline void alloc_system_vector(int vector) */ static inline void set_system_intr_gate(unsigned int n, void *addr) { - BUG_ON((unsigned)n > 0xFF); + //BUG_ON((unsigned)n > 0xFF); _set_gate(n, GATE_INTERRUPT, addr, 0x3, 0, __KERNEL_CS); }