Re: [PATCH v2 1/3] Add the initify gcc plugin

2016-07-13 Thread Emese Revfy
On Tue, 12 Jul 2016 18:38:47 -0400 Kees Cook wrote: > On Tue, Jul 12, 2016 at 6:08 PM, Russell King - ARM Linux > 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: [PATCH v2 1/3] Add the initify gcc plugin

2016-07-13 Thread Emese Revfy
On Tue, 12 Jul 2016 18:38:47 -0400 Kees Cook wrote: > On Tue, Jul 12, 2016 at 6:08 PM, Russell King - ARM Linux > 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 wrote: > > That sounds like a problem for architectures that

Re: [PATCH v2 1/3] Add the initify gcc plugin

2016-07-13 Thread Kees Cook
On Wed, Jul 13, 2016 at 1:48 PM, Emese Revfy wrote: > On Tue, 12 Jul 2016 15:45:56 -0400 > Kees Cook wrote: > >> On Mon, Jul 4, 2016 at 7:40 PM, Emese Revfy wrote: >> > If a function is called by __init and __exit functions as well

Re: [PATCH v2 1/3] Add the initify gcc plugin

2016-07-13 Thread Kees Cook
On Wed, Jul 13, 2016 at 1:48 PM, Emese Revfy wrote: > On Tue, 12 Jul 2016 15:45:56 -0400 > Kees Cook wrote: > >> On Mon, Jul 4, 2016 at 7:40 PM, Emese Revfy wrote: >> > If a function is called by __init and __exit functions as well then >> > the plugin moves it to the __exit section. This

Re: [PATCH v2 1/3] Add the initify gcc plugin

2016-07-13 Thread Emese Revfy
On Tue, 12 Jul 2016 15:45:56 -0400 Kees Cook wrote: > On Mon, Jul 4, 2016 at 7:40 PM, Emese Revfy 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 >

Re: [PATCH v2 1/3] Add the initify gcc plugin

2016-07-13 Thread Emese Revfy
On Tue, 12 Jul 2016 15:45:56 -0400 Kees Cook wrote: > On Mon, Jul 4, 2016 at 7:40 PM, Emese Revfy 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

Re: [PATCH v2 1/3] Add the initify gcc plugin

2016-07-13 Thread Emese Revfy
On Tue, 12 Jul 2016 16:05:45 -0400 Kees Cook wrote: > /* > * The initify gcc-plugin attempts to identify const arguments that are only > * used during init (see __init), so they can be moved to the .init.rodata > * section. If an argument is passed to a non-init

Re: [PATCH v2 1/3] Add the initify gcc plugin

2016-07-13 Thread Emese Revfy
On Tue, 12 Jul 2016 16:05:45 -0400 Kees Cook wrote: > /* > * The initify gcc-plugin attempts to identify const arguments that are only > * used during init (see __init), so they can be moved to the .init.rodata > * section. If an argument is passed to a non-init function, it must > *

Re: [PATCH v2 1/3] Add the initify gcc plugin

2016-07-12 Thread Kees Cook
On Tue, Jul 12, 2016 at 6:08 PM, Russell King - ARM Linux 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 wrote: >> > If a function is called by __init and __exit functions as well then

Re: [PATCH v2 1/3] Add the initify gcc plugin

2016-07-12 Thread Kees Cook
On Tue, Jul 12, 2016 at 6:08 PM, Russell King - ARM Linux 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 wrote: >> > If a function is called by __init and __exit functions as well then >> > the plugin moves it to the __exit

Re: [PATCH v2 1/3] Add the initify gcc plugin

2016-07-12 Thread Russell King - ARM Linux
On Tue, Jul 12, 2016 at 03:45:56PM -0400, Kees Cook wrote: > On Mon, Jul 4, 2016 at 7:40 PM, Emese Revfy 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

Re: [PATCH v2 1/3] Add the initify gcc plugin

2016-07-12 Thread Russell King - ARM Linux
On Tue, Jul 12, 2016 at 03:45:56PM -0400, Kees Cook wrote: > On Mon, Jul 4, 2016 at 7:40 PM, Emese Revfy 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

Re: [PATCH v2 1/3] Add the initify gcc plugin

2016-07-12 Thread Kees Cook
On Tue, Jul 12, 2016 at 4:07 PM, Emese Revfy wrote: > On Tue, 12 Jul 2016 15:45:56 -0400 > Kees Cook wrote: > >> On Mon, Jul 4, 2016 at 7:40 PM, Emese Revfy wrote: >> Thanks for sending this! I'll get it added to my tree for some

Re: [PATCH v2 1/3] Add the initify gcc plugin

2016-07-12 Thread Kees Cook
On Tue, Jul 12, 2016 at 4:07 PM, Emese Revfy wrote: > On Tue, 12 Jul 2016 15:45:56 -0400 > Kees Cook wrote: > >> On Mon, Jul 4, 2016 at 7:40 PM, Emese Revfy wrote: >> Thanks for sending this! I'll get it added to my tree for some 0day >> build testing, and then get it into my -next tree. > >

Re: [PATCH v2 1/3] Add the initify gcc plugin

2016-07-12 Thread Emese Revfy
On Tue, 12 Jul 2016 15:45:56 -0400 Kees Cook wrote: > On Mon, Jul 4, 2016 at 7:40 PM, Emese Revfy wrote: > Thanks for sending this! I'll get it added to my tree for some 0day > build testing, and then get it into my -next tree. I'll send a new patch

Re: [PATCH v2 1/3] Add the initify gcc plugin

2016-07-12 Thread Emese Revfy
On Tue, 12 Jul 2016 15:45:56 -0400 Kees Cook wrote: > On Mon, Jul 4, 2016 at 7:40 PM, Emese Revfy wrote: > Thanks for sending this! I'll get it added to my tree for some 0day > build testing, and then get it into my -next tree. I'll send a new patch set soon. I'm working on some fixes and I

Re: [PATCH v2 1/3] Add the initify gcc plugin

2016-07-12 Thread Kees Cook
On Mon, Jul 4, 2016 at 7:40 PM, Emese Revfy wrote: > 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

Re: [PATCH v2 1/3] Add the initify gcc plugin

2016-07-12 Thread Kees Cook
On Mon, Jul 4, 2016 at 7:40 PM, Emese Revfy wrote: > 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. > It

[PATCH v2 1/3] Add the initify gcc plugin

2016-07-04 Thread Emese Revfy
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. It has two passes. The first one tries to find all functions that

[PATCH v2 1/3] Add the initify gcc plugin

2016-07-04 Thread Emese Revfy
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. It has two passes. The first one tries to find all functions that