All of lore.kernel.org
 help / color / mirror / Atom feed
* [tip: efi/core] efi: cper: check section header more appropriately
@ 2021-08-28 10:37 tip-bot2 for Shuai Xue
  0 siblings, 0 replies; only message in thread
From: tip-bot2 for Shuai Xue @ 2021-08-28 10:37 UTC (permalink / raw)
  To: linux-tip-commits; +Cc: Shuai Xue, Ard Biesheuvel, x86, linux-kernel

The following commit has been merged into the efi/core branch of tip:

Commit-ID:     1be72c8e0786727df375f11c8178ce7e65eea20e
Gitweb:        https://git.kernel.org/tip/1be72c8e0786727df375f11c8178ce7e65eea20e
Author:        Shuai Xue <xueshuai@linux.alibaba.com>
AuthorDate:    Mon, 23 Aug 2021 19:56:54 +08:00
Committer:     Ard Biesheuvel <ardb@kernel.org>
CommitterDate: Fri, 27 Aug 2021 16:03:01 +02:00

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 <xueshuai@linux.alibaba.com>
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
---
 drivers/firmware/efi/cper.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/firmware/efi/cper.c b/drivers/firmware/efi/cper.c
index 1cb7097..73bdbd2 100644
--- a/drivers/firmware/efi/cper.c
+++ b/drivers/firmware/efi/cper.c
@@ -632,7 +632,7 @@ int cper_estatus_check(const struct acpi_hest_generic_status *estatus)
 	data_len = estatus->data_length;
 
 	apei_estatus_for_each_section(estatus, gdata) {
-		if (sizeof(struct acpi_hest_generic_data) > data_len)
+		if (acpi_hest_get_size(gdata) > data_len)
 			return -EINVAL;
 
 		record_size = acpi_hest_get_record_size(gdata);

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2021-08-28 10:37 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-28 10:37 [tip: efi/core] efi: cper: check section header more appropriately tip-bot2 for Shuai Xue

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.