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

Alexander Potapenko glider at google.com
Tue Dec 21 03:50:17 PST 2021


On Mon, Dec 20, 2021 at 11:02 PM <andrey.konovalov at linux.dev> wrote:
>
> From: Andrey Konovalov <andreyknvl at 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 at google.com>
Reviewed-by: Alexander Potapenko <glider at google.com>



More information about the linux-arm-kernel mailing list