EFI table being corrupted during Kexec
Gregory Price
gourry at gourry.net
Tue Sep 10 09:14:32 PDT 2024
On Tue, Sep 10, 2024 at 09:09:21AM -0700, Breno Leitao wrote:
> hello Usama,
>
> On Tue, Sep 10, 2024 at 04:46:15PM +0100, Usama Arif wrote:
> > --- a/drivers/firmware/efi/tpm.c
> > +++ b/drivers/firmware/efi/tpm.c
> > @@ -60,7 +60,9 @@ int __init efi_tpm_eventlog_init(void)
> > }
> >
> > tbl_size = sizeof(*log_tbl) + log_tbl->size;
> > - memblock_reserve(efi.tpm_log, tbl_size);
> > + if (!memblock_reserve(efi.tpm_log, tbl_size)) {
> > + arch_update_firmware_area(efi.tpm_log, tbl_size);
> > + }
>
> Shouldn't you reserve the region into 8250 independently of
> memblock_reserve() return value?
>
> Thanks for the patch,
> --breno
Probably also want some sanity check here that we're not over
writing already reserved areas before we just update the map.
If we're dealing with the scenario where we can't trust the
hardware/efi generated map, we probably want to put a small
amount of effort to ensure we're not wrecking the state when
the system is working correctly.
Only so much we can do in this scenario.
~Gregory
More information about the kexec
mailing list