Re: [PATCH v3 2/5] efi: stub: use random seed from EFI variable

From: Jason A. Donenfeld
Date: Sun Nov 27 2022 - 20:12:52 EST


Hi,

On Sun, Nov 27, 2022 at 09:12:44PM +0000, Matthew Garrett wrote:
> On Tue, Nov 22, 2022 at 03:04:01AM +0100, Jason A. Donenfeld wrote:
>
> > + * We delete the seed here, and /hope/ that this causes EFI to
> > + * also zero out its representation on disk. This is somewhat
>
> Several implementations I've worked with simply append a deletion marker
> or append a new variable value until the variable store fills up
> entirely, at which point a garbage collection event is either run or
> scheduled for the next reboot. The spec doesn't define how this is
> handled so unfortunately I don't think there's any way to get a pony
> here.

Yea this is a bummer. During my first attempt at this, I actually
overwrote the whole thing with zeros and then deleted it. But Ard
pointed out that this doesn't make a difference anyway. But, as it turns
out, that's more or less the same thing that happens with seed files on
SSDs (nobody calls fstrim after overwriting a seed file). So at the very
least, it's no worse?

Jason