]> git.ipfire.org Git - thirdparty/ipxe.git/commit
[efi] Detect and disable seriously broken EFI_RNG_PROTOCOL implementations
authorMichael Brown <mcb30@ipxe.org>
Sun, 28 Jun 2020 18:24:30 +0000 (19:24 +0100)
committerMichael Brown <mcb30@ipxe.org>
Sun, 28 Jun 2020 18:58:48 +0000 (19:58 +0100)
commita87537d44c4fc46a41620af4591616057a89bf95
treebcc2753d5fac5e866799c1b1322ebe003fb4b2df
parentdecee20ec84977ae1d1a7f54fa91e73017f6731d
[efi] Detect and disable seriously broken EFI_RNG_PROTOCOL implementations

The EFI_RNG_PROTOCOL on the Microsoft Surface Go does not generate
random numbers.  Successive calls to GetRNG() without any intervening
I/O operations (such as writing to the console) will produce identical
results.  Successive reboots will produce identical results.

It is unclear what the Microsoft Surface Go is attempting to use as an
entropy source, but it is demonstrably producing zero bits of entropy.

The failure is already detected by the ANS-mandated Repetition Count
Test performed as part of our GetEntropy implementation.  This
currently results in the entropy source being marked as broken, with
the result that iPXE refuses to perform any operations that require a
working entropy source.

We cannot use the existing EFI driver blacklisting mechanism to unload
the broken driver, since the RngDxe driver is integrated into the
DxeCore image.

Work around the broken driver by checking for consecutive identical
results returned by EFI_RNG_PROTOCOL and falling back to the original
timer-based entropy source.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
src/interface/efi/efi_entropy.c