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] [day] [month] [year] [list]
Message-ID: <CAHp75VeyL-G9i=ABg8r6R7+oBBYRDM82L2-jFEm1uK0-136aMw@mail.gmail.com>
Date:   Sun, 24 Mar 2019 14:31:11 +0200
From:   Andy Shevchenko <andy.shevchenko@...il.com>
To:     Aditya Pakki <pakki001@....edu>
Cc:     Kangjie Lu <kjlu@....edu>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Jiri Slaby <jslaby@...e.com>, Vinod Koul <vkoul@...nel.org>,
        Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
        "open list:SERIAL DRIVERS" <linux-serial@...r.kernel.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v2] tty: 8250: fix a missing check for pci_ioremap_bar

On Sun, Mar 24, 2019 at 2:26 PM Andy Shevchenko
<andy.shevchenko@...il.com> wrote:
> On Sun, Mar 24, 2019 at 2:05 PM Andy Shevchenko
> <andy.shevchenko@...il.com> wrote:
> > On Sun, Mar 24, 2019 at 12:55 AM Aditya Pakki <pakki001@....edu> wrote:
> > >
> > > pci_ioremap_bar could fail. The fix captures the failure and
> > > pass an error code upstream. This can avoid potential NULL
> > > pointer dereferences in the future.
> > >
> >
> > NAK.
> > This will break non-DMA case.
>
> > > @@ -172,12 +172,14 @@ static void qrk_serial_setup_dma(struct lpss8250 *lpss, struct uart_port *port)
>
> Just to clarify, what you need is simple
>

> void __iomem *regs;

Sorry for leftover.

> chip->pdata = ... //move it here for better looking code
> chip->irq = ...

> chip->regs = pci_ioremap_bar(...);

And looking into the code it needs pci_iounmap() on exit one.

> if (!chip->regs)
>   return;
>
> and thank you for pointing to this.

-- 
With Best Regards,
Andy Shevchenko

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ