linux-acpi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ACPICA: Put back the call to acpi_os_validate_address
@ 2011-11-29 14:13 Lin Ming
  2011-12-12 13:07 ` Lin Ming
  2011-12-12 13:12 ` Thomas Renninger
  0 siblings, 2 replies; 3+ messages in thread
From: Lin Ming @ 2011-11-29 14:13 UTC (permalink / raw)
  To: lenb; +Cc: linux-acpi, kronos.it, Moore, Robert

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.

Reported-and-bisected-by: Luca Tettamanti <kronos.it@gmail.com>
Signed-off-by: Lin Ming <ming.m.lin@intel.com>
---

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

diff --git a/drivers/acpi/acpica/dsargs.c b/drivers/acpi/acpica/dsargs.c
index 634f5b2..d69e4a5 100644
--- a/drivers/acpi/acpica/dsargs.c
+++ b/drivers/acpi/acpica/dsargs.c
@@ -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




^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] ACPICA: Put back the call to acpi_os_validate_address
  2011-11-29 14:13 [PATCH] ACPICA: Put back the call to acpi_os_validate_address Lin Ming
@ 2011-12-12 13:07 ` Lin Ming
  2011-12-12 13:12 ` Thomas Renninger
  1 sibling, 0 replies; 3+ messages in thread
From: Lin Ming @ 2011-12-12 13:07 UTC (permalink / raw)
  To: lenb; +Cc: linux-acpi, kronos.it, Moore, Robert, Jean Delvare, stable

On Tue, Nov 29, 2011 at 10:13 PM, Lin Ming <ming.m.lin@intel.com> wrote:
> 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.
>
> Reported-and-bisected-by: Luca Tettamanti <kronos.it@gmail.com>
> Signed-off-by: Lin Ming <ming.m.lin@intel.com>

Hi Len,

Could you take this patch?

(CC stable@kernel.org)

For stable kernel 2.6.39, 3.0, 3.1.

Thanks,
Lin Ming

> ---
>
> 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(-)
>
> diff --git a/drivers/acpi/acpica/dsargs.c b/drivers/acpi/acpica/dsargs.c
> index 634f5b2..d69e4a5 100644
> --- a/drivers/acpi/acpica/dsargs.c
> +++ b/drivers/acpi/acpica/dsargs.c
> @@ -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
>
>
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
> the body of a message to majordomo@vger.kernel.org
> 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 majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] ACPICA: Put back the call to acpi_os_validate_address
  2011-11-29 14:13 [PATCH] ACPICA: Put back the call to acpi_os_validate_address Lin Ming
  2011-12-12 13:07 ` Lin Ming
@ 2011-12-12 13:12 ` Thomas Renninger
  1 sibling, 0 replies; 3+ messages in thread
From: Thomas Renninger @ 2011-12-12 13:12 UTC (permalink / raw)
  To: Lin Ming; +Cc: lenb, linux-acpi, kronos.it, Moore, Robert

On Tuesday, November 29, 2011 03:13:35 PM Lin Ming wrote:
> 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.
> 
> Reported-and-bisected-by: Luca Tettamanti <kronos.it@gmail.com>
> Signed-off-by: Lin Ming <ming.m.lin@intel.com>
Just for info:
Adding here:
CC: stable@vger.kernel.org
(mail address changed since kernel.org was down)
should effectively be the same as explicitly submitting the
patch for stable inclusion.

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-12-12 13:12 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-29 14:13 [PATCH] ACPICA: Put back the call to acpi_os_validate_address Lin Ming
2011-12-12 13:07 ` Lin Ming
2011-12-12 13:12 ` Thomas Renninger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).