ACK: [PATCH] lib: acpica: make region handler more robust (LP: #1524217)
Alex Hung
alex.hung at canonical.com
Thu Dec 10 02:54:38 UTC 2015
On 12/09/2015 07:05 PM, Colin King wrote:
> From: Colin Ian King <colin.king at canonical.com>
>
> The region handler should sanity check for invalid parameters before
> attempting to deference them to avoid segfaults.
>
> Signed-off-by: Colin Ian King <colin.king at canonical.com>
> ---
> src/acpica/fwts_acpica.c | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
> diff --git a/src/acpica/fwts_acpica.c b/src/acpica/fwts_acpica.c
> index 3cf7676..3caeda9 100644
> --- a/src/acpica/fwts_acpica.c
> +++ b/src/acpica/fwts_acpica.c
> @@ -261,6 +261,10 @@ static ACPI_STATUS fwts_region_handler(
> ACPI_CONNECTION_INFO *context;
> int i;
>
> + if (!regionobject)
> + return AE_BAD_PARAMETER;
> + if (!value)
> + return AE_BAD_PARAMETER;
> if (regionobject->Region.Type != ACPI_TYPE_REGION)
> return AE_OK;
>
> @@ -306,6 +310,8 @@ static ACPI_STATUS fwts_region_handler(
> case AML_FIELD_ATTRIB_MULTIBYTE:
> case AML_FIELD_ATTRIB_RAW_BYTES:
> case AML_FIELD_ATTRIB_RAW_PROCESS:
> + if (!context)
> + return AE_BAD_PARAMETER;
> length = context->AccessLength - 2;
> break;
> default:
> @@ -331,6 +337,8 @@ static ACPI_STATUS fwts_region_handler(
> case AML_FIELD_ATTRIB_MULTIBYTE:
> case AML_FIELD_ATTRIB_RAW_BYTES:
> case AML_FIELD_ATTRIB_RAW_PROCESS:
> + if (!context)
> + return AE_BAD_PARAMETER;
> length = context->AccessLength - 2;
> break;
> default:
>
Acked-by: Alex Hung <alex.hung at canonical.com>
More information about the fwts-devel
mailing list