Hi Pedro, On Tue, Nov 22, 2022 at 12:35 PM Pedro Falcato <pedro.falc...@gmail.com> wrote: > 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?
Speaking with my kernel RNG maintainer hat on, no, this is not really a concern, for several reasons: - The kernel's RNG takes input from multiple sources, continuously, and tries to mix in new inputs rather quickly, especially at early boot. - The kernel will use RDRAND on its own, even in the case that EFI doesn't provide it, so it's not gaining anything here. - EFI on actual baremetal firmware, as opposed to OVMF, already provides EFI, so this is par for the course. - Most of those RDRAND bugs have concerned coming in and out of various sleep states, which doesn't really apply to early boot EFI. - And again, just to reinforce the first point, the kernel takes inputs from many sources. Having EFI provide its own thing -- via RDRAND or any other mechanism -- is complementary and will only help. Regarding your "corresponding linux-efi patches wrt RNG", I'm not quite sure what you're referring to. If anything, recent work during this cycle has been aimed around shuffling more sources of randomness in from elsewhere. The EFI RNG protocol stuff has been in there already for a long time. So maybe you misunderstood those? Or I'm misunderstanding what you're referring to? As a general point, this question of "do we have enough entropy?" or "are we initialized yet?" is an impossible proposition. Entropy estimation is impossible, and is only ever a guess, and that guess can be sometimes wrong, even wildly wrong. So the kernel is increasingly moving away from /relying/ on that, and is more focused on getting more sources faster -- incorporating anything it can find, and mixing it into the output stream more continuously. To that end, if EFI's got a DXE to do something or another, please hook it up. Lastly, I think the concern you raised is inappropriate for Ard's patchset, as it actually doesn't apply to it at all. This patchset is about hooking an existing DXE up to OVMF, one that is hooked up elsewhere, but wasn't for OVMF. This alone has nothing to do with the concern. Rather, the concerns you raised are about the DXE itself. So to that end, perhaps you should start a new thread or send some patches or do something to the DXE that you're concerned about (e.g. a basic boring power-on selftest like what the kernel has or something, if you're extra worried). Or maybe not, for the reasons I listed above of things being basically fine. Jason -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#96558): https://edk2.groups.io/g/devel/message/96558 Mute This Topic: https://groups.io/mt/94935843/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-