From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752348AbcF1StB (ORCPT ); Tue, 28 Jun 2016 14:49:01 -0400 Received: from smtprelay0040.hostedemail.com ([216.40.44.40]:58925 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751068AbcF1StA (ORCPT ); Tue, 28 Jun 2016 14:49:00 -0400 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 50,0,0,,d41d8cd98f00b204,joe@perches.com,:::::::::::::::::::::::::::::::::::::::,RULES_HIT:41:355:379:541:599:966:967:973:988:989:1260:1277:1311:1313:1314:1345:1359:1373:1437:1515:1516:1518:1534:1541:1593:1594:1711:1730:1747:1777:1792:2196:2199:2393:2525:2560:2563:2682:2685:2693:2828:2859:2933:2937:2939:2942:2945:2947:2951:2954:3022:3138:3139:3140:3141:3142:3353:3622:3865:3867:3868:3870:3871:3872:3874:3934:3936:3938:3941:3944:3947:3950:3953:3956:3959:4321:4385:5007:6119:6120:6742:7901:7903:9025:10004:10400:10848:11232:11658:11914:12043:12517:12519:12663:12740:13069:13311:13357:13439:14181:14659:14721:21080:21324:21434,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:none,Custom_rules:0:0:0,LFtime:1,LUA_SUMMARY:none X-HE-Tag: sleep37_6afc60e4b193b X-Filterd-Recvd-Size: 2437 Message-ID: <1467139734.24287.45.camel@perches.com> Subject: Re: [PATCH v1 0/2] Introduce the initify gcc plugin From: Joe Perches To: Emese Revfy , kernel-hardening@lists.openwall.com, Mathias Krause Cc: pageexec@freemail.hu, spender@grsecurity.net, mmarek@suse.com, keescook@chromium.org, linux-kernel@vger.kernel.org, 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, arnd@arndb.de Date: Tue, 28 Jun 2016 11:48:54 -0700 In-Reply-To: <1467131708.24287.29.camel@perches.com> References: <20160628133407.10c2ea1ecd194e8085e84c5a@gmail.com> <1467131708.24287.29.camel@perches.com> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.18.5.2-0ubuntu3 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 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 memory usage. > > The initify gcc plugin can be useful for embedded systems. > 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", __func__); > } > > void runtimefunc(void) > { > pr_info("I'm here: %s\n", __func__); > } > > In what section does the string "I'm here: %s\n" get placed > or does it get placed into multiple sections? Sorry, Joe can't type. That was meant to be the identical string in both functions. From mboxrd@z Thu Jan 1 00:00:00 1970 Reply-To: kernel-hardening@lists.openwall.com Message-ID: <1467139734.24287.45.camel@perches.com> From: Joe Perches Date: Tue, 28 Jun 2016 11:48:54 -0700 In-Reply-To: <1467131708.24287.29.camel@perches.com> References: <20160628133407.10c2ea1ecd194e8085e84c5a@gmail.com> <1467131708.24287.29.camel@perches.com> Content-Type: text/plain; charset="ISO-8859-1" Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [kernel-hardening] Re: [PATCH v1 0/2] Introduce the initify gcc plugin To: Emese Revfy , kernel-hardening@lists.openwall.com, Mathias Krause Cc: pageexec@freemail.hu, spender@grsecurity.net, mmarek@suse.com, keescook@chromium.org, linux-kernel@vger.kernel.org, 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, arnd@arndb.de List-ID: 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 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 memory usage. > > The initify gcc plugin can be useful for embedded systems. > 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", __func__); > } > > void runtimefunc(void) > { > pr_info("I'm here: %s\n", __func__); > } > > In what section does the string "I'm here: %s\n" get placed > or does it get placed into multiple sections? Sorry, Joe can't type. That was meant to be the identical string in both functions.