Skip to contentSkip to conversation

ACPI: Add absent field_obj null check

PATCH In review Alexey Simakov 2 participants 2 messages Oct 9, 2025

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ACPI: Add absent field_obj null check

The acpi_ev_address_space_dispatch function is designed in such way that assignning field_obj to NULL is valid case.

Cover the missed execution path with this check.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Fixes 0acf24ad7e10 ("ACPICA: Add support for PCC Opregion special context data")
---
 drivers/acpi/acpica/evregion.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/acpi/acpica/evregion.c +1 -1
index fa3475da7ea9..fa01bcd3840d 100644
@@ -163,7 +163,7 @@ acpi_ev_address_space_dispatch(union acpi_operand_object *region_obj,
 			return_ACPI_STATUS(AE_NOT_EXIST);
 		}
 
-		if (region_obj->region.space_id == ACPI_ADR_SPACE_PLATFORM_COMM) {
+		if (field_obj && region_obj->region.space_id == ACPI_ADR_SPACE_PLATFORM_COMM) {
 			struct acpi_pcc_info *ctx =
 			    handler_desc->address_space.context;
 
Signature · 4 lines
2.34.1

Just FYI, this patch was already merged to github ACPICA repository.
Commit hash with correspond changes at ACPICA repository: f421dd9dd897dfd1e0c015afa90cd0de2464e23c
#1 lore raw
Quoted 10 lines · Alexey Simakov

The acpi_ev_address_space_dispatch function is designed in such way that assignning field_obj to NULL is valid case.

Cover the missed execution path with this check.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Fixes 0acf24ad7e10 ("ACPICA: Add support for PCC Opregion special context data")

ACPICA changes need to be submitted to the upstream ACPICA project on GitHub as pull requests (PRs).

Once a given PR has been merged upstream, a corresponding Linux patch can be sent (with a Link: tag pointing to the original upstream ACPICA commit), but it is not necessary to do so because released upstream ACPICA material is automatically included into the ACPICA code in Linux.

Quoted 22 lines
---
 drivers/acpi/acpica/evregion.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/acpi/acpica/evregion.c +1 -2
index fa3475da7ea9..fa01bcd3840d 100644
@@ -163,7 +163,7 @@ acpi_ev_address_space_dispatch(union acpi_operand_object *region_obj,
                        return_ACPI_STATUS(AE_NOT_EXIST);
                }
 
-               if (region_obj->region.space_id == ACPI_ADR_SPACE_PLATFORM_COMM) {
+               if (field_obj && region_obj->region.space_id == ACPI_ADR_SPACE_PLATFORM_COMM) {
                        struct acpi_pcc_info *ctx =
                            handler_desc->address_space.context;
 
--

2.34.1

Just FYI, this patch was already merged to github ACPICA repository.
Commit hash with correspond changes at ACPICA repository: f421dd9dd897dfd1e0c015afa90cd0de2464e23c