lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAJZ5v0ib_N_ojhoC_z9YCOgmT7q2zy1jMBAFc=pmBmrX-j5Drg@mail.gmail.com>
Date:   Tue, 3 Oct 2023 15:59:26 +0200
From:   "Rafael J. Wysocki" <rafael@...nel.org>
To:     Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
Cc:     linux-acpi@...r.kernel.org, linux-kernel@...r.kernel.org,
        "Rafael J. Wysocki" <rafael@...nel.org>,
        Len Brown <lenb@...nel.org>
Subject: Re: [PATCH v1 1/2] ACPI: property: Allow _DSD buffer data only for
 byte accessors

On Mon, Oct 2, 2023 at 3:46 PM Andy Shevchenko
<andriy.shevchenko@...ux.intel.com> wrote:
>
> In accordance with ACPI specificication and _DSD data buffer
> representation the data there is an array of bytes. Hence,
> accessing it with something longer will create a sparse data
> which is against of how device property APIs work in general
> and also not defined in the ACPI specification (see [1]).
> Fix the code to emit an error if non-byte accessor is used to
> retrieve _DSD buffer data.
>
> Fixes: 369af6bf2c28 ("ACPI: property: Read buffer properties as integers")
> Link: https://uefi.org/specs/ACPI/6.5/19_ASL_Reference.html#buffer-declare-buffer-object [1]
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>

Applied along with the [2/2] as 6.7 material.

> ---
>  drivers/acpi/property.c | 18 +++++++++---------
>  1 file changed, 9 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/acpi/property.c b/drivers/acpi/property.c
> index 413e4fcadcaf..06550d8c619d 100644
> --- a/drivers/acpi/property.c
> +++ b/drivers/acpi/property.c
> @@ -1102,25 +1102,25 @@ static int acpi_data_prop_read(const struct acpi_device_data *data,
>         switch (proptype) {
>         case DEV_PROP_STRING:
>                 break;
> -       case DEV_PROP_U8 ... DEV_PROP_U64:
> +       default:
>                 if (obj->type == ACPI_TYPE_BUFFER) {
>                         if (nval > obj->buffer.length)
>                                 return -EOVERFLOW;
> -                       break;
> +               } else {
> +                       if (nval > obj->package.count)
> +                               return -EOVERFLOW;
>                 }
> -               fallthrough;
> -       default:
> -               if (nval > obj->package.count)
> -                       return -EOVERFLOW;
>                 break;
>         }
>         if (nval == 0)
>                 return -EINVAL;
>
> -       if (obj->type != ACPI_TYPE_BUFFER)
> -               items = obj->package.elements;
> -       else
> +       if (obj->type == ACPI_TYPE_BUFFER) {
> +               if (proptype != DEV_PROP_U8)
> +                       return -EPROTO;
>                 items = obj;
> +       } else
> +               items = obj->package.elements;

The braces that are missing here (as per the coding style) were added
while applying the patch.

>
>         switch (proptype) {
>         case DEV_PROP_U8:
> --

Thanks!

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ