]> www.infradead.org Git - users/griffoul/linux.git/commitdiff
ACPI: APEI: EINJ: Check if user asked for EINJV2 injection
authorTony Luck <tony.luck@intel.com>
Thu, 14 Aug 2025 16:17:06 +0000 (09:17 -0700)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Mon, 18 Aug 2025 16:07:38 +0000 (18:07 +0200)
On an EINJV2 capable system, users may still use the old injection
interface but einj_get_parameter_address() takes the EINJV2 path to map
the parameter structure. This results in the address the user supplied
being stored to the wrong location and the BIOS injecting based on an
uninitialized field (0x0 in the reported case).

Check the version of the request when mapping the EINJ parameter
structure in BIOS reserved memory.

Fixes: 691a0f0a557b ("ACPI: APEI: EINJ: Discover EINJv2 parameters")
Reported-by: Lai, Yi1 <yi1.lai@intel.com>
Signed-off-by: Tony Luck <tony.luck@intel.com>
Reviewed-by: Zaid Alali <zaidal@os.amperecomputing.com>
Reviewed-by: Hanjun Guo <gouhanjun@huawei.com>
Link: https://patch.msgid.link/20250814161706.4489-1-tony.luck@intel.com
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/acpi/apei/einj-core.c

index bf8dc92a373aff46cb83760b23bbcff188a3e54e..99f1b841fba9d9e7617f4070678c444ee43a672a 100644 (file)
@@ -315,7 +315,7 @@ static void __iomem *einj_get_parameter_address(void)
                        memcpy_fromio(&v5param, p, v5param_size);
                        acpi5 = 1;
                        check_vendor_extension(pa_v5, &v5param);
-                       if (available_error_type & ACPI65_EINJV2_SUPP) {
+                       if (is_v2 && available_error_type & ACPI65_EINJV2_SUPP) {
                                len = v5param.einjv2_struct.length;
                                offset = offsetof(struct einjv2_extension_struct, component_arr);
                                max_nr_components = (len - offset) /