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: <20200825082846.GR5493@kadam>
Date:   Tue, 25 Aug 2020 11:28:46 +0300
From:   Dan Carpenter <dan.carpenter@...cle.com>
To:     Alex Dewar <alex.dewar90@...il.com>
Cc:     devel@...verdev.osuosl.org,
        Saiyam Doshi <saiyamdoshi.in@...il.com>,
        Magnus Damm <damm+renesas@...nsource.se>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        YueHaibing <yuehaibing@...wei.com>, linux-kernel@...r.kernel.org,
        "Javier F. Arias" <jarias.linux@...il.com>,
        "Frank A. Cancio Bello" <frank@...eralsoftwareinc.com>,
        Simon Horman <horms+renesas@...ge.net.au>
Subject: Re: [PATCH] staging: emxx_udc: Fix passing of NULL to
 dma_alloc_coherent()

On Tue, Aug 25, 2020 at 09:14:59AM +0100, Alex Dewar wrote:
> On Tue, Aug 25, 2020 at 10:37:13AM +0300, Dan Carpenter wrote:
> > On Mon, Aug 24, 2020 at 04:57:12PM +0100, Alex Dewar wrote:
> > > On Mon, Aug 24, 2020 at 04:19:17PM +0100, Alex Dewar wrote:
> > > > In nbu2ss_eq_queue() memory is allocated with dma_alloc_coherent(),
> > > > though, strangely, NULL is passed as the struct device* argument. Pass
> > > > the UDC's device instead.
> > 
> > I think passing NULL was always wrong, but it used to not cause an Oops.
> > This was changed a year or two ago.
> > 
> > > > 
> > > > Build-tested on x86 only.
> > > > 
> > > > Fixes: 33aa8d45a4fe ("staging: emxx_udc: Add Emma Mobile USB Gadget driver")
> > > > Signed-off-by: Alex Dewar <alex.dewar90@...il.com>
> > > > ---
> > > > 
> > > > So I *think* this is the right fix, but I don't have the hardware so
> > > > I've only been able to build-test it. My worry is that I could be
> > > > passing in the wrong struct device* here, which would squelch the
> > > > warning without fixing the breakage.
> > > > 
> > > > Can someone cleverer than me tell me if this makes sense?
> > > > 
> > > > - Alex
> > > 
> > > PS -- I meant to put an RFC in the subject line and an extra tag:
> > > Reported-by: Dan Carpenter <dan.carpenter@...cle.com>
> > > 
> > 
> > I don't know which dev pointer we're supposed to pass...  It would be
> > good to find someone to test the patch but if not then applying your
> > patch is reasonable.
> > 
> > But could you search through the file and update the rest as well.
> > The dma_free_coherent() needs to be updated and there was a second
> > dma_alloc_coherent() in the bug report.
> > 
> > regards,
> > dan carpenter
> > 
> 
> I can only find the one instance of dma_alloc_coherent(). Was it by any
> chance a different warning about the same call....?

Ah....  It was warning about the dma_free_coherent().

regards,
dan carpenter

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ