Message ID | 20230925214046.1051350-1-anarsoul@gmail.com |
---|---|
State | New |
Headers | show |
Series | ACPI: FPDT: break out of the loop if record length is zero | expand |
diff --git a/drivers/acpi/acpi_fpdt.c b/drivers/acpi/acpi_fpdt.c index a2056c4c8cb7..53d8f9601a55 100644 --- a/drivers/acpi/acpi_fpdt.c +++ b/drivers/acpi/acpi_fpdt.c @@ -194,6 +194,11 @@ static int fpdt_process_subtable(u64 address, u32 subtable_type) record_header = (void *)subtable_header + offset; offset += record_header->length; + if (!record_header->length) { + pr_info(FW_BUG "Zero-length record found.\n"); + break; + } + switch (record_header->type) { case RECORD_S3_RESUME: if (subtable_type != SUBTABLE_S3PT) {
Buggy BIOSes may have zero-length records in FPDT, table, as a result fpdt_process_subtable() spins in eternal loop. Break out of the loop if record length is zero. Fixes: d1eb86e59be0 ("ACPI: tables: introduce support for FPDT table") Cc: stable@vger.kernel.org Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com> --- drivers/acpi/acpi_fpdt.c | 5 +++++ 1 file changed, 5 insertions(+)