Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1556072 > unrolled thread
| Started by | Emese Revfy <re.emese@gmail.com> |
|---|---|
| First post | 2017-01-11 01:30 +0100 |
| Last post | 2017-01-13 00:50 +0100 |
| Articles | 5 — 2 participants |
Back to article view | Back to linux.kernel
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: [PATCH v4 0/4] Introduce the initify gcc plugin Emese Revfy <re.emese@gmail.com> - 2017-01-11 01:30 +0100
Re: [PATCH v4 0/4] Introduce the initify gcc plugin Kees Cook <keescook@chromium.org> - 2017-01-11 02:10 +0100
Re: [PATCH v4 0/4] Introduce the initify gcc plugin Emese Revfy <re.emese@gmail.com> - 2017-01-12 22:50 +0100
Re: [PATCH v4 0/4] Introduce the initify gcc plugin Kees Cook <keescook@chromium.org> - 2017-01-13 00:30 +0100
Re: [PATCH v4 0/4] Introduce the initify gcc plugin Kees Cook <keescook@chromium.org> - 2017-01-13 00:50 +0100
| From | Emese Revfy <re.emese@gmail.com> |
|---|---|
| Date | 2017-01-11 01:30 +0100 |
| Subject | Re: [PATCH v4 0/4] Introduce the initify gcc plugin |
| Message-ID | <sYeXD-8ep-3@gated-at.bofh.it> |
On Tue, 3 Jan 2017 16:23:03 -0800 Kees Cook <keescook@chromium.org> wrote: > On Mon, Dec 19, 2016 at 3:10 AM, Emese Revfy <re.emese@gmail.com> wrote: > > On Fri, 16 Dec 2016 14:19:10 -0800 > > Kees Cook <keescook@chromium.org> wrote: > > > >> FWIW, it still seems to me that these aren't false positives: > >> > >> WARNING: vmlinux.o(.text.unlikely+0x1b1): Section mismatch in > >> reference from the function uncore_pci_exit.part.22() to the function > >> .init.text:uncore_free_pcibus_map() > >> The function uncore_pci_exit.part.22() references > >> the function __init uncore_free_pcibus_map(). > >> This is often because uncore_pci_exit.part.22 lacks a __init > >> annotation or the annotation of uncore_free_pcibus_map is wrong. Thanks for the report, you can find the fix here: https://github.com/ephox-gcc-plugins/initify/commit/5d93a54badd9751b79ef67ce8a8b4081fea37547 -- Emese
[toc] | [next] | [standalone]
| From | Kees Cook <keescook@chromium.org> |
|---|---|
| Date | 2017-01-11 02:10 +0100 |
| Message-ID | <sYfAm-fa-13@gated-at.bofh.it> |
| In reply to | #1556072 |
On Tue, Jan 10, 2017 at 4:24 PM, Emese Revfy <re.emese@gmail.com> wrote: > On Tue, 3 Jan 2017 16:23:03 -0800 > Kees Cook <keescook@chromium.org> wrote: > >> On Mon, Dec 19, 2016 at 3:10 AM, Emese Revfy <re.emese@gmail.com> wrote: >> > On Fri, 16 Dec 2016 14:19:10 -0800 >> > Kees Cook <keescook@chromium.org> wrote: >> > >> >> FWIW, it still seems to me that these aren't false positives: >> >> >> >> WARNING: vmlinux.o(.text.unlikely+0x1b1): Section mismatch in >> >> reference from the function uncore_pci_exit.part.22() to the function >> >> .init.text:uncore_free_pcibus_map() >> >> The function uncore_pci_exit.part.22() references >> >> the function __init uncore_free_pcibus_map(). >> >> This is often because uncore_pci_exit.part.22 lacks a __init >> >> annotation or the annotation of uncore_free_pcibus_map is wrong. > > Thanks for the report, you can find the fix here: > https://github.com/ephox-gcc-plugins/initify/commit/5d93a54badd9751b79ef67ce8a8b4081fea37547 Awesome! Thanks, that eliminated almost all of the warnings. I'm still seeing this: WARNING: vmlinux.o(.text+0x1087e7): Section mismatch in reference from the function rebind_subsystems() to the variable .init.rodata.str:__func__.4400 The function rebind_subsystems() references the variable __initconst __func__.4400. This is often because rebind_subsystems lacks a __initconst annotation or the annotation of __func__.4400 is wrong. WARNING: vmlinux.o(.text+0x13789d): Section mismatch in reference from the function register_ftrace_export() to the variable .init.rodata.str:__func__.4251 The function register_ftrace_export() references the variable __initconst __func__.4251. This is often because register_ftrace_export lacks a __initconst annotation or the annotation of __func__.4251 is wrong. WARNING: vmlinux.o(.text+0x139d24): Section mismatch in reference from the function tracepoint_printk_sysctl() to the variable .init.rodata.str:__func__.4251 The function tracepoint_printk_sysctl() references the variable __initconst __func__.4251. This is often because tracepoint_printk_sysctl lacks a __initconst annotation or the annotation of __func__.4251 is wrong. I haven't taken a close look yet, but I assume these are from the const strings in these functions? -Kees -- Kees Cook Nexus Security
[toc] | [prev] | [next] | [standalone]
| From | Emese Revfy <re.emese@gmail.com> |
|---|---|
| Date | 2017-01-12 22:50 +0100 |
| Message-ID | <sYVpT-DA-17@gated-at.bofh.it> |
| In reply to | #1556118 |
On Tue, 10 Jan 2017 17:09:31 -0800 Kees Cook <keescook@chromium.org> wrote: > WARNING: vmlinux.o(.text+0x1087e7): Section mismatch in reference from > the function rebind_subsystems() to the variable > .init.rodata.str:__func__.4400 > The function rebind_subsystems() references > the variable __initconst __func__.4400. > This is often because rebind_subsystems lacks a __initconst > annotation or the annotation of __func__.4400 is wrong. Thanks for the report, you can find the fix here: https://github.com/ephox-gcc-plugins/initify/commit/25f34834e3373e067133bc5d39d42c50a3592d56 -- Emese
[toc] | [prev] | [next] | [standalone]
| From | Kees Cook <keescook@chromium.org> |
|---|---|
| Date | 2017-01-13 00:30 +0100 |
| Message-ID | <sYWYF-1Hr-9@gated-at.bofh.it> |
| In reply to | #1557839 |
On Thu, Jan 12, 2017 at 1:41 PM, Emese Revfy <re.emese@gmail.com> wrote: > On Tue, 10 Jan 2017 17:09:31 -0800 > Kees Cook <keescook@chromium.org> wrote: > >> WARNING: vmlinux.o(.text+0x1087e7): Section mismatch in reference from >> the function rebind_subsystems() to the variable >> .init.rodata.str:__func__.4400 >> The function rebind_subsystems() references >> the variable __initconst __func__.4400. >> This is often because rebind_subsystems lacks a __initconst >> annotation or the annotation of __func__.4400 is wrong. > > Thanks for the report, you can find the fix here: > https://github.com/ephox-gcc-plugins/initify/commit/25f34834e3373e067133bc5d39d42c50a3592d56 Awesome! I can confirm, it builds without warnings now. Thanks! -Kees -- Kees Cook Nexus Security
[toc] | [prev] | [next] | [standalone]
| From | Kees Cook <keescook@chromium.org> |
|---|---|
| Date | 2017-01-13 00:50 +0100 |
| Message-ID | <sYXi1-1Pf-9@gated-at.bofh.it> |
| In reply to | #1557916 |
On Thu, Jan 12, 2017 at 3:27 PM, Kees Cook <keescook@chromium.org> wrote:
> On Thu, Jan 12, 2017 at 1:41 PM, Emese Revfy <re.emese@gmail.com> wrote:
>> On Tue, 10 Jan 2017 17:09:31 -0800
>> Kees Cook <keescook@chromium.org> wrote:
>>
>>> WARNING: vmlinux.o(.text+0x1087e7): Section mismatch in reference from
>>> the function rebind_subsystems() to the variable
>>> .init.rodata.str:__func__.4400
>>> The function rebind_subsystems() references
>>> the variable __initconst __func__.4400.
>>> This is often because rebind_subsystems lacks a __initconst
>>> annotation or the annotation of __func__.4400 is wrong.
>>
>> Thanks for the report, you can find the fix here:
>> https://github.com/ephox-gcc-plugins/initify/commit/25f34834e3373e067133bc5d39d42c50a3592d56
>
> Awesome! I can confirm, it builds without warnings now. Thanks!
Hm, actually, with an "allyesconfig" build, I'm still seeing warnings
(and possibly some nocapture verification failures).
Most look like this:
WARNING: drivers/clk/bcm/built-in.o(.text+0xec2): Section mismatch in
reference from the function clk_gate() to the variable
.init.rodata.str:__func__.29708
The function clk_gate() references
the variable __initconst __func__.29708.
This is often because clk_gate lacks a __initconst
annotation or the annotation of __func__.29708 is wrong.
And there's this (should KASAN be disabled for initify?)
mm/kasan/kasan.c: In function ‘memmove’:
mm/kasan/kasan.c:346:7: warning: ‘memmove’ captures its 2 (‘src’)
parameter, please remove it from the nocapture attribute.
void *memmove(void *dest, const void *src, size_t len)
^
mm/kasan/kasan.c: In function ‘memcpy’:
mm/kasan/kasan.c:355:7: warning: ‘memcpy’ captures its 2 (‘src’)
parameter, please remove it from the nocapture attribute.
void *memcpy(void *dest, const void *src, size_t len)
^
And ACPI:
drivers/acpi/acpica/utdebug.c: In function ‘acpi_debug_print’:
drivers/acpi/acpica/utdebug.c:158:1: warning: ‘acpi_debug_print’
captures its 3 (‘function_name’) parameter, please remove it from the
nocapture attribute.
acpi_debug_print(u32 requested_debug_level,
^
I used my initify v5 development tree, with the following patch, with
"make allyesconfig":
http://git.kernel.org/cgit/linux/kernel/git/kees/linux.git/log/?h=for-next/gcc-plugin/initify
diff --git a/arch/Kconfig b/arch/Kconfig
index b6009a21ebea..5693ef5f22c8 100644
--- a/arch/Kconfig
+++ b/arch/Kconfig
@@ -359,7 +359,6 @@ config HAVE_GCC_PLUGINS
menuconfig GCC_PLUGINS
bool "GCC plugins"
depends on HAVE_GCC_PLUGINS
- depends on !COMPILE_TEST
help
GCC plugins are loadable modules that provide extra features to the
compiler. They are useful for runtime instrumentation and
static analysis.
@@ -429,6 +428,7 @@ config GCC_PLUGIN_INITIFY
config GCC_PLUGIN_INITIFY_VERBOSE
bool "Report initification"
depends on GCC_PLUGIN_INITIFY
+ depends on !COMPILE_TEST
help
Print all initified strings and all functions which should be
__init/__exit.
I'll see if acpi needs __noverified_nocapture ...
-Kees
--
Kees Cook
Nexus Security
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web