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: <CAOMZO5Bmv2CVZeJbwLhZcH7pb7Tb9FhCrPSjhkbaJO8vYtRHLw@mail.gmail.com>
Date:   Mon, 26 Apr 2021 08:57:38 -0300
From:   Fabio Estevam <festevam@...il.com>
To:     Sherry Sun <sherry.sun@....com>
Cc:     Greg KH <gregkh@...uxfoundation.org>,
        "jirislaby@...nel.org" <jirislaby@...nel.org>,
        "linux-serial@...r.kernel.org" <linux-serial@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        dl-linux-imx <linux-imx@....com>
Subject: Re: [PATCH 2/2] tty: serial: fsl_lpuart: fix the potential bug of
 dereference null return value

Hi Sherry,

On Mon, Apr 26, 2021 at 8:39 AM Sherry Sun <sherry.sun@....com> wrote:

> > > +   if (!sdata)
> > > +           return -ENODEV;
> >
> > How can sdata be NULL?
>
> Is it possible that a case forgot to set sdata? Then the value will be NULL, such as { .compatible = "fsl,imx8qxp-lpuart",  }.
> So I added the patch to avoid the kernel crash when run to sdata->reg_off directly. But I am not sure does it make sense.

sdata comes directly from of_device_get_match_data().

This driver only runs on DT platforms and the only way of being probed
is when a compatible string matches, so it is not possible that sdata
can be NULL.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ