From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f48.google.com ([74.125.82.48]:38065 "EHLO mail-wm0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750979AbcGMUmk (ORCPT ); Wed, 13 Jul 2016 16:42:40 -0400 Date: Wed, 13 Jul 2016 22:48:49 +0200 From: Emese Revfy Subject: Re: [PATCH v2 1/3] Add the initify gcc plugin Message-Id: <20160713224849.b42c1260b6ebb3ec1f78fa41@gmail.com> In-Reply-To: References: <20160705013928.396ce4a7cbbc40e6c09efc43@gmail.com> <20160705014033.afc9a463b518e2e239c6301b@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 15:45:56 -0400 Kees Cook wrote: > On Mon, Jul 4, 2016 at 7:40 PM, Emese Revfy wrote: > > If a function is called by __init and __exit functions as well then > > the plugin moves it to the __exit section. This causes false positive > > section mismatch errors/warnings that I don't know how to handle yet. > > Should the mismatch checker be updated to recognize this case? Without > the plugin, I assume these kinds of functions would only ever be > marked for __exit? If so, should the plugin strip the __init marking > and only add __exit? I don't modify the existing attributes. I just add a new __init/__exit when a function hasn't a section attribute yet. There are three cases: * when the function is called only by __init functions then the plugin adds the __init attribute * when the function is called only by __exit functions then the plugin adds the __exit attribute * when the function is called by __init and __exit functions too then the plugin adds the __exit attribute. The last case causes the false positive(?) message of the section mismatch. -- Emese