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:   Tue, 7 Aug 2018 12:03:11 +0100
From:   Catalin Marinas <catalin.marinas@....com>
To:     Benjamin Herrenschmidt <benh@...nel.crashing.org>
Cc:     pmenzel@...gen.mpg.de, Paul Mackerras <paulus@...ba.org>,
        mpe@...erman.id.au, linuxppc-dev@...ts.ozlabs.org,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: Several suspected memory leaks

(catching up with emails)

On Wed, 11 Jul 2018 at 00:40, Benjamin Herrenschmidt
<benh@...nel.crashing.org> wrote:
> On Tue, 2018-07-10 at 17:17 +0200, Paul Menzel wrote:
> > On a the IBM S822LC (8335-GTA) with Ubuntu 18.04 I built Linux master
> > – 4.18-rc4+, commit 092150a2 (Merge branch 'for-linus'
> > of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid) – with
> > kmemleak. Several issues are found.
>
> Some of these are completely uninteresting though and look like
> kmemleak bugs to me :-)
>
> >     [<00000000bc285bbf>] __pud_alloc+0x80/0x270
> >     [<0000000007135d64>] hash__map_kernel_page+0x30c/0x4d0
> >     [<0000000071677858>] __ioremap_at+0x108/0x140
> >     [<000000000023e921>] __ioremap_caller+0x130/0x180
> >     [<000000009dbc3923>] icp_native_init_one_node+0x5cc/0x760
> >     [<0000000015f3168a>] icp_native_init+0x70/0x13c
> >     [<00000000655550ed>] xics_init+0x38/0x1ac
> >     [<0000000088dbf9d1>] pnv_init_IRQ+0x30/0x5c
>
> This is the interrupt controller mapping its registers, why on earth
> would that be considered a leak ? kmemleak needs to learn to ignore
> kernel page tables allocations.

Indeed, that's just a false positive for powerpc. Kmemleak ignores
page allocations and most architectures use __get_free_pages() for the
page table. In this particular case, the powerpc code uses
kmem_cache_alloc() and that's tracked by kmemleak. Since the pgd
stores the __pa(pud), kmemleak doesn't detect this pointer and reports
it as a leak. To work around this, you can pass SLAB_NOLEAKTRACE to
kmem_cache_create() in pgtable_cache_add()
(arch/powerpc/mm/init-common.c).

-- 
Catalin

Powered by blists - more mailing lists