Re: [PATCH v1] ACPI: APEI: EINJ: Allow injection on legacy persistent memory

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Aug 25, 2025 at 5:12 PM Luck, Tony <tony.luck@xxxxxxxxx> wrote:
>
> > > I chatted offline with Dan Williams. He wondered whether this sanity
> > > check should just be reduced to pass through any address except MMIO
> > > and leave it to the BIOS to decide what is a legitimate injection
> > > target.
> >
> > I guess that's fine, but wonder should the EINJ driver still exclude
> > IORES_DESC_ACPI_TABLES and IORES_DESC_ACPI_NV_STORAGE? to prevent
> > that, say, by coincidence or not an error "corrupted" EINJ table
> > itself, or "corrupted" other ACPI data.
>
> What if I want to find out what the system does with a corrupted ACPI table?

Yeah, it sounds like a valid use case for a smart user of EINJ. I
guess I just wasn't thinking "wild" enough ;).

If other APEI maintainers and reviewers agree, I will do it in V2;
IIUC basically the following small diff:

diff --git a/drivers/acpi/apei/einj-core.c b/drivers/acpi/apei/einj-core.c
index 2561b045acc7b..3be20177d630f 100644
--- a/drivers/acpi/apei/einj-core.c
+++ b/drivers/acpi/apei/einj-core.c
@@ -707,14 +707,7 @@ int einj_error_inject(u32 type, u32 flags, u64
param1, u64 param2, u64 param3,
        base_addr = param1 & param2;
        size = ~param2 + 1;

-       if (((param2 & PAGE_MASK) != PAGE_MASK) ||
-           ((region_intersects(base_addr, size,
IORESOURCE_SYSTEM_RAM, IORES_DESC_NONE)
-                               != REGION_INTERSECTS) &&
-            (region_intersects(base_addr, size, IORESOURCE_MEM,
IORES_DESC_PERSISTENT_MEMORY)
-                               != REGION_INTERSECTS) &&
-            (region_intersects(base_addr, size, IORESOURCE_MEM,
IORES_DESC_SOFT_RESERVED)
-                               != REGION_INTERSECTS) &&
-            !arch_is_platform_page(base_addr)))
+       if (((param2 & PAGE_MASK) != PAGE_MASK))
                return -EINVAL;


>
> See discussion earlier this year about limiting error injection:
>
> https://lore.kernel.org/all/aDt77p9GYCIRIOMa@agluck-desk3/
>
> -Tony





[Index of Archives]     [Linux IBM ACPI]     [Linux Power Management]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]
  Powered by Linux