[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20241031-2f71908a9a589c4469480e73-pchelkin@ispras.ru>
Date: Thu, 31 Oct 2024 22:51:09 +0300
From: Fedor Pchelkin <pchelkin@...ras.ru>
To: George Rurikov <grurikov@...il.com>
Cc: Robert Moore <robert.moore@...el.com>, lvc-project@...uxtesting.org,
acpica-devel@...ts.linux.dev, linux-kernel@...r.kernel.org,
stable@...r.kernel.org, linux-acpi@...r.kernel.org,
Sudeep Holla <sudeep.holla@....com>,
"Rafael J. Wysocki" <lenb@...nel.org>
Subject: Re: [PATCH] ACPICA: Fix dereference in
acpi_ev_address_space_dispatch()
On Thu, 31. Oct 20:31, George Rurikov wrote:
> When support for PCC Opregion was added, validation of field_obj
> was missed.
> Based on the acpi_ev_address_space_dispatch function description,
> field_obj can be NULL, and also when acpi_ev_address_space_dispatch
> is called in the acpi_ex_region_read() NULL is passed as field_obj.
>
> Found by Linux Verification Center (linuxtesting.org) with SVACE.
>
> Fixes: 0acf24ad7e10 ("ACPICA: Add support for PCC Opregion special context data")
> Cc: stable@...r.kernel.org
> Signed-off-by: George Rurikov <grurikov@...il.com>
> ---
> drivers/acpi/acpica/evregion.c | 18 +++++++++++-------
Hi George,
ACPICA patches go first via a separate Github project [1].
[1]: https://github.com/acpica/acpica
Please see [2] and [3] for more info:
[2]: https://lore.kernel.org/acpica-devel/CAJZ5v0i7LYzF13M0qdeYWXZ7uO6HUpAS7pE5RJnOAJtKB8o88A@mail.gmail.com/
[3]: https://docs.kernel.org/driver-api/acpi/linuxized-acpica.html
> 1 file changed, 11 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/acpi/acpica/evregion.c b/drivers/acpi/acpica/evregion.c
> index cf53b9535f18..03e8b6f186af 100644
> --- a/drivers/acpi/acpica/evregion.c
> +++ b/drivers/acpi/acpica/evregion.c
> @@ -164,13 +164,17 @@ acpi_ev_address_space_dispatch(union acpi_operand_object *region_obj,
> }
>
> if (region_obj->region.space_id == ACPI_ADR_SPACE_PLATFORM_COMM) {
> - struct acpi_pcc_info *ctx =
> - handler_desc->address_space.context;
> -
> - ctx->internal_buffer =
> - field_obj->field.internal_pcc_buffer;
> - ctx->length = (u16)region_obj->region.length;
> - ctx->subspace_id = (u8)region_obj->region.address;
> + if (field_obj != NULL) {
> + struct acpi_pcc_info *ctx =
> + handler_desc->address_space.context;
> +
> + ctx->internal_buffer =
> + field_obj->field.internal_pcc_buffer;
> + ctx->length = (u16)region_obj->region.length;
> + ctx->subspace_id = (u8)region_obj->region.address;
> + } else {
> + return_ACPI_STATUS(AE_ERROR);
> + }
> }
>
> if (region_obj->region.space_id ==
> --
> 2.34.1
Powered by blists - more mailing lists