From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f54.google.com ([74.125.82.54]:36857 "EHLO mail-wm0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750883AbcGMU17 (ORCPT ); Wed, 13 Jul 2016 16:27:59 -0400 Date: Wed, 13 Jul 2016 22:34:08 +0200 From: Emese Revfy Subject: Re: [PATCH v2 1/3] Add the initify gcc plugin Message-Id: <20160713223408.8e52842ddda8818cec83d6a6@gmail.com> In-Reply-To: References: <20160705013928.396ce4a7cbbc40e6c09efc43@gmail.com> <20160705014033.afc9a463b518e2e239c6301b@gmail.com> <20160712220717.297fea731dd53123efd7974f@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kbuild-owner@vger.kernel.org List-ID: To: Kees Cook Cc: "kernel-hardening@lists.openwall.com" , PaX Team , Brad Spengler , Michal Marek , LKML , Masahiro Yamada , linux-kbuild , minipli@ld-linux.so, Russell King , Catalin Marinas , Rasmus Villemoes , David Brown , "benh@kernel.crashing.org" , Thomas Gleixner , Andrew Morton , Jeff Layton , Arnd Bergmann , Sam Ravnborg , Karsten Keil 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 > * normally be assumed that such an argument has been captured by that > * function and may be used in the future when .init has been unmapped from > * memory. In order to identify functions that are confirmed to not capture > * their arguments, the __nocapture() attribute is used so that initify can > * better identify candidate variables. > */ > #ifdef INITIFY_PLUGIN > # define __nocapture(...) __attribute__((nocapture(__VA_ARGS__))) > #endif Thanks, I'll take it in the next patch set with some additions (the attribute also handles __exit functions and the plugin does other things e.g., it can identify candidate init/exit functions and move them automatically to init.text/exit.text). -- Emese