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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 7DBD8C43334 for ; Tue, 7 Jun 2022 12:17:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=YR5ehnZ2G3+BliWLBBPueT/trkvpryLhitwavUyHLL8=; b=UlJ6QB1hMTpMkY vFRLP+++2imUbZFzedCzDuLXY9VaQVM76YCfmZ06f414Hri4pNBW6/RdPaIOSDHCH6xI3foQKK7LJ w8xRay36j0LHD8cMhXbFgKGvM+JHmqf6G74/DnKW/y0WWUYgD+2w1WIl1csFYBE3Y95yeeupwCjSn OVUHq4x1FhfLbZuHTCb4mbWBELOfyNvVhtV7o6M+B5BRO/uyFt6u6JKnF5bQJ3yGihdQrGiFfBhS7 5qThukjnflUhyVpwJXe/105lpGu7PwPo7IDwgBbbcmdEQHwkNfsLrB92d0YWbnFv9I6IK0PAvn/FL 7bHiRynsANpwxFq76Vag==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nyY8V-007HY2-5W; Tue, 07 Jun 2022 12:16:39 +0000 Received: from ams.source.kernel.org ([145.40.68.75]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nyY8Q-007HW4-Ge for linux-arm-kernel@lists.infradead.org; Tue, 07 Jun 2022 12:16:36 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id E3A11B81F70; Tue, 7 Jun 2022 12:16:32 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C8B7FC385A5; Tue, 7 Jun 2022 12:16:30 +0000 (UTC) Authentication-Results: smtp.kernel.org; dkim=pass (1024-bit key) header.d=zx2c4.com header.i=@zx2c4.com header.b="T6/Fm3Fy" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zx2c4.com; s=20210105; t=1654604188; 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=JXYCtnOH8D/QyBftfo4H/7oIrSJ0X4hdAIqvoJRWank=; b=T6/Fm3FyMhMiN9DD76jPM48CkpOZQvzHNz4hO6fSgwEueVDEPb4Y0MnYeGOopyMWkGod02 tnkvt2LTQB3NCTfFan0tEUQd/wXLcmvOdbJ9G5aQQ2GLuJW12/a5N0ojpIxkfNt5c44trd KWdY2Nm5mFiDhEfG0Gx0yl0V+rK/xGQ= Received: by mail.zx2c4.com (ZX2C4 Mail Server) with ESMTPSA id 04ff6650 (TLSv1.3:AEAD-AES256-GCM-SHA384:256:NO); Tue, 7 Jun 2022 12:16:28 +0000 (UTC) Date: Tue, 7 Jun 2022 14:16:24 +0200 From: "Jason A. Donenfeld" To: Ard Biesheuvel Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Stephen Boyd , Catalin Marinas , Russell King , Arnd Bergmann , Phil Elwell Subject: Re: [PATCH] random: do not use jump labels before they are initialized Message-ID: References: <20220607100210.683136-1-Jason@zx2c4.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220607_051634_895074_455DD777 X-CRM114-Status: GOOD ( 26.71 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi Ard, On Tue, Jun 07, 2022 at 02:03:28PM +0200, Ard Biesheuvel wrote: > On Tue, 7 Jun 2022 at 13:35, Jason A. Donenfeld wrote: > > > > Hi Ard, > > > > On Tue, Jun 07, 2022 at 01:10:52PM +0200, Ard Biesheuvel wrote: > > > Fair enough. What I would like is to remove the need to play around > > > with the placement of jump_label_init() across architectures. Jump > > > labels are fundamentally a performance optimization, so unless you can > > > explain how setting it as early as possible makes a material > > > difference, performance or otherwise, I really think we should pursue > > > a solution that does the static key manipulation at some later time. > > > > Alright. It sounds like Catalin also prefers the same. This seems simple > > enough with minimal downsides: https://lore.kernel.org/lkml/20220607113238.769088-1-Jason@zx2c4.com/ > > > > That looks simple enough. Do we risk causing any boot stalls due to > the crediting being deferred? Or new warnings about randomness being > used before CRNG is ready? We don't risk boot stalls. But there will be warnings for developers who have enabled the CONFIG_WARN_ALL_UNSEEDED_RANDOM debug option. > > So maybe we should just go that route. > > > > It is not my preferred approach, but I can live with it. I'm not sure what your preferred approach is at this point in time actually. I'll summarize all the approaches discussed so far: 1) Fix archs to initialize jump labels earlier: https://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git/commit/?id=73e2d827a501 https://lore.kernel.org/lkml/20220603121543.360283-1-Jason@zx2c4.com/ 2) Defer mixing & crediting until random_init(): https://lore.kernel.org/lkml/20220607111514.755009-1-Jason@zx2c4.com/ 3) Defer crediting (but not mixing) until random_init(): https://lore.kernel.org/lkml/20220607113238.769088-1-Jason@zx2c4.com/ 4) Defer changing the static branch (but neither mixing nor crediting) until random_init(): https://lore.kernel.org/lkml/20220607100210.683136-1-Jason@zx2c4.com/ My first choice is (1) if it's feasible. (2) is not possible without introducing a copy, so that's out. What's your preferred approach? Or is there a number 5 you have in mind? Jason _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel