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: <CAJZ5v0j0qfzjikB1Pi-9mKX0rG3Hpw_cQuF421_ahFW9jjgJtA@mail.gmail.com>
Date:   Wed, 25 Oct 2023 20:33:37 +0200
From:   "Rafael J. Wysocki" <rafael@...nel.org>
To:     Raag Jadav <raag.jadav@...el.com>
Cc:     "Rafael J. Wysocki" <rafael@...nel.org>,
        Mika Westerberg <mika.westerberg@...ux.intel.com>,
        len.brown@...el.com, andriy.shevchenko@...ux.intel.com,
        linux-acpi@...r.kernel.org, linux-kernel@...r.kernel.org,
        mallikarjunappa.sangannavar@...el.com, bala.senthil@...el.com
Subject: Re: [PATCH v1] ACPI: LPSS: use acpi_dev_uid_match() for matching _UID

On Wed, Oct 25, 2023 at 8:21 PM Raag Jadav <raag.jadav@...el.com> wrote:
>
> On Wed, Oct 25, 2023 at 08:04:44PM +0200, Rafael J. Wysocki wrote:
> > On Wed, Oct 25, 2023 at 7:53 AM Mika Westerberg
> > <mika.westerberg@...ux.intel.com> wrote:
> > >
> > > On Wed, Oct 25, 2023 at 11:08:33AM +0530, Raag Jadav wrote:
> > > > Use acpi_dev_uid_match() for matching _UID instead of treating it
> > > > as an integer.
> > > >
> > > > Signed-off-by: Raag Jadav <raag.jadav@...el.com>
> > >
> > > Acked-by: Mika Westerberg <mika.westerberg@...ux.intel.com>
> >
> > I was about to apply this, but then I realized that it might change
> > the behavior in a subtle way, because what if the _UID string is
> > something like "01"?
>
> I checked the git history and found below.
>
> commit 2a036e489eb1571810126d6fa47bd8af1e237c08
> Author: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
> Date:   Tue Sep 13 19:31:41 2022 +0300
>
>     ACPI: LPSS: Refactor _UID handling to use acpi_dev_uid_to_integer()
>
>     ACPI utils provide acpi_dev_uid_to_integer() helper to extract _UID as
>     an integer. Use it instead of custom approach.
>
>     Signed-off-by: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
>     Reviewed-by: Hans de Goede <hdegoede@...hat.com>
>     Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@...el.com>
>
> diff --git a/drivers/acpi/acpi_lpss.c b/drivers/acpi/acpi_lpss.c
> index c4d4d21391d7..4d415e210c32 100644
> --- a/drivers/acpi/acpi_lpss.c
> +++ b/drivers/acpi/acpi_lpss.c
> @@ -167,10 +167,10 @@ static struct pwm_lookup byt_pwm_lookup[] = {
>
>  static void byt_pwm_setup(struct lpss_private_data *pdata)
>  {
> -       struct acpi_device *adev = pdata->adev;
> +       u64 uid;
>
>         /* Only call pwm_add_table for the first PWM controller */
> -       if (!adev->pnp.unique_id || strcmp(adev->pnp.unique_id, "1"))
> +       if (acpi_dev_uid_to_integer(pdata->adev, &uid) || uid != 1)
>                 return;
>
>         pwm_add_table(byt_pwm_lookup, ARRAY_SIZE(byt_pwm_lookup));
>
> So if we consider the original logic with strcmp, which is more inline
> with acpi_dev_uid_match(), "01" should not be the case here in my opinion.
>
> Thanks for sharing your concern though.

Well, this means that what the patch really does is to effectively
revert commit 2a036e489eb1571810126d6fa47bd8af1e237c08 and use the new
helper instead of the open-coded check that was there before, so all
of this information should be present in the changelog.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ