Re: [PATCH] slub: fix kmalloc_pagealloc_invalid_free unit test

From: Roman Gushchin
Date: Mon Aug 02 2021 - 23:30:58 EST


On Mon, Aug 02, 2021 at 11:08:18AM -0700, Shakeel Butt wrote:
> The unit test kmalloc_pagealloc_invalid_free makes sure that for the
> higher order slub allocation which goes to page allocator, the free is
> called with the correct address i.e. the virtual address of the head
> page.
>
> The commit f227f0faf63b ("slub: fix unreclaimable slab stat for bulk
> free") unified the free code paths for page allocator based slub
> allocations but instead of using the address passed by the caller, it
> extracted the address from the page. Thus making the unit test
> kmalloc_pagealloc_invalid_free moot. So, fix this by using the address
> passed by the caller.
>
> Should we fix this? I think yes because dev expect kasan to catch these
> type of programming bugs.

I think so too.

Acked-by: Roman Gushchin <guro@xxxxxx>

Thanks!