|
Message-ID: <CAGXu5j+99nc9s-ci46s3r_CU5-6O6JeHERcW3mYRtnP71871rw@mail.gmail.com> Date: Tue, 12 Jul 2016 18:38:47 -0400 From: Kees Cook <keescook@...omium.org> To: Russell King - ARM Linux <linux@...linux.org.uk> Cc: Emese Revfy <re.emese@...il.com>, "kernel-hardening@...ts.openwall.com" <kernel-hardening@...ts.openwall.com>, PaX Team <pageexec@...email.hu>, Brad Spengler <spender@...ecurity.net>, Michal Marek <mmarek@...e.com>, LKML <linux-kernel@...r.kernel.org>, Masahiro Yamada <yamada.masahiro@...ionext.com>, linux-kbuild <linux-kbuild@...r.kernel.org>, minipli@...linux.so, Catalin Marinas <catalin.marinas@....com>, Rasmus Villemoes <linux@...musvillemoes.dk>, David Brown <david.brown@...aro.org>, "benh@...nel.crashing.org" <benh@...nel.crashing.org>, Thomas Gleixner <tglx@...utronix.de>, Andrew Morton <akpm@...ux-foundation.org>, Jeff Layton <jlayton@...chiereds.net>, Arnd Bergmann <arnd@...db.de>, Sam Ravnborg <sam@...nborg.org>, Karsten Keil <isdn@...ux-pingi.de> Subject: Re: [PATCH v2 1/3] Add the initify gcc plugin On Tue, Jul 12, 2016 at 6:08 PM, Russell King - ARM Linux <linux@...linux.org.uk> wrote: > On Tue, Jul 12, 2016 at 03:45:56PM -0400, Kees Cook wrote: >> On Mon, Jul 4, 2016 at 7:40 PM, Emese Revfy <re.emese@...il.com> wrote: >> > If a function is called by __init and __exit functions as well then >> > the plugin moves it to the __exit section. This causes false positive >> > section mismatch errors/warnings that I don't know how to handle yet. >> >> Should the mismatch checker be updated to recognize this case? Without >> the plugin, I assume these kinds of functions would only ever be >> marked for __exit? If so, should the plugin strip the __init marking >> and only add __exit? > > That sounds like a problem for architectures that still discard the > __exit section at link time to reduce the size of the linked kernel > image - though, obviously, if using the plugin results in a smaller > kernel image _with_ the exit sections, then there's a net benefit > size-wise. Ah right, __exit is dropped for non-modular builds. So, for "both __init and __exit" it sounds like the behavior depends on the build: - if modular: remove __init marking (since we need it after init) - if non-modular: remove __exit marking (since we'll never call exit) Is this something the build itself (rather than the plugin) could notice and fix up? Hmmm -Kees -- Kees Cook Chrome OS & Brillo Security
Powered by blists - more mailing lists
Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.