From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934911AbcLPWsF (ORCPT ); Fri, 16 Dec 2016 17:48:05 -0500 Received: from r00tworld.com ([212.85.137.150]:40892 "EHLO r00tworld.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933629AbcLPWry (ORCPT ); Fri, 16 Dec 2016 17:47:54 -0500 From: "PaX Team" To: kernel-hardening@lists.openwall.com, Kees Cook Date: Fri, 16 Dec 2016 23:45:42 +0100 MIME-Version: 1.0 Subject: Re: [PATCH v4 1/4] gcc-plugins: Add the initify gcc plugin Reply-to: pageexec@freemail.hu CC: Kees Cook , Emese Revfy , linux-kernel@vger.kernel.org, Arnd Bergmann , Josh Triplett , spender@grsecurity.net, mmarek@suse.com, yamada.masahiro@socionext.com, linux-kbuild@vger.kernel.org, minipli@ld-linux.so, linux@armlinux.org.uk, catalin.marinas@arm.com, linux@rasmusvillemoes.dk, david.brown@linaro.org, benh@kernel.crashing.org, tglx@linutronix.de, akpm@linux-foundation.org, jlayton@poochiereds.net, sam@ravnborg.org Message-ID: <58546E96.16770.2C23F1B4@pageexec.freemail.hu> In-reply-to: <1481925984-98605-2-git-send-email-keescook@chromium.org> References: <1481925984-98605-1-git-send-email-keescook@chromium.org>, <1481925984-98605-2-git-send-email-keescook@chromium.org> X-mailer: Pegasus Mail for Windows (4.72.572) Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7BIT Content-description: Mail message body X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-2.1.12 (r00tworld.com [212.85.137.150]); Fri, 16 Dec 2016 23:45:44 +0100 (CET) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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? 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...