Skip to contentSkip to conversation

ACPI: APEI: EINJ: Check if user asked for EINJV2 injection

PATCH Applied Tony Luck 4 participants 4 messages Aug 14, 2025 – Aug 18, 2025

Subsystems (2)
lore
Share & tools
lore

Tony Luck

author reviewer
#0 lore raw

PATCH 1/1 ACPI: APEI: EINJ: Check if user asked for EINJV2 injection

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")
---
 drivers/acpi/apei/einj-core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/acpi/apei/einj-core.c +1 -1
index bf8dc92a373a..99f1b841fba9 100644
@@ -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) /
Signature · 1 line
2.50.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 6 lines · Tony Luck

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).

Quoted 6 lines

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

Fixes 691a0f0a557b ("ACPI: APEI: EINJ: Discover EINJv2 parameters")

Looks good to me.

Quoted 20 lines
---
 drivers/acpi/apei/einj-core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/acpi/apei/einj-core.c +1 -1
index bf8dc92a373a..99f1b841fba9 100644
@@ -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) /
Signature · 1 line
2.50.1
reviewer Reviewed-by on v1 1/1
#2 lore raw
In reply to Tony Luck
Quoted 21 lines · Tony Luck

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")
---
  drivers/acpi/apei/einj-core.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/acpi/apei/einj-core.c +0 -0
index bf8dc92a373a..99f1b841fba9 100644

drivers/acpi/apei/einj-core.c static void __iomem *einj_get_parameter_address(void) · line 321

Quoted 8 lines
drivers/acpi/apei/einj-core.c +1 -1
@@ -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) /

Thanks
Hanjun

maintainer Applied
#3 lore raw
Quoted 18 lines · Hanjun Guo
Quoted 16 lines · Tony Luck

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")
---
  drivers/acpi/apei/einj-core.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 15 lines

drivers/acpi/apei/einj-core.c static void __iomem *einj_get_parameter_address(void) · line 321

Quoted 13 lines
drivers/acpi/apei/einj-core.c +1 -1
index bf8dc92a373a..99f1b841fba9 100644
@@ -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) /

Applied as 6.17-rc material, thanks!