efi_loader: update crc32 in InstallConfigurationTable
authorHeinrich Schuchardt <xypron.glpk@gmx.de>
Sat, 7 Jul 2018 13:36:05 +0000 (15:36 +0200)
committerAlexander Graf <agraf@suse.de>
Wed, 25 Jul 2018 13:00:24 +0000 (15:00 +0200)
If the number of installed tables is changed in
InstallConfigurationTable() update the crc32 of the system table.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
lib/efi_loader/efi_boottime.c

index 820d766b410712ffe5cdda72b20c788ba2419d03..b9e54f551a4fd62e180161d38b4f848d5784fec2 100644 (file)
@@ -1444,6 +1444,9 @@ efi_status_t efi_install_configuration_table(const efi_guid_t *guid,
        systab.nr_tables = i + 1;
 
 out:
+       /* systab.nr_tables may have changed. So we need to update the crc32 */
+       efi_update_table_header_crc32(&systab.hdr);
+
        /* Notify that the configuration table was changed */
        list_for_each_entry(evt, &efi_events, link) {
                if (evt->group && !guidcmp(evt->group, guid)) {