Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C077EC636CC for ; Mon, 13 Feb 2023 19:04:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229917AbjBMTE3 (ORCPT ); Mon, 13 Feb 2023 14:04:29 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38734 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229649AbjBMTE1 (ORCPT ); Mon, 13 Feb 2023 14:04:27 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BD9701CF4B for ; Mon, 13 Feb 2023 11:04:01 -0800 (PST) From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1676315014; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=s/5hBu3lJn/nxDd45X/AZd9ZUTe4oaN87JfD4iadRpA=; b=Zo4GlIDsgegigrgFMYCL+i/4cAE6UGTPwynRmjh3xboLJm4gcmMxjwgpgOWxEYPlD2WJBY QouZ0DJLwO1f2LTPkJYgUW1vZzFRy8Q/D5F5ozZIoZtuQ8kxs0AnviSlrSwQhvf+NDBfj4 F9+WxYduSMyPG7TZWxzl6Blsq2w2mzKb0I7sps03eikJ54SXeC0EgVAu3bJVruct3OEQjR UUIgg2UTDSfoIVJdnulb8CJiCjFagvpSHWgHfB41VcESdat+eUlYUoHBmLggMLoaQ94Put o0u13yw3sG/Fd/emSfGVaj4e/c1Mrko0fsSGoasKFT5Kf/3s2tjWsa4UaRuvHg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1676315014; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=s/5hBu3lJn/nxDd45X/AZd9ZUTe4oaN87JfD4iadRpA=; b=olibHbAFeBCq5oQJ5pdXixnpt+iaVdMRyPo1DdyRmeTH3tz1x7uDJtPDx7UTZVf5cuQmEm Dgthve/+8gYIGMCA== To: "Maciej W. Rozycki" , Ingo Molnar , Borislav Petkov , Dave Hansen , "H. Peter Anvin" Cc: "Jason A. Donenfeld" , Kees Cook , x86@kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3] x86: Use `get_random_u8' for kernel stack offset randomization In-Reply-To: References: Date: Mon, 13 Feb 2023 20:03:34 +0100 Message-ID: <874jrptmk9.ffs@tglx> MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jan 30 2023 at 21:30, Maciej W. Rozycki wrote: > > Therefore switch to our generic entropy source and use `get_random_u8' > instead, which according to Jason A. Donenfeld is supposed to be fast > enough: > > "Generally it's very very fast, as most cases wind up being only a > memcpy -- in this case, a single byte copy. So by and large it should > be suitable. It's fast enough now that most networking things are able > to use it. And lots of other places where you'd want really high > performance. So I'd expect it's okay to use here too. And if it is too > slow, we should figure out how to make it faster. But I don't suspect > it'll be too slow." Please provide numbers on contemporary hardware. Up to that point, it's easy enough to just disable that randomization on 32bit. Thanks, tglx