Re: [PATCH mm v4 26/39] kasan, vmalloc: unpoison VM_ALLOC pages after mapping

Alexander Potapenko
2021-12-21T11:50:55Z

On Mon, Dec 20, 2021 at 11:02 PM <andrey.konovalov@linux.dev> wrote:
>
> From: Andrey Konovalov <andreyknvl@google.com>
>
> Make KASAN unpoison vmalloc mappings after they have been mapped in
> when it's possible: for vmalloc() (indentified via VM_ALLOC) and
> vm_map_ram().
>
> The reasons for this are:
>
> - For vmalloc() and vm_map_ram(): pages don't get unpoisoned in case
> mapping them fails.
> - For vmalloc(): HW_TAGS KASAN needs pages to be mapped to set tags via
> kasan_unpoison_vmalloc().
>
> As a part of these changes, the return value of __vmalloc_node_range()
> is changed to area->addr. This is a non-functional change, as
> __vmalloc_area_node() returns area->addr anyway.
>
> Signed-off-by: Andrey Konovalov <andreyknvl@google.com>
Reviewed-by: Alexander Potapenko <glider@google.com>