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]
Date:	Sun, 23 Nov 2008 05:40:19 -0600
From:	Jay Cliburn <jacliburn@...lsouth.net>
To:	Andrew Morton <akpm@...ux-foundation.org>
Cc:	netdev@...r.kernel.org, bugme-daemon@...zilla.kernel.org,
	danielm77@...ay.se, divy@...lsio.com
Subject: Re: [Bugme-new] [Bug 12087] New: [drivers/net/cxgb3/sge.c:563]:
 Possible memory leak: s

[adding cxgb3 maintainer to cc list]

On Sat, 22 Nov 2008 21:35:32 -0800
Andrew Morton <akpm@...ux-foundation.org> wrote:

> 
> (switched to email.  Please respond via emailed reply-to-all, not via
> the bugzilla web interface).
> 
> On Sat, 22 Nov 2008 21:11:51 -0800 (PST)
> bugme-daemon@...zilla.kernel.org wrote:
> 
> > http://bugzilla.kernel.org/show_bug.cgi?id=12087
> > 
> >            Summary: [drivers/net/cxgb3/sge.c:563]: Possible memory
> > leak: s Product: Drivers
> >            Version: 2.5
> >      KernelVersion: latest git tree
> >           Platform: All
> >         OS/Version: Linux
> >               Tree: Mainline
> >             Status: NEW
> >           Severity: normal
> >           Priority: P1
> >          Component: Network
> >         AssignedTo: jgarzik@...ox.com
> >         ReportedBy: danielm77@...ay.se
> > 
> > 
> > There will be a memory leak in the function alloc_ring when the
> > parameter sw_size is nonzero and metadata is NULL. I don't know if
> > that can happen.
> > 
> > Here is the code, taken from the latest git tree.
> > 
> > static void *alloc_ring(struct pci_dev *pdev, size_t nelem, size_t
> > elem_size, size_t sw_size, dma_addr_t * phys, void *metadata)
> > {
> >         size_t len = nelem * elem_size;
> >         void *s = NULL;
> >         void *p = dma_alloc_coherent(&pdev->dev, len, phys,
> > GFP_KERNEL);
> > 
> >         if (!p)
> >                 return NULL;
> >         if (sw_size) {
> >                 s = kcalloc(nelem, sw_size, GFP_KERNEL);
> > 
> >                 if (!s) {
> >                         dma_free_coherent(&pdev->dev, len, p,
> > *phys); return NULL;
> >                 }
> >         }
> >         if (metadata)
> >                 *(void **)metadata = s;
> >         memset(p, 0, len);
> >         return p;
> > }
> > 
> > 
> 
> yeah, that is a bit silly-looking.
> --
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@...r.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ