Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp128366pxm; Fri, 25 Feb 2022 05:16:06 -0800 (PST) X-Google-Smtp-Source: ABdhPJyfnkT26S9ReIeAc7btx88RYwDcQKS7u7pSQdtjgQ9XwrObsGg7fJzNtP9JjuO3FweTSN5i X-Received: by 2002:a17:906:5006:b0:6ce:3762:c72e with SMTP id s6-20020a170906500600b006ce3762c72emr6230776ejj.30.1645794965869; Fri, 25 Feb 2022 05:16:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645794965; cv=none; d=google.com; s=arc-20160816; b=iXISA5sCOIz5Q46wP4c8S01u+CuAVWub2GKntvJUCQSS21yOxIMtIWroAIlHSQQqIQ k+I5LhpXJKkCc6vha2aAWSmzep3WJe9upr5Ce57V4cxu08irW3zUu8dEiGjVpFg3yqhZ mpfSeeqBwzPvx44iYw96pWb63s5uDcW91MgASkyf6k0hQDGcZ024kVE5YNHfpusk17uy mSNrmyF3zMNiPvmRiB2a1vRXsm0GOELgjfXjufJMy0Fvq5chYhBpqtgOgUOHQ5e4MWYU Gd40Ku29x/t6nnDegv2GPGJPGi/TNcr4AU0Dc8THXOG8Y5Y+uhxmj1g/grKxlihZaaOQ oXDQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=SyCcd5YyTFEoGeGsYaB35HytNVv8VEbM/zH5Nnq5ve0=; b=xYFuNh/A3iZhF5ZjZJIATeNJwrmNkZo3s/scJLZUHnzKJxLg+OEHA3g6WNqIgsTyES YseQTFHIK1dmGKaBogWQ+Df4MqYZp9eOoWH7imwmV2lpvzi4jkxsuFt8mJJg7eOzek7g HTxqoLU9fj+rTzrbE+Pr2HvADEHUmOaRzMThF9JespqPspuMKyf7ZnLh87De7ADt5PLK gfSmxYxi9Za4SL7w84FDdSOERo9hHgvbYYKetU/jaeZZU4cANfV2tnNJpmYX7r+XJq3+ U3nU45R9+s8xX6bMBIEidWgG39WoGe04xYyl3duBGgZODttlZwNyoZspQQfbxlwn7wsW NZAA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=UA1J9wUC; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id cw14-20020a056402228e00b00410aab3bec0si1783507edb.509.2022.02.25.05.15.21; Fri, 25 Feb 2022 05:16:05 -0800 (PST) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=UA1J9wUC; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237423AbiBYLpf (ORCPT + 99 others); Fri, 25 Feb 2022 06:45:35 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49768 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236551AbiBYLpe (ORCPT ); Fri, 25 Feb 2022 06:45:34 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3FA6F1E149B; Fri, 25 Feb 2022 03:45:02 -0800 (PST) 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 E729AB82F54; Fri, 25 Feb 2022 11:45:00 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 90E1CC340F1; Fri, 25 Feb 2022 11:44:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1645789499; bh=SyCcd5YyTFEoGeGsYaB35HytNVv8VEbM/zH5Nnq5ve0=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=UA1J9wUChl+3NAGjvYQsIrCIUKBsdCbyK5N29bUZyjGQnA02heNKfk5Dn2ZJtsylZ 9yYbb0x00luCWmM2biJtE3AMv+3fjLudhyN3RgkQGTuu/0I1x2ovnW1dPI3lnLxVJ3 XxcGmvFsgCD2uLuXqn1Wbv9aNHrfJeUc2RgB6i1ZhSLktnz/2oQLcDrI2/LsQ2aLHO awHBMZueY5I2cnfWxiWttBCdi00+NNONLvKnPxCrw5IAbNIjVw4kVWJ4aEeHnRLIYv dCsjPUKcTSKtcbgbStHoaD9JR8YEUdt6SHv6X5/DbVPxKjDmCuo0FZ5JQLYGgW40Vu Za6rCXxmqRQ0Q== Received: by mail-yb1-f182.google.com with SMTP id j12so5302420ybh.8; Fri, 25 Feb 2022 03:44:59 -0800 (PST) X-Gm-Message-State: AOAM533QxHiLljL1RfxGwoMdJrXcSr7S6555MHVzTjYLE0A/DB36f2V+ WYHb6Zey8Go2Np+SH6p88OdkFcAkps3L51Sai6w= X-Received: by 2002:a25:6c43:0:b0:61d:e94b:3c55 with SMTP id h64-20020a256c43000000b0061de94b3c55mr6880234ybc.224.1645789498678; Fri, 25 Feb 2022 03:44:58 -0800 (PST) MIME-Version: 1.0 References: <20220224133906.751587-1-Jason@zx2c4.com> <20220224133906.751587-2-Jason@zx2c4.com> In-Reply-To: From: Ard Biesheuvel Date: Fri, 25 Feb 2022 12:44:47 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v3 1/2] random: add mechanism for VM forks to reinitialize crng To: "Jason A. Donenfeld" Cc: linux-hyperv@vger.kernel.org, KVM list , Linux Crypto Mailing List , QEMU Developers , Linux Kernel Mailing List , adrian@parity.io, "Woodhouse, David" , Alexander Graf , Colm MacCarthaigh , "Weiss, Radu" , =?UTF-8?Q?Daniel_P=2E_Berrang=C3=A9?= , Laszlo Ersek , Igor Mammedov , Eduardo Habkost , ben@skyportsystems.com, "Michael S. Tsirkin" , KY Srinivasan , Haiyang Zhang , Stephen Hemminger , Wei Liu , Dexuan Cui , Dominik Brodowski , Eric Biggers , Jann Horn , Greg Kroah-Hartman , "Theodore Y. Ts'o" , Eric Biggers Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On Fri, 25 Feb 2022 at 12:44, Jason A. Donenfeld wrote: > > On Fri, Feb 25, 2022 at 12:26 PM Ard Biesheuvel wrote: > > > > On Thu, 24 Feb 2022 at 14:39, Jason A. Donenfeld wrote: > > > > > > When a VM forks, we must immediately mix in additional information to > > > the stream of random output so that two forks or a rollback don't > > > produce the same stream of random numbers, which could have catastrophic > > > cryptographic consequences. This commit adds a simple API, add_vmfork_ > > > randomness(), for that, by force reseeding the crng. > > > > > > This has the added benefit of also draining the entropy pool and setting > > > its timer back, so that any old entropy that was there prior -- which > > > could have already been used by a different fork, or generally gone > > > stale -- does not contribute to the accounting of the next 256 bits. > > > > > > Cc: Dominik Brodowski > > > Cc: Theodore Ts'o > > > Cc: Jann Horn > > > Cc: Eric Biggers > > > Signed-off-by: Jason A. Donenfeld > > > > Acked-by: Ard Biesheuvel > > Okay if I treat this as a Reviewed-by instead? Sure no problem. Reviewed-by: Ard Biesheuvel