Re: [kernel-hardening] [PATCH v1 0/2] Introduce the initify gcc plugin

2016-06-29 Thread Emese Revfy
On Wed, 29 Jun 2016 18:52:27 +0100 Mark Rutland wrote: > On Wed, Jun 29, 2016 at 09:21:37AM +0100, Mark Rutland wrote: > > On Tue, Jun 28, 2016 at 01:46:04PM -0700, Kees Cook wrote: > > > On Tue, Jun 28, 2016 at 9:14 AM, Emese Revfy wrote: > > > > On

Re: [kernel-hardening] [PATCH v1 0/2] Introduce the initify gcc plugin

2016-06-29 Thread Emese Revfy
On Wed, 29 Jun 2016 18:52:27 +0100 Mark Rutland wrote: > On Wed, Jun 29, 2016 at 09:21:37AM +0100, Mark Rutland wrote: > > On Tue, Jun 28, 2016 at 01:46:04PM -0700, Kees Cook wrote: > > > On Tue, Jun 28, 2016 at 9:14 AM, Emese Revfy wrote: > > > > On Tue, 28 Jun 2016 13:57:49 +0100 > > > > Mark

Re: [kernel-hardening] [PATCH v1 0/2] Introduce the initify gcc plugin

2016-06-29 Thread Mark Rutland
On Wed, Jun 29, 2016 at 09:21:37AM +0100, Mark Rutland wrote: > On Tue, Jun 28, 2016 at 01:46:04PM -0700, Kees Cook wrote: > > On Tue, Jun 28, 2016 at 9:14 AM, Emese Revfy wrote: > > > On Tue, 28 Jun 2016 13:57:49 +0100 > > > Mark Rutland wrote: > > > >

Re: [kernel-hardening] [PATCH v1 0/2] Introduce the initify gcc plugin

2016-06-29 Thread Mark Rutland
On Wed, Jun 29, 2016 at 09:21:37AM +0100, Mark Rutland wrote: > On Tue, Jun 28, 2016 at 01:46:04PM -0700, Kees Cook wrote: > > On Tue, Jun 28, 2016 at 9:14 AM, Emese Revfy wrote: > > > On Tue, 28 Jun 2016 13:57:49 +0100 > > > Mark Rutland wrote: > > > > > >> On Tue, Jun 28, 2016 at 01:34:07PM

Re: [kernel-hardening] [PATCH v1 0/2] Introduce the initify gcc plugin

2016-06-29 Thread Mark Rutland
On Tue, Jun 28, 2016 at 01:46:04PM -0700, Kees Cook wrote: > On Tue, Jun 28, 2016 at 9:14 AM, Emese Revfy wrote: > > On Tue, 28 Jun 2016 13:57:49 +0100 > > Mark Rutland wrote: > > > >> On Tue, Jun 28, 2016 at 01:34:07PM +0200, Emese Revfy wrote: > >> >

Re: [kernel-hardening] [PATCH v1 0/2] Introduce the initify gcc plugin

2016-06-29 Thread Mark Rutland
On Tue, Jun 28, 2016 at 01:46:04PM -0700, Kees Cook wrote: > On Tue, Jun 28, 2016 at 9:14 AM, Emese Revfy wrote: > > On Tue, 28 Jun 2016 13:57:49 +0100 > > Mark Rutland wrote: > > > >> On Tue, Jun 28, 2016 at 01:34:07PM +0200, Emese Revfy wrote: > >> > This patch set is based on the "Add support

Re: [kernel-hardening] Re: [PATCH v1 0/2] Introduce the initify gcc plugin

2016-06-28 Thread Joe Perches
On Tue, 2016-06-28 at 18:07 -0400, valdis.kletni...@vt.edu wrote: > On Tue, 28 Jun 2016 14:49:15 -0700, Joe Perches said: > > > > > Another potentially useful plugin, especially for embedded systems, > > would be to compress any string literal marked with > > > >  

Re: [kernel-hardening] Re: [PATCH v1 0/2] Introduce the initify gcc plugin

2016-06-28 Thread Joe Perches
On Tue, 2016-06-28 at 18:07 -0400, valdis.kletni...@vt.edu wrote: > On Tue, 28 Jun 2016 14:49:15 -0700, Joe Perches said: > > > > > Another potentially useful plugin, especially for embedded systems, > > would be to compress any string literal marked with > > > >  

Re: [kernel-hardening] Re: [PATCH v1 0/2] Introduce the initify gcc plugin

2016-06-28 Thread Valdis . Kletnieks
On Tue, 28 Jun 2016 14:49:15 -0700, Joe Perches said: > Another potentially useful plugin, especially for embedded systems, > would be to compress any string literal marked with > >  __attribute__((format(printf, string-index,))) > > and decompress the compressed format on the stack in

Re: [kernel-hardening] Re: [PATCH v1 0/2] Introduce the initify gcc plugin

2016-06-28 Thread Valdis . Kletnieks
On Tue, 28 Jun 2016 14:49:15 -0700, Joe Perches said: > Another potentially useful plugin, especially for embedded systems, > would be to compress any string literal marked with > >  __attribute__((format(printf, string-index,))) > > and decompress the compressed format on the stack in

Re: [PATCH v1 0/2] Introduce the initify gcc plugin

2016-06-28 Thread Joe Perches
On Tue, 2016-06-28 at 13:34 +0200, Emese Revfy wrote: > I would like to introduce the initify gcc plugin. 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

Re: [PATCH v1 0/2] Introduce the initify gcc plugin

2016-06-28 Thread Joe Perches
On Tue, 2016-06-28 at 13:34 +0200, Emese Revfy wrote: > I would like to introduce the initify gcc plugin. 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

Re: [kernel-hardening] [PATCH v1 0/2] Introduce the initify gcc plugin

2016-06-28 Thread Kees Cook
On Tue, Jun 28, 2016 at 9:14 AM, Emese Revfy wrote: > On Tue, 28 Jun 2016 13:57:49 +0100 > Mark Rutland wrote: > >> On Tue, Jun 28, 2016 at 01:34:07PM +0200, Emese Revfy wrote: >> > This patch set is based on the "Add support for complex gcc plugins that

Re: [kernel-hardening] [PATCH v1 0/2] Introduce the initify gcc plugin

2016-06-28 Thread Kees Cook
On Tue, Jun 28, 2016 at 9:14 AM, Emese Revfy wrote: > On Tue, 28 Jun 2016 13:57:49 +0100 > Mark Rutland wrote: > >> On Tue, Jun 28, 2016 at 01:34:07PM +0200, Emese Revfy wrote: >> > This patch set is based on the "Add support for complex gcc plugins that >> > don't fit in a single file" patch

Re: [PATCH v1 0/2] Introduce the initify gcc plugin

2016-06-28 Thread Emese Revfy
On Tue, 28 Jun 2016 21:02:54 +0200 Rasmus Villemoes wrote: > It'll get placed in multiple sections by the compiler, and nothing bad > happens. String deduplication is something the linker does to sections > equipped with appropriate flags. So in this case that of course

Re: [PATCH v1 0/2] Introduce the initify gcc plugin

2016-06-28 Thread Emese Revfy
On Tue, 28 Jun 2016 21:02:54 +0200 Rasmus Villemoes wrote: > It'll get placed in multiple sections by the compiler, and nothing bad > happens. String deduplication is something the linker does to sections > equipped with appropriate flags. So in this case that of course means Note that I didn't

Re: [PATCH v1 0/2] Introduce the initify gcc plugin

2016-06-28 Thread Emese Revfy
On Tue, 28 Jun 2016 19:00:22 +0200 Mathias Krause wrote: > > section vanilla vanilla + initifychange > > --- > > .rodata 39059688 (0x25400e8)38527210 (0x24be0ea)

Re: [PATCH v1 0/2] Introduce the initify gcc plugin

2016-06-28 Thread Emese Revfy
On Tue, 28 Jun 2016 19:00:22 +0200 Mathias Krause wrote: > > section vanilla vanilla + initifychange > > --- > > .rodata 39059688 (0x25400e8)38527210 (0x24be0ea)-532478 > > .data

Re: [PATCH v1 0/2] Introduce the initify gcc plugin

2016-06-28 Thread Rasmus Villemoes
On Tue, Jun 28 2016, Joe Perches wrote: >> What happens to string deduplication when one string >> is in an init function and the same string is also used >> in a non-init function in the same compilation unit? >> >> foo.c >> >> __init void initfunc(void) >> { >>

Re: [PATCH v1 0/2] Introduce the initify gcc plugin

2016-06-28 Thread Rasmus Villemoes
On Tue, Jun 28 2016, Joe Perches wrote: >> What happens to string deduplication when one string >> is in an init function and the same string is also used >> in a non-init function in the same compilation unit? >> >> foo.c >> >> __init void initfunc(void) >> { >> pr_info("%s: I'm here\n",

Re: [PATCH v1 0/2] Introduce the initify gcc plugin

2016-06-28 Thread Joe Perches
On Tue, 2016-06-28 at 09:35 -0700, Joe Perches wrote: > (adding Mathias Krause who did something similar via macros in 2014) > > https://lkml.org/lkml/2014/6/22/149 > > On Tue, 2016-06-28 at 13:34 +0200, Emese Revfy wrote: > > > > I would like to introduce the initify gcc plugin. The kernel

Re: [PATCH v1 0/2] Introduce the initify gcc plugin

2016-06-28 Thread Joe Perches
On Tue, 2016-06-28 at 09:35 -0700, Joe Perches wrote: > (adding Mathias Krause who did something similar via macros in 2014) > > https://lkml.org/lkml/2014/6/22/149 > > On Tue, 2016-06-28 at 13:34 +0200, Emese Revfy wrote: > > > > I would like to introduce the initify gcc plugin. The kernel

Re: [PATCH v1 0/2] Introduce the initify gcc plugin

2016-06-28 Thread Mathias Krause
Hi Emese, On Tue, Jun 28, 2016 at 01:34:07PM +0200, Emese Revfy wrote: > I would like to introduce the initify gcc plugin. 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

Re: [PATCH v1 0/2] Introduce the initify gcc plugin

2016-06-28 Thread Mathias Krause
Hi Emese, On Tue, Jun 28, 2016 at 01:34:07PM +0200, Emese Revfy wrote: > I would like to introduce the initify gcc plugin. 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

Re: [PATCH v1 0/2] Introduce the initify gcc plugin

2016-06-28 Thread Joe Perches
(adding Mathias Krause who did something similar via macros in 2014) https://lkml.org/lkml/2014/6/22/149 On Tue, 2016-06-28 at 13:34 +0200, Emese Revfy wrote: > I would like to introduce the initify gcc plugin. The kernel already has > a mechanism to free up code and data memory that is only

Re: [PATCH v1 0/2] Introduce the initify gcc plugin

2016-06-28 Thread Joe Perches
(adding Mathias Krause who did something similar via macros in 2014) https://lkml.org/lkml/2014/6/22/149 On Tue, 2016-06-28 at 13:34 +0200, Emese Revfy wrote: > I would like to introduce the initify gcc plugin. The kernel already has > a mechanism to free up code and data memory that is only

Re: [kernel-hardening] [PATCH v1 0/2] Introduce the initify gcc plugin

2016-06-28 Thread Emese Revfy
On Tue, 28 Jun 2016 13:57:49 +0100 Mark Rutland wrote: > On Tue, Jun 28, 2016 at 01:34:07PM +0200, Emese Revfy wrote: > > This patch set is based on the "Add support for complex gcc plugins that > > don't fit in a single file" patch set (git/kees/linux.git#kspp HEAD: > >

Re: [kernel-hardening] [PATCH v1 0/2] Introduce the initify gcc plugin

2016-06-28 Thread Emese Revfy
On Tue, 28 Jun 2016 13:57:49 +0100 Mark Rutland wrote: > On Tue, Jun 28, 2016 at 01:34:07PM +0200, Emese Revfy wrote: > > This patch set is based on the "Add support for complex gcc plugins that > > don't fit in a single file" patch set (git/kees/linux.git#kspp HEAD: > > e5d4798b284cd192c8b). >

Re: [kernel-hardening] [PATCH v1 0/2] Introduce the initify gcc plugin

2016-06-28 Thread Mark Rutland
On Tue, Jun 28, 2016 at 01:34:07PM +0200, Emese Revfy wrote: > I would like to introduce the initify gcc plugin. 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

Re: [kernel-hardening] [PATCH v1 0/2] Introduce the initify gcc plugin

2016-06-28 Thread Mark Rutland
On Tue, Jun 28, 2016 at 01:34:07PM +0200, Emese Revfy wrote: > I would like to introduce the initify gcc plugin. 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

Re: [PATCH v1 0/2] Introduce the initify gcc plugin

2016-06-28 Thread Emese Revfy
On Tue, 28 Jun 2016 13:34:07 +0200 Emese Revfy wrote: > * automatically discover init/exit functions and apply the __init or >__exit attributes on them Hi, I have a question about this. If a function is called by __init and __exit functions as well then I move it to

Re: [PATCH v1 0/2] Introduce the initify gcc plugin

2016-06-28 Thread Emese Revfy
On Tue, 28 Jun 2016 13:34:07 +0200 Emese Revfy wrote: > * automatically discover init/exit functions and apply the __init or >__exit attributes on them Hi, I have a question about this. If a function is called by __init and __exit functions as well then I move it to the __exit section. I

[PATCH v1 0/2] Introduce the initify gcc plugin

2016-06-28 Thread Emese Revfy
I would like to introduce the initify gcc plugin. 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 reduces

[PATCH v1 0/2] Introduce the initify gcc plugin

2016-06-28 Thread Emese Revfy
I would like to introduce the initify gcc plugin. 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 reduces