[PATCH] efi_loader: Get rid of kaslr-seed

Ilias Apalodimas ilias.apalodimas at linaro.org
Thu Dec 16 17:01:12 CET 2021


Hi Heinrich, 

> > @@ -40,6 +40,28 @@ static void efi_reserve_memory(u64 addr, u64 size, bool nomap)
> >   			addr, size);
> >   }
> > 
> > +/**
> > + * efi_remove_kaslr_seed() - Removed unused kaslr-seed
> 
> name mismatch
> 
> > + *
> > + * Kernel's EFI STUB only relies on EFI_RNG_PROTOCOL for randomization
> > + * and completely ignores the kaslr-seed.  Weed it out from the DTB we
> > + * hand over, which would mess up our DTB TPM measurements as well.
> > + *
> > + * @fdt: Pointer to device tree
> > + */
> > +void efi_purge_kaslr_seed(void *fdt)
> > +{
> > +	int nodeoff = fdt_path_offset(fdt, "/chosen");
> > +	int err = 0;
> > +
> > +	if (nodeoff < 0)
> > +		return;
> > +
> > +	err = fdt_delprop(fdt, nodeoff, "kaslr-seed");
> > +	if (err < 0)
> > +		log_err("Error deleting kaslr-seed\n");
> 
> If the node does not present this is not an error!

Ah true, I'll fix that

Cheers
/Ilias


More information about the U-Boot mailing list