From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755412AbcEXUz4 (ORCPT ); Tue, 24 May 2016 16:55:56 -0400 Received: from mail-wm0-f54.google.com ([74.125.82.54]:38400 "EHLO mail-wm0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754587AbcEXUzy (ORCPT ); Tue, 24 May 2016 16:55:54 -0400 MIME-Version: 1.0 In-Reply-To: <20160524224551.9a8aec90836b3866c3e5a232@gmail.com> References: <20160524001405.3e6abd1d5a63a871cc366cff@gmail.com> <20160524001629.7a9f0c5ce8427d0ad5e951fd@gmail.com> <20160524224551.9a8aec90836b3866c3e5a232@gmail.com> From: Kees Cook Date: Tue, 24 May 2016 13:55:51 -0700 X-Google-Sender-Auth: QH21rt_kcF5hEiTOys9Q-2otlws Message-ID: Subject: Re: [PATCH v1 2/3] Mark functions with the latent_entropy attribute To: Emese Revfy Cc: "kernel-hardening@lists.openwall.com" , PaX Team , Brad Spengler , Michal Marek , LKML , Masahiro Yamada , linux-kbuild , "Theodore Ts'o" , Andrew Morton , Linux-MM , Jens Axboe , Al Viro , Paul McKenney , Ingo Molnar , Thomas Gleixner , bart.vanassche@sandisk.com, "David S. Miller" Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, May 24, 2016 at 1:45 PM, Emese Revfy wrote: > On Tue, 24 May 2016 10:16:09 -0700 > Kees Cook wrote: > >> On Mon, May 23, 2016 at 3:16 PM, Emese Revfy wrote: >> > +#ifdef CONFIG_MEMORY_HOTPLUG >> > +#define add_meminit_latent_entropy >> > +#else >> > +#define add_meminit_latent_entropy __latent_entropy >> > +#endif >> > + >> > /* These are for everybody (although not all archs will actually >> > discard it in modules) */ >> > -#define __init __section(.init.text) __cold notrace >> > +#define __init __section(.init.text) __cold notrace __latent_entropy >> > #define __initdata __section(.init.data) >> > #define __initconst __constsection(.init.rodata) >> > #define __exitdata __section(.exit.data) >> > @@ -92,7 +98,7 @@ >> > #define __exit __section(.exit.text) __exitused __cold notrace >> > >> > /* Used for MEMORY_HOTPLUG */ >> > -#define __meminit __section(.meminit.text) __cold notrace >> > +#define __meminit __section(.meminit.text) __cold notrace add_meminit_latent_entropy >> > #define __meminitdata __section(.meminit.data) >> > #define __meminitconst __constsection(.meminit.rodata) >> > #define __memexit __section(.memexit.text) __exitused __cold notrace >> >> I was confused by these defines. :) Maybe "add_meminit_latent_entropy" >> should be named "__memory_hotplug_only_latent_entropy" or something >> like that? > > I think the plugin doesn't cause a significant slowdown when CONFIG_MEMORY_HOTPLUG is enabled so I would rather always add the __latent_entropy attribute to __meminit. That seems fine to me. :) -Kees -- Kees Cook Chrome OS & Brillo Security