From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate.crashing.org (gate.crashing.org [63.228.1.57]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 42L73X49DlzF3Ld for ; Thu, 27 Sep 2018 05:16:56 +1000 (AEST) Date: Wed, 26 Sep 2018 14:16:16 -0500 From: Segher Boessenkool To: Christophe Leroy Cc: Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v4 1/2] powerpc/32: add stack protector support Message-ID: <20180926191615.GO23155@gate.crashing.org> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii In-Reply-To: List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , On Wed, Sep 26, 2018 at 11:40:38AM +0000, Christophe Leroy wrote: > +static __always_inline void boot_init_stack_canary(void) > +{ > + unsigned long canary; > + > + /* Try to get a semi random initial value. */ > + get_random_bytes(&canary, sizeof(canary)); > + canary ^= mftb(); > + canary ^= LINUX_VERSION_CODE; > + > + current->stack_canary = canary; > +} I still think you should wait until there is entropy available. You haven't answered my questions about that (or I didn't see them): what does the kernel do in other similar cases? Looks great otherwise! Segher