From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.groups.io with SMTP id smtpd.web10.18526.1597162200296271419 for ; Tue, 11 Aug 2020 09:10:00 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=K47aPOv7; spf=pass (domain: redhat.com, ip: 216.205.24.124, mailfrom: lersek@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1597162199; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=zJdlr9hzOkac7G9aome3Aq+Qyw+3ncXAZdJIGT6AYUQ=; b=K47aPOv7QG07H2QJuyA69jxZznv76XkCy4pEdZWY27E7jnYRHGeMe1FO3rml++pYtICCn7 QrVx7RqF3UDihVj8pQ/RTMfF27XQeN3Mc59TCvlLyFx/6pI4cUtEIB1fsRmQE7t1VOuz/W c54MOFi+akiS8Kh4qiAi1QzjP3BB8Ho= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-509-MjbUgw_zNSqVWSO4LY-fTw-1; Tue, 11 Aug 2020 12:09:47 -0400 X-MC-Unique: MjbUgw_zNSqVWSO4LY-fTw-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 03920106B244; Tue, 11 Aug 2020 16:09:45 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-113-221.ams2.redhat.com [10.36.113.221]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8F7336F14F; Tue, 11 Aug 2020 16:09:43 +0000 (UTC) Subject: Re: [edk2-devel] [PATCH v4 3/5] OvmfPkg: Add RngLib based on TimerLib for Crypto To: devel@edk2.groups.io, ard.biesheuvel@arm.com, matthewfcarlson@gmail.com Cc: Jordan Justen , Anthony Perard , Julien Grall References: <20200811022200.1087-1-matthewfcarlson@gmail.com> <20200811022200.1087-4-matthewfcarlson@gmail.com> <4f495f30-5dfc-8d91-b1eb-c36ce0447268@arm.com> From: "Laszlo Ersek" Message-ID: Date: Tue, 11 Aug 2020 18:09:42 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Firefox/52.0 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <4f495f30-5dfc-8d91-b1eb-c36ce0447268@arm.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=lersek@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Hi Ard! On 08/11/20 10:22, Ard Biesheuvel wrote: > On 8/11/20 4:21 AM, matthewfcarlson@gmail.com wrote: >> From: Matthew Carlson >> > > How am I supposed to review this change? The commit log is empty and I > was not cc'ed on the cover letter. Cover letter: [edk2-devel] [PATCH v4 0/5] Use RngLib instead of TimerLib for OpensslLib https://edk2.groups.io/g/devel/message/63944 http://mid.mail-archive.com/20200811022200.1087-1-matthewfcarlson@gmail.com Bugzilla: https://bugzilla.tianocore.org/show_bug.cgi?id=1871 Unfortunately, the cover letter doesn't much explain the approach either. The latest comments in the BZ should be helpful though. My understanding is that the timer-based "pseudo-random" generation is factored out of "CryptoPkg/Library/OpensslLib/rand_pool_noise*" to the new BaseRngLibTimerLib instance (see patches #1 and #5). In the middle, platforms native to the edk2 tree and currently using "rand_pool_noise*" are diverted to the new lib instance. (Patches #3 and #4.) So I think the intent is to introduce no change in behavior for those platforms, only make OpensslLib depend on the RngLib class. Patch#2 adds BaseRngLibDxe, which depends on gEfiRngProtocolGuid. I think the structure of the series is correct. --*-- In edk2, we have two RNG protocol implementations, "OvmfPkg/VirtioRngDxe" and "SecurityPkg/RandomNumberGenerator/RngDxe". While it would be nice to use the "BaseRngLibDxe" instance in OvmfPkg and ArmVirtPkg, *in the longer term*, I have some doubts: - I don't know whether or how "SecurityPkg/RandomNumberGenerator/RngDxe" applies to virtual machines. - OvmfPkg/VirtioRngDxe does not produce gEfiRngProtocolGuid if there is no virtio-rng-(pci|device) device configured in QEMU. So a strict depex would not work; we'd again need some kind of OR depex. - The ArmVirtQemu and OVMF PlatformBootManagerLib instances connect virtio-rng-(pci|device) devices after signaling EndOfDxe. That's good enough for boot loaders and the Linux kernel's UEFI stub, but possibly not good enough for platform DXE drivers that need randomness before EndOfDxe. - The "BaseRngLibDxe" instance from patch#2 only accepts one of the "Sp80090Ctr256", "Sp80090Hmac256", and "Sp80090Hash256" algorithms, and "OvmfPkg/VirtioRngDxe" provides none of those. ("SecurityPkg/RandomNumberGenerator/RngDxe" seems to provide "Sp80090Ctr256".) But, anyway, these are just longer-term points for OvmfPkg and ArmVirtPkg; they aren't a problem with this patch set. > In general, please try to muster up the energy to write at least one > sentence that describes *why* the patch is needed, complementing the > subject line, which in this case summarizes correctly *what* the patch > does. Agreed. And, in addition to the minimally one-sentence commit message body, each commit message should reference . I'd be very happy if you could review this patch series; personally I can only formally review patches #3 and #4. Thanks! Laszlo