Re: [PATCH] ACPI: tables: handle failed initrd override mappings

From: Rafael J. Wysocki (Intel)

Date: Wed Sep 16 2026 - 09:23:28 EST


On Sun, Sep 13, 2026 at 2:51 PM Slavin Liu <bolin.liu@xxxxxxxxxx> wrote:
>
> The runtime AML table-loading path can invoke initrd override after
> permanent mappings are enabled. Mapping bookkeeping can then fail.
> Return AE_NO_MEMORY before reading the candidate header through NULL.
>
> Detected by static analysis and reviewed with AI-assisted source auditing.
>
> Fixes: b2a35003dfbc ("ACPI: Implement physical address table override")
> Assisted-by: LLM
> Signed-off-by: Slavin Liu <bolin.liu@xxxxxxxxxx>
> ---
> drivers/acpi/tables.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/acpi/tables.c b/drivers/acpi/tables.c
> index eb93c060426f..749a128a889c 100644
> --- a/drivers/acpi/tables.c
> +++ b/drivers/acpi/tables.c
> @@ -560,6 +560,8 @@ acpi_table_initrd_override(struct acpi_table_header *existing_table,
> while (table_offset + ACPI_HEADER_SIZE <= all_tables_size) {
> table = acpi_os_map_memory(acpi_tables_addr + table_offset,
> ACPI_HEADER_SIZE);
> + if (!table)
> + return AE_NO_MEMORY;
> if (table_offset + table->length > all_tables_size) {
> acpi_os_unmap_memory(table, ACPI_HEADER_SIZE);
> WARN_ON(1);

Applied as 7.4 material, thanks!