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: <CAJZ5v0jq1+q3HKDEzgBUWtZY8H0kaiR=bNi1WUsdg3BTAyiPgw@mail.gmail.com>
Date:   Wed, 10 Feb 2021 16:01:16 +0100
From:   "Rafael J. Wysocki" <rafael@...nel.org>
To:     Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
Cc:     "Rafael J. Wysocki" <rjw@...ysocki.net>,
        "Rafael J. Wysocki" <rafael@...nel.org>,
        ACPI Devel Maling List <linux-acpi@...r.kernel.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        Len Brown <lenb@...nel.org>,
        Calvin Johnson <calvin.johnson@....nxp.com>
Subject: Re: [PATCH v1 7/7] ACPI: property: Allow counting a single value as
 an array of 1 element

On Wed, Feb 10, 2021 at 3:48 PM Andy Shevchenko
<andriy.shevchenko@...ux.intel.com> wrote:
>
> On Wed, Feb 10, 2021 at 02:48:09PM +0100, Rafael J. Wysocki wrote:
> > On Wednesday, February 10, 2021 2:31:48 PM CET Rafael J. Wysocki wrote:
> > > On Wednesday, February 10, 2021 1:36:00 PM CET Rafael J. Wysocki wrote:
> > > > On Wed, Feb 10, 2021 at 12:51 PM Andy Shevchenko
> > > > <andriy.shevchenko@...ux.intel.com> wrote:
>
> Rafael, thanks for the review, my answers below.
>
> > > > > We allow to read the single value as a first element in the array.
> > > > > Unfortunately the counting doesn't work in this case and we can't
> > > > > call fwnode_property_count_*() API without getting an error.
> > > >
> > > > It would be good to mention what the symptom of the issue is here.
>
> fwnode_property_match_string() is not working as reported by Calvin.
>
> > > > > Modify acpi_data_prop_read() to always try the single value read
> > > > > and thus allow counting the single value as an array of 1 element.
> > > > >
> > > > > Reported-by: Calvin Johnson <calvin.johnson@....nxp.com>
> > > > > Signed-off-by: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
> > > >
> > > > This is a bug fix, so it should go in before the cleanups in this series IMO.
>
> Seems it was never worked, hence neither Fixes tag nor...
>
> > > > Also it looks like stable@...r material.
>
> ...Cc to stable@.
>
> > > > > -       if (val && nval == 1) {
> > > > > +       /* Try to read as a single value first */
> > > > > +       if (!val || nval == 1) {
> > > > >                 ret = acpi_data_prop_read_single(data, propname, proptype, val);
> > > >
> > > > This returns -EINVAL if val is NULL.
>
> Nope. That's why it's a patch 7. Patch 6 solves this.

That's my point.  Patch 7 should be the first one in the series.

> > > > >                 if (ret >= 0)
> > > > > -                       return ret;
> > > > > +                       return val ? ret : 1;
> > > >
> > > > So val cannot be NULL here.
>
> Why not? I have changed conditional.
>
> > > > >         }
>
> > > > To me, acpi_fwnode_property_read_string_array() needs to special-case
> > > > val == NULL and nval == 0.
>
> nval can be anything in the case of val==NULL. So far neither of your proposals
> conform this.

That is if !val and nval != 0 is regarded as a valid combination of
arguments, but is it?

If that is the case, the check in acpi_data_prop_read() in the last
patch that I posted needs to be (!val || nval == 1), but that would be
it, no?

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ