All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rasmus Villemoes <linux@rasmusvillemoes.dk>
To: Kees Cook <keescook@chromium.org>
Cc: Andrew Donnellan <andrew.donnellan@au1.ibm.com>,
	LKML <linux-kernel@vger.kernel.org>,
	Emese Revfy <re.emese@gmail.com>, Arnd Bergmann <arnd@arndb.de>,
	Josh Triplett <josh@joshtriplett.org>,
	PaX Team <pageexec@freemail.hu>,
	Masahiro Yamada <yamada.masahiro@socionext.com>,
	minipli@ld-linux.so, Russell King <linux@armlinux.org.uk>,
	Catalin Marinas <catalin.marinas@arm.com>,
	David Brown <david.brown@linaro.org>,
	"benh\@kernel.crashing.org" <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" 
	<kernel-hardening@lists.openwall.com>
Subject: Re: [PATCH v5 1/4] gcc-plugins: Add the initify gcc plugin
Date: Mon, 27 Mar 2017 21:31:02 +0200	[thread overview]
Message-ID: <87inmujz49.fsf@rasmusvillemoes.dk> (raw)
In-Reply-To: <CAGXu5j+cd8iXAVko_fOFkPLD2Q=1=S0jvCYGAhKjnTunJ=86Zg@mail.gmail.com> (Kees Cook's message of "Mon, 27 Mar 2017 09:14:36 -0700")

On Mon, Mar 27 2017, Kees Cook <keescook@chromium.org> wrote:

> On Mon, Mar 27, 2017 at 12:38 AM, Andrew Donnellan
> <andrew.donnellan@au1.ibm.com> wrote:
>> On 01/02/17 07:24, Kees Cook wrote:
>>>
>>> From: Emese Revfy <re.emese@gmail.com>
>>>
>>> The kernel already has a mechanism to free up code and data memory that
>>> is only used during kernel or module initialization.  This plugin will
>>> teach the compiler to find more such code and data that can be freed
>>> after initialization.
>>
>>
>> Currently checking whether we can wire this up for powerpc without too many
>> problems...
>
> Cool, thanks. FWIW, note that this plugin is a bit back-burnered at
> the moment. I've got this in my -next tree still, but it needs some
> rather large changes to how it does its annotations before Linus will
> accept it.

Why not just hardcode the annotations in the plugin itself? I'd expect
just making it know about mem*, str*, and the various *printf/printk
functions would get 90% of the benefits. The prototypes of these 
aren't gonna change anytime soon, so there's no compelling reason to
keep the annotations with the declarations. The plugin can still do
its sanity checking when it compiles a function with one of these names.

Rasmus

WARNING: multiple messages have this Message-ID (diff)
From: Rasmus Villemoes <linux@rasmusvillemoes.dk>
To: Kees Cook <keescook@chromium.org>
Cc: Andrew Donnellan <andrew.donnellan@au1.ibm.com>,
	LKML <linux-kernel@vger.kernel.org>,
	Emese Revfy <re.emese@gmail.com>, Arnd Bergmann <arnd@arndb.de>,
	Josh Triplett <josh@joshtriplett.org>,
	PaX Team <pageexec@freemail.hu>,
	Masahiro Yamada <yamada.masahiro@socionext.com>,
	minipli@ld-linux.so, Russell King <linux@armlinux.org.uk>,
	Catalin Marinas <catalin.marinas@arm.com>,
	David Brown <david.brown@linaro.org>,
	"benh@kernel.crashing.org" <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"
	<kernel-hardening@lists.openwall.com>
Subject: [kernel-hardening] Re: [PATCH v5 1/4] gcc-plugins: Add the initify gcc plugin
Date: Mon, 27 Mar 2017 21:31:02 +0200	[thread overview]
Message-ID: <87inmujz49.fsf@rasmusvillemoes.dk> (raw)
In-Reply-To: <CAGXu5j+cd8iXAVko_fOFkPLD2Q=1=S0jvCYGAhKjnTunJ=86Zg@mail.gmail.com> (Kees Cook's message of "Mon, 27 Mar 2017 09:14:36 -0700")

On Mon, Mar 27 2017, Kees Cook <keescook@chromium.org> wrote:

> On Mon, Mar 27, 2017 at 12:38 AM, Andrew Donnellan
> <andrew.donnellan@au1.ibm.com> wrote:
>> On 01/02/17 07:24, Kees Cook wrote:
>>>
>>> From: Emese Revfy <re.emese@gmail.com>
>>>
>>> The kernel already has a mechanism to free up code and data memory that
>>> is only used during kernel or module initialization.  This plugin will
>>> teach the compiler to find more such code and data that can be freed
>>> after initialization.
>>
>>
>> Currently checking whether we can wire this up for powerpc without too many
>> problems...
>
> Cool, thanks. FWIW, note that this plugin is a bit back-burnered at
> the moment. I've got this in my -next tree still, but it needs some
> rather large changes to how it does its annotations before Linus will
> accept it.

Why not just hardcode the annotations in the plugin itself? I'd expect
just making it know about mem*, str*, and the various *printf/printk
functions would get 90% of the benefits. The prototypes of these 
aren't gonna change anytime soon, so there's no compelling reason to
keep the annotations with the declarations. The plugin can still do
its sanity checking when it compiles a function with one of these names.

Rasmus

  reply	other threads:[~2017-03-27 19:39 UTC|newest]

Thread overview: 32+ 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 ` [kernel-hardening] " Kees Cook
2017-01-31 20:24 ` [PATCH v5 1/4] gcc-plugins: Add " Kees Cook
2017-01-31 20:24   ` [kernel-hardening] " Kees Cook
2017-03-27  7:38   ` Andrew Donnellan
2017-03-27 16:14     ` Kees Cook
2017-03-27 16:14       ` Kees Cook
2017-03-27 19:31       ` Rasmus Villemoes [this message]
2017-03-27 19:31         ` [kernel-hardening] " Rasmus Villemoes
2017-03-27 19:33         ` Kees Cook
2017-03-27 19:33           ` [kernel-hardening] " Kees Cook
2017-03-28  7:49       ` [kernel-hardening] " Arnd Bergmann
2017-03-28  7:49         ` Arnd Bergmann
2017-03-28 19:03         ` Kees Cook
2017-03-28 19:03           ` Kees Cook
2017-03-28 20:31           ` Arnd Bergmann
2017-03-28 20:31             ` Arnd Bergmann
2017-03-28  3:03     ` Andrew Donnellan
2017-03-28 19:00       ` Kees Cook
2017-03-28 19:00         ` Kees Cook
2017-03-29  8:32   ` Arnd Bergmann
2017-03-29  8:32     ` [kernel-hardening] " Arnd Bergmann
2017-03-29  8:56     ` Arnd Bergmann
2017-03-29  8:56       ` [kernel-hardening] " Arnd Bergmann
2017-03-30 11:04       ` Arnd Bergmann
2017-03-30 11:04         ` [kernel-hardening] " Arnd Bergmann
2017-01-31 20:24 ` [PATCH v5 2/4] util: Move type casts into is_kernel_rodata Kees Cook
2017-01-31 20:24   ` [kernel-hardening] " 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   ` [kernel-hardening] " Kees Cook
2017-01-31 20:24 ` [PATCH v5 4/4] initify: Mark functions with the __unverified_nocapture attribute Kees Cook
2017-01-31 20:24   ` [kernel-hardening] " 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=87inmujz49.fsf@rasmusvillemoes.dk \
    --to=linux@rasmusvillemoes.dk \
    --cc=akpm@linux-foundation.org \
    --cc=andrew.donnellan@au1.ibm.com \
    --cc=arnd@arndb.de \
    --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=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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.