lkml.org 
[lkml]   [2019]   [Feb]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2] mm/page_ext: fix an imbalance with kmemleak
On Wed, Feb 27, 2019 at 12:24:45PM -0500, Qian Cai wrote:
> After offlined a memory block, kmemleak scan will trigger a crash, as it
> encounters a page ext address that has already been freed during memory
> offlining. At the beginning in alloc_page_ext(), it calls
> kmemleak_alloc(), but it does not call kmemleak_free() in
> free_page_ext().
[...]
> diff --git a/mm/page_ext.c b/mm/page_ext.c
> index 8c78b8d45117..0b6637d7bae9 100644
> --- a/mm/page_ext.c
> +++ b/mm/page_ext.c
> @@ -274,6 +274,7 @@ static void free_page_ext(void *addr)
>
> BUG_ON(PageReserved(page));
> free_pages_exact(addr, table_size);
> + kmemleak_free(addr);

Same comment as for v1, call kmemleak_free() before free_pages_exact().
With that:

Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>

\
 
 \ /
  Last update: 2019-02-27 18:27    [W:0.025 / U:8.640 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site