Re: [PATCH] mm/kasan: Fix false positive invalid-free reports with CONFIG_KASAN_SW_TAGS=y

2019-08-20 Thread Andrey Konovalov
On Mon, Aug 19, 2019 at 7:26 PM Andrey Ryabinin wrote: > > The code like this: > > ptr = kmalloc(size, GFP_KERNEL); > page = virt_to_page(ptr); > offset = offset_in_page(ptr); > kfree(page_address(page) + offset); > > may produce false-positive invalid-free reports

[PATCH] mm/kasan: Fix false positive invalid-free reports with CONFIG_KASAN_SW_TAGS=y

2019-08-19 Thread Andrey Ryabinin
The code like this: ptr = kmalloc(size, GFP_KERNEL); page = virt_to_page(ptr); offset = offset_in_page(ptr); kfree(page_address(page) + offset); may produce false-positive invalid-free reports on the kernel with CONFIG_KASAN_SW_TAGS=y. In the example above we