From: "Pedro Falcato" <pedro.falcato@gmail.com>
To: devel@edk2.groups.io, ardb@kernel.org
Cc: Liming Gao <gaoliming@byosoft.com.cn>,
Rebecca Cran <rebecca@bsdio.com>,
Pierre Gondois <pierre.gondois@arm.com>,
Leif Lindholm <quic_llindhol@quicinc.com>,
Sami Mujawar <sami.mujawar@arm.com>,
Gerd Hoffmann <kraxel@redhat.com>,
"Jason A . Donenfeld" <Jason@zx2c4.com>
Subject: Re: [edk2-devel] [PATCH 3/3] OvmfPkg/OvmfX86: Enable RDRAND based EFI_RNG_PROTOCOL implementation
Date: Tue, 22 Nov 2022 11:35:06 +0000 [thread overview]
Message-ID: <CAKbZUD30=NA-7uD-qQvLC0r4cYrDJStsB47q_MyLf75kh67cKw@mail.gmail.com> (raw)
In-Reply-To: <20221110134738.3798618-4-ardb@kernel.org>
[-- Attachment #1: Type: text/plain, Size: 4195 bytes --]
Hi Ard,
Given this patch plus the corresponding linux-efi patches wrt RNG, I'm
mildly concerned about buggy RDRAND implementations compromising the
kernel's RNG. Is this not a concern?
It's also worth noting that MdePkg/Library/BaseRngLib skips the CPUID bit
check in ArchIsRngSupported for $REASON, which I assume will crash
pre-RDRAND VMs.
We should probably also test for stupidly broken rdrand implementations
like the notorious Zen 3 which always return 0xFFFFFFFF (per xkcd 221 ;)).
Thanks,
Pedro
On Thu, Nov 10, 2022 at 1:48 PM Ard Biesheuvel <ardb@kernel.org> wrote:
> Expose the EFI_RNG_PROTOCOL based on RdRand, so that we don't have to
> rely on QEMU providing a virtio-rng device in order to implement this
> protocol.
>
> Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
> ---
> OvmfPkg/OvmfPkgIa32.dsc | 1 +
> OvmfPkg/OvmfPkgIa32.fdf | 1 +
> OvmfPkg/OvmfPkgIa32X64.dsc | 1 +
> OvmfPkg/OvmfPkgIa32X64.fdf | 1 +
> OvmfPkg/OvmfPkgX64.dsc | 1 +
> OvmfPkg/OvmfPkgX64.fdf | 1 +
> 6 files changed, 6 insertions(+)
>
> diff --git a/OvmfPkg/OvmfPkgIa32.dsc b/OvmfPkg/OvmfPkgIa32.dsc
> index e9ba491237ae..18c1e7255812 100644
> --- a/OvmfPkg/OvmfPkgIa32.dsc
> +++ b/OvmfPkg/OvmfPkgIa32.dsc
> @@ -941,6 +941,7 @@ [Components]
> }
> !endif
>
> + SecurityPkg/RandomNumberGenerator/RngDxe/RngDxe.inf
> !if $(SECURE_BOOT_ENABLE) == TRUE
>
> SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigDxe.inf
> OvmfPkg/EnrollDefaultKeys/EnrollDefaultKeys.inf
> diff --git a/OvmfPkg/OvmfPkgIa32.fdf b/OvmfPkg/OvmfPkgIa32.fdf
> index 7023ade8cebe..34f27ca832bc 100644
> --- a/OvmfPkg/OvmfPkgIa32.fdf
> +++ b/OvmfPkg/OvmfPkgIa32.fdf
> @@ -248,6 +248,7 @@ [FV.DXEFV]
> INF OvmfPkg/LsiScsiDxe/LsiScsiDxe.inf
> !endif
>
> + INF SecurityPkg/RandomNumberGenerator/RngDxe/RngDxe.inf
> !if $(SECURE_BOOT_ENABLE) == TRUE
> INF
> SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigDxe.inf
> !endif
> diff --git a/OvmfPkg/OvmfPkgIa32X64.dsc b/OvmfPkg/OvmfPkgIa32X64.dsc
> index af566b953f36..e9a199c9f490 100644
> --- a/OvmfPkg/OvmfPkgIa32X64.dsc
> +++ b/OvmfPkg/OvmfPkgIa32X64.dsc
> @@ -955,6 +955,7 @@ [Components.X64]
> }
> !endif
>
> + SecurityPkg/RandomNumberGenerator/RngDxe/RngDxe.inf
> !if $(SECURE_BOOT_ENABLE) == TRUE
>
> SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigDxe.inf
> OvmfPkg/EnrollDefaultKeys/EnrollDefaultKeys.inf
> diff --git a/OvmfPkg/OvmfPkgIa32X64.fdf b/OvmfPkg/OvmfPkgIa32X64.fdf
> index 80de4fa2c0df..33cc163e596e 100644
> --- a/OvmfPkg/OvmfPkgIa32X64.fdf
> +++ b/OvmfPkg/OvmfPkgIa32X64.fdf
> @@ -249,6 +249,7 @@ [FV.DXEFV]
> INF OvmfPkg/LsiScsiDxe/LsiScsiDxe.inf
> !endif
>
> + INF SecurityPkg/RandomNumberGenerator/RngDxe/RngDxe.inf
> !if $(SECURE_BOOT_ENABLE) == TRUE
> INF
> SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigDxe.inf
> !endif
> diff --git a/OvmfPkg/OvmfPkgX64.dsc b/OvmfPkg/OvmfPkgX64.dsc
> index f39d9cd117e6..5572cb82998f 100644
> --- a/OvmfPkg/OvmfPkgX64.dsc
> +++ b/OvmfPkg/OvmfPkgX64.dsc
> @@ -1023,6 +1023,7 @@ [Components]
> }
> !endif
>
> + SecurityPkg/RandomNumberGenerator/RngDxe/RngDxe.inf
> !if $(SECURE_BOOT_ENABLE) == TRUE
>
> SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigDxe.inf
> OvmfPkg/EnrollDefaultKeys/EnrollDefaultKeys.inf
> diff --git a/OvmfPkg/OvmfPkgX64.fdf b/OvmfPkg/OvmfPkgX64.fdf
> index c0f5a1ef3c30..d42deebe3f8f 100644
> --- a/OvmfPkg/OvmfPkgX64.fdf
> +++ b/OvmfPkg/OvmfPkgX64.fdf
> @@ -274,6 +274,7 @@ [FV.DXEFV]
> INF OvmfPkg/LsiScsiDxe/LsiScsiDxe.inf
> !endif
>
> +INF SecurityPkg/RandomNumberGenerator/RngDxe/RngDxe.inf
> !if $(SECURE_BOOT_ENABLE) == TRUE
> INF
> SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigDxe.inf
> !endif
> --
> 2.35.1
>
>
>
> ------------
> Groups.io Links: You receive all messages sent to this group.
> View/Reply Online (#96191): https://edk2.groups.io/g/devel/message/96191
> Mute This Topic: https://groups.io/mt/94935843/5946980
> Group Owner: devel+owner@edk2.groups.io
> Unsubscribe: https://edk2.groups.io/g/devel/unsub [pedro.falcato@gmail.com
> ]
> ------------
>
>
>
--
Pedro Falcato
[-- Attachment #2: Type: text/html, Size: 5506 bytes --]
next prev parent reply other threads:[~2022-11-22 11:35 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-10 13:47 [PATCH 0/3] OVMF: support EFI_RNG_PROTOCOL without virtio-rng Ard Biesheuvel
2022-11-10 13:47 ` [PATCH 1/3] ArmPkg/ArmTrngLib: Fix incorrect GUID reference in DEBUG() output Ard Biesheuvel
2022-11-10 14:39 ` Sami Mujawar
2022-11-10 13:47 ` [PATCH 2/3] ArmVirtPkg/ArmVirtQemu: Expose TRNG hypercall via RngDxe if implemented Ard Biesheuvel
2022-11-18 16:48 ` PierreGondois
2023-01-11 16:49 ` [edk2-devel] " Ard Biesheuvel
2023-01-11 17:38 ` PierreGondois
2023-01-11 17:45 ` Ard Biesheuvel
2022-11-10 13:47 ` [PATCH 3/3] OvmfPkg/OvmfX86: Enable RDRAND based EFI_RNG_PROTOCOL implementation Ard Biesheuvel
2022-11-22 11:35 ` Pedro Falcato [this message]
2022-11-22 12:20 ` [edk2-devel] " Jason A. Donenfeld
2022-11-22 12:45 ` Pedro Falcato
2022-11-22 13:10 ` Jason A. Donenfeld
2022-11-22 14:17 ` Pedro Falcato
2022-11-22 14:21 ` Jason A. Donenfeld
2022-11-22 12:29 ` Jason A. Donenfeld
2022-11-11 0:41 ` 回复: [PATCH 0/3] OVMF: support EFI_RNG_PROTOCOL without virtio-rng gaoliming
2022-11-11 2:41 ` Jason A. Donenfeld
2022-11-11 7:47 ` Ard Biesheuvel
2022-11-11 17:03 ` Jason A. Donenfeld
[not found] ` <172660F4A69E435E.25609@groups.io>
2022-11-11 3:53 ` 回复: [edk2-devel] 回复: " gaoliming
2022-11-11 7:34 ` Ard Biesheuvel
2022-11-11 8:14 ` [edk2-devel] " Gerd Hoffmann
2023-01-10 18:19 ` Jason A. Donenfeld
2023-01-11 11:41 ` Ard Biesheuvel
2023-01-11 15:23 ` [edk2-devel] " Laszlo Ersek
2023-01-11 16:03 ` Ard Biesheuvel
2023-01-11 16:05 ` Ard Biesheuvel
2023-01-12 9:27 ` Laszlo Ersek
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAKbZUD30=NA-7uD-qQvLC0r4cYrDJStsB47q_MyLf75kh67cKw@mail.gmail.com' \
--to=devel@edk2.groups.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox