Re: [PATCH v1 2/2] Mark functions with the __nocapture attribute

2016-07-01 Thread Emese Revfy
On Wed, 29 Jun 2016 17:12:45 -0700 Joe Perches wrote: > On Wed, 2016-06-29 at 20:42 +0200, Emese Revfy wrote: > > On Tue, 28 Jun 2016 14:00:57 -0700 Joe Perches wrote: > > > On Tue, 2016-06-28 at 22:40 +0200, Emese Revfy wrote: > > > > On Tue, 28 Jun 2016 09:43:31 -0700 Joe Perches wrote: > > >

Re: [PATCH v1 2/2] Mark functions with the __nocapture attribute

2016-06-29 Thread Joe Perches
On Wed, 2016-06-29 at 20:42 +0200, Emese Revfy wrote: > On Tue, 28 Jun 2016 14:00:57 -0700 Joe Perches wrote: > > On Tue, 2016-06-28 at 22:40 +0200, Emese Revfy wrote: > > > On Tue, 28 Jun 2016 09:43:31 -0700 Joe Perches wrote: > > > > On Tue, 2016-06-28 at 13:36 +0200, Emese Revfy wrote: > > > >

Re: [PATCH v1 2/2] Mark functions with the __nocapture attribute

2016-06-29 Thread Emese Revfy
On Tue, 28 Jun 2016 14:00:57 -0700 Joe Perches wrote: > On Tue, 2016-06-28 at 22:40 +0200, Emese Revfy wrote: > > On Tue, 28 Jun 2016 09:43:31 -0700 Joe Perches wrote: > > > On Tue, 2016-06-28 at 13:36 +0200, Emese Revfy wrote: > > > > The nocapture gcc attribute can be on functions only. > > >

Re: [PATCH v1 2/2] Mark functions with the __nocapture attribute

2016-06-29 Thread Emese Revfy
On Tue, 28 Jun 2016 22:50:55 +0200 Rasmus Villemoes wrote: > On Tue, Jun 28 2016, Emese Revfy wrote: > > diff --git a/include/asm-generic/bug.h b/include/asm-generic/bug.h > > index 6f96247..4cdf266 100644 > > --- a/include/asm-generic/bug.h > > +++ b/include/asm-generic/bug.h > > @@ -62,13 +62

Re: [PATCH v1 2/2] Mark functions with the __nocapture attribute

2016-06-28 Thread Rasmus Villemoes
On Tue, Jun 28 2016, "PaX Team" wrote: > On 28 Jun 2016 at 22:50, Rasmus Villemoes wrote: > >> > +extern const char *kstrdup_const(const char *s, gfp_t gfp) __nocapture(1); >> >> OK, so this one is pretty dangerous, and probably wrong. If one does >> >> foo->bar = kstrdup_const(a-macro-that-m

Re: [PATCH v1 2/2] Mark functions with the __nocapture attribute

2016-06-28 Thread PaX Team
On 28 Jun 2016 at 22:50, Rasmus Villemoes wrote: > > +extern const char *kstrdup_const(const char *s, gfp_t gfp) __nocapture(1); > > OK, so this one is pretty dangerous, and probably wrong. If one does > > foo->bar = kstrdup_const(a-macro-that-might-be-a-string-literal) > > in an .init functi

Re: [PATCH v1 2/2] Mark functions with the __nocapture attribute

2016-06-28 Thread Joe Perches
On Tue, 2016-06-28 at 22:40 +0200, Emese Revfy wrote: > On Tue, 28 Jun 2016 09:43:31 -0700 Joe Perches wrote: > > On Tue, 2016-06-28 at 13:36 +0200, Emese Revfy wrote: > > > The nocapture gcc attribute can be on functions only. > > > The attribute takes one or more unsigned integer constants as pa

Re: [PATCH v1 2/2] Mark functions with the __nocapture attribute

2016-06-28 Thread Rasmus Villemoes
On Tue, Jun 28 2016, Emese Revfy wrote: > The nocapture gcc attribute can be on functions only. > The attribute takes one or more unsigned integer constants as parameters > that specify the function argument(s) of const char* type to initify. > If the marked argument is a vararg then the plugin i

Re: [PATCH v1 2/2] Mark functions with the __nocapture attribute

2016-06-28 Thread Emese Revfy
On Tue, 28 Jun 2016 09:43:31 -0700 Joe Perches wrote: > On Tue, 2016-06-28 at 13:36 +0200, Emese Revfy wrote: > > The nocapture gcc attribute can be on functions only. > > The attribute takes one or more unsigned integer constants as parameters > > that specify the function argument(s) of const c

Re: [PATCH v1 2/2] Mark functions with the __nocapture attribute

2016-06-28 Thread Joe Perches
On Tue, 2016-06-28 at 13:36 +0200, Emese Revfy wrote: > The nocapture gcc attribute can be on functions only. > The attribute takes one or more unsigned integer constants as parameters > that specify the function argument(s) of const char* type to initify. Perhaps this should be const * > diff --g

[PATCH v1 2/2] Mark functions with the __nocapture attribute

2016-06-28 Thread Emese Revfy
The nocapture gcc attribute can be on functions only. The attribute takes one or more unsigned integer constants as parameters that specify the function argument(s) of const char* type to initify. If the marked argument is a vararg then the plugin initifies all vararg arguments. I couldn't test th