Skip to content

Commit 1be72c8

Browse files
axiqiaardbiesheuvel
authored andcommitted
efi: cper: check section header more appropriately
When checking a generic status block, we iterate over all the generic data blocks. The loop condition checks that the generic data block is valid. Because the size of data blocks (excluding error data) may vary depending on the revision and the revision is contained within the data block, we should ensure that enough of the current data block is valid appropriately for different revision. Signed-off-by: Shuai Xue <[email protected]> Signed-off-by: Ard Biesheuvel <[email protected]>
1 parent b31eea2 commit 1be72c8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/firmware/efi/cper.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -632,7 +632,7 @@ int cper_estatus_check(const struct acpi_hest_generic_status *estatus)
632632
data_len = estatus->data_length;
633633

634634
apei_estatus_for_each_section(estatus, gdata) {
635-
if (sizeof(struct acpi_hest_generic_data) > data_len)
635+
if (acpi_hest_get_size(gdata) > data_len)
636636
return -EINVAL;
637637

638638
record_size = acpi_hest_get_record_size(gdata);

0 commit comments

Comments
 (0)