All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kees Cook <keescook@chromium.org>
To: PaX Team <pageexec@freemail.hu>
Cc: "kernel-hardening@lists.openwall.com" 
	<kernel-hardening@lists.openwall.com>,
	Emese Revfy <re.emese@gmail.com>,
	LKML <linux-kernel@vger.kernel.org>,
	Arnd Bergmann <arnd@arndb.de>,
	Josh Triplett <josh@joshtriplett.org>,
	Brad Spengler <spender@grsecurity.net>,
	Michal Marek <mmarek@suse.com>,
	Masahiro Yamada <yamada.masahiro@socionext.com>,
	linux-kbuild <linux-kbuild@vger.kernel.org>,
	minipli@ld-linux.so, Russell King <linux@armlinux.org.uk>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Rasmus Villemoes <linux@rasmusvillemoes.dk>,
	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>
Subject: Re: [PATCH v4 1/4] gcc-plugins: Add the initify gcc plugin
Date: Fri, 16 Dec 2016 15:02:28 -0800	[thread overview]
Message-ID: <CAGXu5j+=TarTeLkZDDESpCyzWXFDAaQrGoPKcHLyGnh5nutKKQ@mail.gmail.com> (raw)
In-Reply-To: <58546E96.16770.2C23F1B4@pageexec.freemail.hu>

On Fri, Dec 16, 2016 at 2:45 PM, PaX Team <pageexec@freemail.hu> wrote:
> On 16 Dec 2016 at 14:06, Kees Cook wrote:
>
>> diff --git a/scripts/gcc-plugins/gcc-common.h b/scripts/gcc-plugins/gcc-common.h
>> index 950fd2e64bb7..369bfb471e58 100644
>> --- a/scripts/gcc-plugins/gcc-common.h
>> +++ b/scripts/gcc-plugins/gcc-common.h
>> @@ -287,6 +287,26 @@ static inline struct cgraph_node *cgraph_next_function_with_gimple_body(struct c
>>   return NULL;
>>  }
>>
>> +static inline bool cgraph_for_node_and_aliases(cgraph_node_ptr node,
>> +                             bool (*callback)(cgraph_node_ptr, void *),
>> +                             void *data, bool include_overwritable)
>> +{
>> +     cgraph_node_ptr alias;
>> +
>> +     if (callback(node, data))
>> +             return true;
>> +
>> +     for (alias = node->same_body; alias; alias = alias->next) {
>> +             if (include_overwritable ||
>> +                     cgraph_function_body_availability(alias) > AVAIL_OVERWRITABLE)
>> +                     if (cgraph_for_node_and_aliases(alias, callback, data,
>> +                                                     include_overwritable))
>> +                             return true;
>> +     }
>> +
>> +     return false;
>> +}
>> +
>>  #define FOR_EACH_FUNCTION_WITH_GIMPLE_BODY(node) \
>>   for ((node) = cgraph_first_function_with_gimple_body(); (node); \
>>    (node) = cgraph_next_function_with_gimple_body(node))
>
> this hunk above and...
>
>> @@ -674,6 +707,14 @@ static inline cgraph_node_ptr cgraph_alias_target(cgraph_node_ptr node)
>>   return node->get_alias_target();
>>  }
>>
>> +static inline bool cgraph_for_node_and_aliases(cgraph_node_ptr node,
>> +                             bool (*callback)(cgraph_node_ptr, void *),
>> +                             void *data, bool include_overwritable)
>> +{
>> +     return node->call_for_symbol_thunks_and_aliases(callback, data,
>> +                                                     include_overwritable);
>> +}
>> +
>>  static inline struct cgraph_node_hook_list *cgraph_add_function_insertion_hook(cgraph_node_hook hook, void *data)
>>  {
>>   return symtab->add_cgraph_insertion_hook(hook, data);
>
> ...this one aren't needed by any plugins upstream so maybe introduce them when
> the needed arises?

Hrm, sure. I was just going off of Emese's v3. (And this is partially
an artifact of basing off of v4.9-rc2... I'll refresh it to v4.10-rc2
once it's out.)

> and the whole patch against gcc-common.h would also conflict
> with the version i maintain and that you said you'd sync to so there's a decision
> to be made regarding how this will is to be maintained...

What's easiest for you? I'm okay to carry "unused by upstream yet"
functions and macros in gcc-common, though I don't like carrying lots
of commented out stuff. :P

-Kees

-- 
Kees Cook
Nexus Security

WARNING: multiple messages have this Message-ID (diff)
From: Kees Cook <keescook@chromium.org>
To: PaX Team <pageexec@freemail.hu>
Cc: "kernel-hardening@lists.openwall.com"
	<kernel-hardening@lists.openwall.com>,
	Emese Revfy <re.emese@gmail.com>,
	LKML <linux-kernel@vger.kernel.org>,
	Arnd Bergmann <arnd@arndb.de>,
	Josh Triplett <josh@joshtriplett.org>,
	Brad Spengler <spender@grsecurity.net>,
	Michal Marek <mmarek@suse.com>,
	Masahiro Yamada <yamada.masahiro@socionext.com>,
	linux-kbuild <linux-kbuild@vger.kernel.org>,
	minipli@ld-linux.so, Russell King <linux@armlinux.org.uk>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Rasmus Villemoes <linux@rasmusvillemoes.dk>,
	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>
Subject: [kernel-hardening] Re: [PATCH v4 1/4] gcc-plugins: Add the initify gcc plugin
Date: Fri, 16 Dec 2016 15:02:28 -0800	[thread overview]
Message-ID: <CAGXu5j+=TarTeLkZDDESpCyzWXFDAaQrGoPKcHLyGnh5nutKKQ@mail.gmail.com> (raw)
In-Reply-To: <58546E96.16770.2C23F1B4@pageexec.freemail.hu>

On Fri, Dec 16, 2016 at 2:45 PM, PaX Team <pageexec@freemail.hu> wrote:
> On 16 Dec 2016 at 14:06, Kees Cook wrote:
>
>> diff --git a/scripts/gcc-plugins/gcc-common.h b/scripts/gcc-plugins/gcc-common.h
>> index 950fd2e64bb7..369bfb471e58 100644
>> --- a/scripts/gcc-plugins/gcc-common.h
>> +++ b/scripts/gcc-plugins/gcc-common.h
>> @@ -287,6 +287,26 @@ static inline struct cgraph_node *cgraph_next_function_with_gimple_body(struct c
>>   return NULL;
>>  }
>>
>> +static inline bool cgraph_for_node_and_aliases(cgraph_node_ptr node,
>> +                             bool (*callback)(cgraph_node_ptr, void *),
>> +                             void *data, bool include_overwritable)
>> +{
>> +     cgraph_node_ptr alias;
>> +
>> +     if (callback(node, data))
>> +             return true;
>> +
>> +     for (alias = node->same_body; alias; alias = alias->next) {
>> +             if (include_overwritable ||
>> +                     cgraph_function_body_availability(alias) > AVAIL_OVERWRITABLE)
>> +                     if (cgraph_for_node_and_aliases(alias, callback, data,
>> +                                                     include_overwritable))
>> +                             return true;
>> +     }
>> +
>> +     return false;
>> +}
>> +
>>  #define FOR_EACH_FUNCTION_WITH_GIMPLE_BODY(node) \
>>   for ((node) = cgraph_first_function_with_gimple_body(); (node); \
>>    (node) = cgraph_next_function_with_gimple_body(node))
>
> this hunk above and...
>
>> @@ -674,6 +707,14 @@ static inline cgraph_node_ptr cgraph_alias_target(cgraph_node_ptr node)
>>   return node->get_alias_target();
>>  }
>>
>> +static inline bool cgraph_for_node_and_aliases(cgraph_node_ptr node,
>> +                             bool (*callback)(cgraph_node_ptr, void *),
>> +                             void *data, bool include_overwritable)
>> +{
>> +     return node->call_for_symbol_thunks_and_aliases(callback, data,
>> +                                                     include_overwritable);
>> +}
>> +
>>  static inline struct cgraph_node_hook_list *cgraph_add_function_insertion_hook(cgraph_node_hook hook, void *data)
>>  {
>>   return symtab->add_cgraph_insertion_hook(hook, data);
>
> ...this one aren't needed by any plugins upstream so maybe introduce them when
> the needed arises?

Hrm, sure. I was just going off of Emese's v3. (And this is partially
an artifact of basing off of v4.9-rc2... I'll refresh it to v4.10-rc2
once it's out.)

> and the whole patch against gcc-common.h would also conflict
> with the version i maintain and that you said you'd sync to so there's a decision
> to be made regarding how this will is to be maintained...

What's easiest for you? I'm okay to carry "unused by upstream yet"
functions and macros in gcc-common, though I don't like carrying lots
of commented out stuff. :P

-Kees

-- 
Kees Cook
Nexus Security

  reply	other threads:[~2016-12-16 23:02 UTC|newest]

Thread overview: 63+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-16 22:06 [PATCH v4 0/4] Introduce the initify gcc plugin Kees Cook
2016-12-16 22:06 ` [kernel-hardening] " Kees Cook
2016-12-16 22:06 ` [PATCH v4 1/4] gcc-plugins: Add " Kees Cook
2016-12-16 22:06   ` [kernel-hardening] " Kees Cook
2016-12-16 22:45   ` PaX Team
2016-12-16 22:45     ` [kernel-hardening] " PaX Team
2016-12-16 22:45     ` PaX Team
2016-12-16 23:02     ` Kees Cook [this message]
2016-12-16 23:02       ` [kernel-hardening] " Kees Cook
2016-12-16 23:02       ` Kees Cook
2016-12-16 23:15       ` PaX Team
2016-12-16 23:15         ` [kernel-hardening] " PaX Team
2016-12-16 23:15         ` PaX Team
2016-12-16 22:06 ` [PATCH v4 2/4] util: Move type casts into is_kernel_rodata Kees Cook
2016-12-16 22:06   ` [kernel-hardening] " Kees Cook
2016-12-16 22:06 ` [PATCH v4 3/4] initify: Mark functions with the __nocapture attribute Kees Cook
2016-12-16 22:06   ` [kernel-hardening] " Kees Cook
2016-12-16 22:06 ` [PATCH v4 4/4] initify: Mark functions with the __unverified_nocapture attribute Kees Cook
2016-12-16 22:06   ` [kernel-hardening] " Kees Cook
2016-12-16 22:19 ` [PATCH v4 0/4] Introduce the initify gcc plugin Kees Cook
2016-12-16 22:19   ` [kernel-hardening] " Kees Cook
2016-12-16 22:19   ` Kees Cook
2016-12-19 11:10   ` Emese Revfy
2016-12-19 11:10     ` [kernel-hardening] " Emese Revfy
2016-12-19 11:10     ` Emese Revfy
2017-01-04  0:23     ` Kees Cook
2017-01-04  0:23       ` [kernel-hardening] " Kees Cook
2017-01-04  0:23       ` Kees Cook
2017-01-11  0:24       ` Emese Revfy
2017-01-11  0:24         ` [kernel-hardening] " Emese Revfy
2017-01-11  0:24         ` Emese Revfy
2017-01-11  1:09         ` Kees Cook
2017-01-11  1:09           ` [kernel-hardening] " Kees Cook
2017-01-11  1:09           ` Kees Cook
2017-01-12 21:41           ` Emese Revfy
2017-01-12 21:41             ` [kernel-hardening] " Emese Revfy
2017-01-12 21:41             ` Emese Revfy
2017-01-12 23:27             ` Kees Cook
2017-01-12 23:27               ` [kernel-hardening] " Kees Cook
2017-01-12 23:27               ` Kees Cook
2017-01-12 23:40               ` Kees Cook
2017-01-12 23:40                 ` [kernel-hardening] " Kees Cook
2017-01-12 23:40                 ` Kees Cook
2017-01-17 20:31                 ` Emese Revfy
2017-01-17 20:31                   ` [kernel-hardening] " Emese Revfy
2017-01-17 20:31                   ` Emese Revfy
2017-01-19  1:22                   ` Kees Cook
2017-01-19  1:22                     ` [kernel-hardening] " Kees Cook
2017-01-19  1:22                     ` Kees Cook
2017-02-15  0:23                 ` Emese Revfy
2017-02-15  0:23                   ` [kernel-hardening] " Emese Revfy
2017-02-15  0:23                   ` Emese Revfy
2017-02-15 19:27                   ` Kees Cook
2017-02-15 19:27                     ` [kernel-hardening] " Kees Cook
2017-02-15 19:27                     ` Kees Cook
2017-02-20 21:42                     ` Emese Revfy
2017-02-20 21:42                       ` [kernel-hardening] " Emese Revfy
2017-02-20 21:42                       ` Emese Revfy
2016-12-19 18:24 ` Laura Abbott
2016-12-19 18:24   ` [kernel-hardening] " Laura Abbott
2017-01-04  0:23   ` Kees Cook
2017-01-04  0:23     ` [kernel-hardening] " Kees Cook
2017-01-04  0:23     ` 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='CAGXu5j+=TarTeLkZDDESpCyzWXFDAaQrGoPKcHLyGnh5nutKKQ@mail.gmail.com' \
    --to=keescook@chromium.org \
    --cc=akpm@linux-foundation.org \
    --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=kernel-hardening@lists.openwall.com \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=linux@rasmusvillemoes.dk \
    --cc=minipli@ld-linux.so \
    --cc=mmarek@suse.com \
    --cc=pageexec@freemail.hu \
    --cc=re.emese@gmail.com \
    --cc=sam@ravnborg.org \
    --cc=spender@grsecurity.net \
    --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.