Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp2633011pxb; Fri, 5 Nov 2021 01:52:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwGBlbJQRkeYI35qhf97pqzQhD7IY2FTfC3H+C4NmDUmhn3barhm5zT4DrEd2+uQVZ5AgpA X-Received: by 2002:a17:906:26c4:: with SMTP id u4mr69139459ejc.511.1636102362112; Fri, 05 Nov 2021 01:52:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1636102362; cv=none; d=google.com; s=arc-20160816; b=V6+l7R/UwX7Z55p106BTaAJrV5DWPK+DesHL0oisEOOwcdjooGcwy0wljev5p7EdXR mxwSc3IQaFpyMq7BBYaGp/URfxKmBb+gAEMpn09/lLoehE/KxUhmx/GVpcmziYmtfD8G MFcsFwwYKFIjRGn/veCW8leSZO+RxaBA2Eki82p1+JDmrxcGODcGwajhoA8/aZHf/Qc4 s0BkTGltybI+PXkT7TLzvFB8coDBL+ggSf7BJW4ZYeDnPaqboO4AgzIbI4tGtCI4Nm6o N7VMIATFLygy8bIhLnL5oyZAKqdMJXSvNL8H3r7dE4sHDBxxVTq75iYzOf9btC4b5AEP chvQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=kIa/dSeR9dmYHKqn9/Ta1vd7vqsD4zXPSXPZseJJdbc=; b=vMJVzh9voz7ZEnz4teTBfVqWdmXpVo41ezRowkcvK9X8W6nYQ7p396Y94auaiPmoGG gSDth4xriXZYLcx4P9XlEt4+vuPiZnp4zTKIC2YgJOMVREuBP5RIQVchfNPXDO9HrA+C DyzS616Mv+RTQO01Xf6BnFSpLBWgU6OAhvZt5Cl5J48nWTluuRt9osv2KjrAftQ8GOTr Gz4OSsOY9Wy7PPq9n5yQOp2KbmQaiNQxvxehjNNOlsGGyIiBmExGSwPhRGCDaVqmcVc3 Vi4QId3T3DHXjJ0201yaV9ekndViM9RMpPCLb503/M+ojIsTND6lAHkhTmoUFf/oHABF FzJQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c10si11647882ejf.406.2021.11.05.01.52.18; Fri, 05 Nov 2021 01:52:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232299AbhKEH4l (ORCPT + 99 others); Fri, 5 Nov 2021 03:56:41 -0400 Received: from isilmar-4.linta.de ([136.243.71.142]:37676 "EHLO isilmar-4.linta.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231896AbhKEH4j (ORCPT ); Fri, 5 Nov 2021 03:56:39 -0400 X-isilmar-external: YES X-isilmar-external: YES X-isilmar-external: YES X-isilmar-external: YES X-isilmar-external: YES Received: from light.dominikbrodowski.net (brodo.linta [10.2.0.102]) by isilmar-4.linta.de (Postfix) with ESMTPSA id CD9DE201340; Fri, 5 Nov 2021 07:53:57 +0000 (UTC) Received: by light.dominikbrodowski.net (Postfix, from userid 1000) id C6899204BC; Fri, 5 Nov 2021 07:04:39 +0100 (CET) Date: Fri, 5 Nov 2021 07:04:39 +0100 From: Dominik Brodowski To: Ard Biesheuvel Cc: "Theodore Y. Ts'o" , "Ivan T. Ivanov" , linux-efi , Linux Kernel Mailing List Subject: Re: [PATCH] random: fix crash on multiple early calls to add_bootloader_randomness() Message-ID: References: <20211012082708.121931-1-iivanov@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Am Wed, Nov 03, 2021 at 08:27:39AM +0100 schrieb Ard Biesheuvel: > > > > - if (unlikely(crng_init == 0)) { > > > > + /* We cannot do much with the input pool until it is set up in > > > > + * rand_initalize(); therefore just mix into the crng state. > > > > + * As this does not affect the input pool, we cannot credit > > > > + * entropy for this. > > > > + */ > > > > + if (unlikely(crng_init == 0) || unlikely(crng_global_init_time == 0)) { > > > > > > Can we just drop the unlikely()s here? > > > > As that would be a different change to the one necessary to resolve the bug, > > I'd like to defer that decision to the maintainer of random.c. > > > > In that case, can we at least using a single unlikely() for the whole condition? Fixed for v3. Thanks, Dominik