From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751444AbcGMVUM (ORCPT ); Wed, 13 Jul 2016 17:20:12 -0400 Received: from mail-wm0-f52.google.com ([74.125.82.52]:37243 "EHLO mail-wm0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751053AbcGMVUG (ORCPT ); Wed, 13 Jul 2016 17:20:06 -0400 Date: Wed, 13 Jul 2016 23:26:14 +0200 From: Emese Revfy To: Kees Cook Cc: Russell King - ARM Linux , "kernel-hardening@lists.openwall.com" , PaX Team , Brad Spengler , Michal Marek , LKML , Masahiro Yamada , linux-kbuild , minipli@ld-linux.so, Catalin Marinas , Rasmus Villemoes , David Brown , "benh@kernel.crashing.org" , Thomas Gleixner , Andrew Morton , Jeff Layton , Arnd Bergmann , Sam Ravnborg , Karsten Keil Subject: Re: [PATCH v2 1/3] Add the initify gcc plugin Message-Id: <20160713232614.94c653f7eb415d8f969a11c0@gmail.com> In-Reply-To: References: <20160705013928.396ce4a7cbbc40e6c09efc43@gmail.com> <20160705014033.afc9a463b518e2e239c6301b@gmail.com> <20160712220853.GU1041@n2100.armlinux.org.uk> X-Mailer: Sylpheed 3.5.0 (GTK+ 2.24.30; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 12 Jul 2016 18:38:47 -0400 Kees Cook wrote: > On Tue, Jul 12, 2016 at 6:08 PM, Russell King - ARM Linux > wrote: > > On Tue, Jul 12, 2016 at 03:45:56PM -0400, Kees Cook wrote: > >> On Mon, Jul 4, 2016 at 7:40 PM, Emese Revfy wrote: > > That sounds like a problem for architectures that still discard the > > __exit section at link time to reduce the size of the linked kernel > > image - though, obviously, if using the plugin results in a smaller > > kernel image _with_ the exit sections, then there's a net benefit > > size-wise. > > Ah right, __exit is dropped for non-modular builds. So, for "both > __init and __exit" it sounds like the behavior depends on the build: > > - if modular: remove __init marking (since we need it after init) > - if non-modular: remove __exit marking (since we'll never call exit) When gcc compiles vmlinux these functions should be in __init and when it compiles *.ko then they can be in __exit. I have no time to do this now but I added it to my todo list. The temporary fix can be that I enable this section move only on x86 (on other archs it will decrase the coverage). -- Emese