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: <20150911150520.GE17326@saruman.tx.rr.com>
Date:	Fri, 11 Sep 2015 10:05:20 -0500
From:	Felipe Balbi <balbi@...com>
To:	Sudip Mukherjee <sudipm.mukherjee@...il.com>
CC:	Felipe Balbi <balbi@...com>,
	David Cohen <david.a.cohen@...ux.intel.com>,
	Thomas Dahlmann <dahlmann.thomas@...or.de>,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	<linux-kernel@...r.kernel.org>, <linux-geode@...ts.infradead.org>,
	<linux-usb@...r.kernel.org>
Subject: Re: [PATCH] usb: gadget: amd5536udc: fix NULL pointer dereference

On Fri, Sep 11, 2015 at 07:51:01PM +0530, Sudip Mukherjee wrote:
> On Fri, Sep 11, 2015 at 08:28:34AM -0500, Felipe Balbi wrote:
> > Hi,
> > 
> > On Fri, Sep 11, 2015 at 03:32:56PM +0530, Sudip Mukherjee wrote:
> > > On Thu, Sep 10, 2015 at 11:03:34AM -0700, David Cohen wrote:
> <snip>
> > no, the check is pointless. Most of these are. Just look at your probe()
> > and you'll see that if dev->virt_addr is NULL (meaning ioremap_nocache()
> > failed) you exit from probe() with error. The driver doesn't probe at
> > all. So you can be sure that by remove, dev->regs is valid.
> > 
> > BTW, if probe fails, you have a TON of leaked resources!! You don't kfree()
> > dev, you don't pci_disable_device(), you don't release_mem_region(), you
> > don't iounmap() virt_addr, you don't free_irq().
> > 
> > Also the iounmap() call in remove is wrong. You ioremapped
> > dev->virt_addr but iounmap() dev->regs. Are you SURE that's ok ?
> > 
> > Man, what a mess! You gotta fix that up.
> :(
> Yes, total mess. I am on it.
> BTW, while I am fixing it can i also include a patch which will
> rearrange the functions and remove the forward declarations?

sure, just make sure fixes and cleanups are separate. First all fixes,
then cleanups and reorderings.

cheers

-- 
balbi

Download attachment "signature.asc" of type "application/pgp-signature" (820 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ