]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
powerpc/mm: Don't report hugepage tables as memory leaks when using kmemleak
authorChristophe Leroy <christophe.leroy@c-s.fr>
Mon, 13 Aug 2018 13:19:52 +0000 (13:19 +0000)
committerJuerg Haefliger <juergh@canonical.com>
Wed, 24 Jul 2019 01:58:38 +0000 (19:58 -0600)
commit0e699761f4b0c92ad7a0ee35e1caaa0f753dab8a
tree2a4b51184a8cea9f144681318514223a101145fb
parentcc8848aeb8cb1f515807a2a673c98b0b7ef30d3d
powerpc/mm: Don't report hugepage tables as memory leaks when using kmemleak

BugLink: https://bugs.launchpad.net/bugs/1836802
[ Upstream commit 803d690e68f0c5230183f1a42c7d50a41d16e380 ]

When a process allocates a hugepage, the following leak is
reported by kmemleak. This is a false positive which is
due to the pointer to the table being stored in the PGD
as physical memory address and not virtual memory pointer.

unreferenced object 0xc30f8200 (size 512):
  comm "mmap", pid 374, jiffies 4872494 (age 627.630s)
  hex dump (first 32 bytes):
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
  backtrace:
    [<e32b68da>] huge_pte_alloc+0xdc/0x1f8
    [<9e0df1e1>] hugetlb_fault+0x560/0x8f8
    [<7938ec6c>] follow_hugetlb_page+0x14c/0x44c
    [<afbdb405>] __get_user_pages+0x1c4/0x3dc
    [<b8fd7cd9>] __mm_populate+0xac/0x140
    [<3215421e>] vm_mmap_pgoff+0xb4/0xb8
    [<c148db69>] ksys_mmap_pgoff+0xcc/0x1fc
    [<4fcd760f>] ret_from_syscall+0x0/0x38

See commit a984506c542e2 ("powerpc/mm: Don't report PUDs as
memory leaks when using kmemleak") for detailed explanation.

To fix that, this patch tells kmemleak to ignore the allocated
hugepage table.

Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
arch/powerpc/mm/hugetlbpage.c