ACK: [PATCH 1/1] UBUNTU: SAUCE: ACPI / bus: Fix NULL pointer dereference in acpi_quirk_matches_bios_ids()
Sultan Alsawaf
sultan.alsawaf at canonical.com
Thu Jul 11 20:15:54 UTC 2019
I know it's not directly related to this patch, but is it intentional
that the strncmp on bios_vendor only checks to see if bios_vendor is
prefixed by LENOVO, rather than actually equal to LENOVO?
Sultan
On Thu, Jul 11, 2019 at 10:40 AM Connor Kuehl
<connor.kuehl at canonical.com> wrote:
>
> On 7/9/19 4:11 AM, Kai-Heng Feng wrote:
> > BugLink: https://bugs.launchpad.net/bugs/1829378
> >
> > Bail out early when either bios_vendor or bios_ver is NULL.
> >
> > Signed-off-by: Kai-Heng Feng <kai.heng.feng at canonical.com>
>
> Acked-by: Connor Kuehl <connor.kuehl at canonical.com>
>
> > ---
> > drivers/acpi/bus.c | 5 ++++-
> > 1 file changed, 4 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c
> > index 0b306a7cef77..159c79756bb4 100644
> > --- a/drivers/acpi/bus.c
> > +++ b/drivers/acpi/bus.c
> > @@ -121,7 +121,10 @@ bool acpi_quirk_matches_bios_ids(const char * const ids[])
> > const char *bios_ver = dmi_get_system_info(DMI_BIOS_VERSION);
> > int i;
> >
> > - if ((!bios_vendor) && (!bios_ver) && strncmp(bios_vendor, "LENOVO", 6))
> > + if (!bios_vendor || !bios_ver)
> > + return false;
> > +
> > + if (strncmp(bios_vendor, "LENOVO", 6))
> > return false;
> >
> > for (i = 0; ids[i]; i++)
> >
>
>
> --
> kernel-team mailing list
> kernel-team at lists.ubuntu.com
> https://lists.ubuntu.com/mailman/listinfo/kernel-team
More information about the kernel-team
mailing list