linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: Kees Cook <keescook@chromium.org>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Emese Revfy <re.emese@gmail.com>,
	Josh Triplett <josh@joshtriplett.org>,
	PaX Team <pageexec@freemail.hu>,
	Masahiro Yamada <yamada.masahiro@socionext.com>,
	minipli@ld-linux.so,
	Russell King - ARM Linux <linux@armlinux.org.uk>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Rasmus Villemoes <linux@rasmusvillemoes.dk>,
	David Brown <david.brown@linaro.org>,
	Benjamin Herrenschmidt <benh@kernel.crashing.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Andrew Morton <akpm@linux-foundation.org>,
	Jeff Layton <jlayton@poochiereds.net>,
	Sam Ravnborg <sam@ravnborg.org>,
	kernel-hardening@lists.openwall.com
Subject: Re: [PATCH v5 1/4] gcc-plugins: Add the initify gcc plugin
Date: Thu, 30 Mar 2017 13:04:40 +0200	[thread overview]
Message-ID: <CAK8P3a3eWLcCDP-QUhan8+jRnGgfmCqKcQRVxHoRiyLke55uiw@mail.gmail.com> (raw)
In-Reply-To: <CAK8P3a24SAf18a5308qQVM0ZvqT+CycSS9CFJAUowvr1zKRteQ@mail.gmail.com>

On Wed, Mar 29, 2017 at 10:56 AM, Arnd Bergmann <arnd@arndb.de> 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 <arnd@arndb.de>
> 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:

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);
 }


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

  reply	other threads:[~2017-03-30 11:04 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-31 20:24 [PATCH v5 0/4] Introduce the initify gcc plugin Kees Cook
2017-01-31 20:24 ` [PATCH v5 1/4] gcc-plugins: Add " Kees Cook
2017-03-27  7:38   ` [kernel-hardening] " Andrew Donnellan
2017-03-27 16:14     ` Kees Cook
2017-03-27 19:31       ` Rasmus Villemoes
2017-03-27 19:33         ` Kees Cook
2017-03-28  7:49       ` [kernel-hardening] " Arnd Bergmann
2017-03-28 19:03         ` Kees Cook
2017-03-28 20:31           ` Arnd Bergmann
2017-03-28  3:03     ` Andrew Donnellan
2017-03-28 19:00       ` Kees Cook
2017-03-29  8:32   ` Arnd Bergmann
2017-03-29  8:56     ` Arnd Bergmann
2017-03-30 11:04       ` Arnd Bergmann [this message]
2017-01-31 20:24 ` [PATCH v5 2/4] util: Move type casts into is_kernel_rodata Kees Cook
2017-01-31 20:24 ` [PATCH v5 3/4] initify: Mark functions with the __nocapture attribute Kees Cook
2017-01-31 20:24 ` [PATCH v5 4/4] initify: Mark functions with the __unverified_nocapture attribute Kees Cook

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAK8P3a3eWLcCDP-QUhan8+jRnGgfmCqKcQRVxHoRiyLke55uiw@mail.gmail.com \
    --to=arnd@arndb.de \
    --cc=akpm@linux-foundation.org \
    --cc=benh@kernel.crashing.org \
    --cc=catalin.marinas@arm.com \
    --cc=david.brown@linaro.org \
    --cc=jlayton@poochiereds.net \
    --cc=josh@joshtriplett.org \
    --cc=keescook@chromium.org \
    --cc=kernel-hardening@lists.openwall.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=linux@rasmusvillemoes.dk \
    --cc=minipli@ld-linux.so \
    --cc=pageexec@freemail.hu \
    --cc=re.emese@gmail.com \
    --cc=sam@ravnborg.org \
    --cc=tglx@linutronix.de \
    --cc=yamada.masahiro@socionext.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).