Skip to contentSkip to conversation

ACPICA: Put back the call to acpi_os_validate_address

PATCH In review Lin Ming 2 participants 3 messages Nov 29, 2011 – Dec 12, 2011

Subsystems (2)
lore
Share & tools
lore

Lin Ming

author
#0 lore raw

PATCH 1/1 ACPICA: Put back the call to acpi_os_validate_address

The call to acpi_os_validate_address in acpi_ds_get_region_arguments was removed by mistake in commit 9ad19ac(ACPICA: Split large dsopcode and dsload.c files).

Put it back.

---

Len,

Could you apply this patch?
And it should be ported to stable kernel since v2.6.39.

 drivers/acpi/acpica/dsargs.c |   24 ++++++++++++++++++++++++
 1 files changed, 24 insertions(+), 0 deletions(-)
drivers/acpi/acpica/dsargs.c +24 -0
index 634f5b2..d69e4a5 100644
@@ -387,5 +387,29 @@ acpi_status acpi_ds_get_region_arguments(union acpi_operand_object *obj_desc)
 	status = acpi_ds_execute_arguments(node, extra_desc->extra.scope_node,
 					   extra_desc->extra.aml_length,
 					   extra_desc->extra.aml_start);
+	if (ACPI_FAILURE(status)) {
+		return_ACPI_STATUS(status);
+	}
+
+	/* Validate the region address/length via the host OS */
+
+	status = acpi_os_validate_address(obj_desc->region.space_id,
+					  obj_desc->region.address,
+					  (acpi_size) obj_desc->region.length,
+					  acpi_ut_get_node_name(node));
+
+	if (ACPI_FAILURE(status)) {
+		/*
+		 * Invalid address/length. We will emit an error message and mark
+		 * the region as invalid, so that it will cause an additional error if
+		 * it is ever used. Then return AE_OK.
+		 */
+		ACPI_EXCEPTION((AE_INFO, status,
+				"During address validation of OpRegion [%4.4s]",
+				node->name.ascii));
+		obj_desc->common.flags |= AOPOBJ_INVALID;
+		status = AE_OK;
+	}
+
 	return_ACPI_STATUS(status);
 }
Signature · 1 line
1.7.2.5
author
#1 lore raw
Quoted 8 lines · Lin Ming

The call to acpi_os_validate_address in acpi_ds_get_region_arguments was removed by mistake in commit 9ad19ac(ACPICA: Split large dsopcode and dsload.c files).

Put it back.

Hi Len,

Could you take this patch?

(CC [email protected])

For stable kernel 2.6.39, 3.0, 3.1.

Thanks,
Lin Ming

Quoted 49 lines

---

Len,

Could you apply this patch?
And it should be ported to stable kernel since v2.6.39.

 drivers/acpi/acpica/dsargs.c |   24 ++++++++++++++++++++++++

 1 files changed, 24 insertions(+), 0 deletions(-)
drivers/acpi/acpica/dsargs.c +24 -1
index 634f5b2..d69e4a5 100644
@@ -387,5 +387,29 @@ acpi_status acpi_ds_get_region_arguments(union acpi_operand_object *obj_desc)
        status = acpi_ds_execute_arguments(node, extra_desc->extra.scope_node,
                                           extra_desc->extra.aml_length,
                                           extra_desc->extra.aml_start);
+       if (ACPI_FAILURE(status)) {
+               return_ACPI_STATUS(status);
+       }
+
+       /* Validate the region address/length via the host OS */
+
+       status = acpi_os_validate_address(obj_desc->region.space_id,
+                                         obj_desc->region.address,
+                                         (acpi_size) obj_desc->region.length,
+                                         acpi_ut_get_node_name(node));
+
+       if (ACPI_FAILURE(status)) {
+               /*
+                * Invalid address/length. We will emit an error message and mark
+                * the region as invalid, so that it will cause an additional error if
+                * it is ever used. Then return AE_OK.
+                */
+               ACPI_EXCEPTION((AE_INFO, status,
+                               "During address validation of OpRegion [%4.4s]",
+                               node->name.ascii));
+               obj_desc->common.flags |= AOPOBJ_INVALID;
+               status = AE_OK;
+       }
+
        return_ACPI_STATUS(status);
  }
--

1.7.2.5

Quoted 4 lines

--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#2 lore raw
In reply to Lin Ming
Quoted 8 lines · Lin Ming

The call to acpi_os_validate_address in acpi_ds_get_region_arguments was removed by mistake in commit 9ad19ac(ACPICA: Split large dsopcode and dsload.c files).

Put it back.

Just for info:
Adding here:
CC: [email protected]
(mail address changed since kernel.org was down) should effectively be the same as explicitly submitting the patch for stable inclusion.

Quoted 8 lines

---

Len,

Could you apply this patch?

And it should be ported to stable kernel since v2.6.39.

The CC: above and this hint in the changelog would be enough for Greg and he will pick it out automatically and merge it into stable kernels (if it applies to stable rules, like this one should), once the patch is submitted mainline by Len.

Thomas