Andrey Konovalov 19f1c3acf8 kasan, vmalloc: unpoison VM_ALLOC pages after mapping
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.

Link: https://lkml.kernel.org/r/fcb98980e6fcd3c4be6acdcb5d6110898ef28548.1643047180.git.andreyknvl@google.com
Signed-off-by: Andrey Konovalov <andreyknvl@google.com>
Reviewed-by: Alexander Potapenko <glider@google.com>
Acked-by: Marco Elver <elver@google.com>
Cc: Andrey Ryabinin <ryabinin.a.a@gmail.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Dmitry Vyukov <dvyukov@google.com>
Cc: Evgenii Stepanov <eugenis@google.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Peter Collingbourne <pcc@google.com>
Cc: Vincenzo Frascino <vincenzo.frascino@arm.com>
Cc: Will Deacon <will@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2022-03-24 19:06:47 -07:00
..
2022-03-22 17:03:12 -07:00
2021-05-07 00:26:35 -07:00
2021-05-05 11:27:24 -07:00
2022-03-24 19:06:45 -07:00
2022-03-22 15:57:01 -07:00
2022-03-22 17:03:12 -07:00
2022-03-22 17:03:12 -07:00
2022-02-14 19:51:47 +01:00
2022-03-22 17:03:12 -07:00
2022-03-22 17:03:12 -07:00
2022-01-15 16:30:28 +02:00
2022-03-22 17:03:12 -07:00
2022-03-23 18:03:08 -07:00
2022-03-22 17:03:12 -07:00
2022-03-22 17:03:12 -07:00
2022-03-22 17:03:12 -07:00
2022-03-22 17:03:12 -07:00
2022-03-23 18:03:08 -07:00
2022-03-24 19:06:45 -07:00
2022-03-22 17:03:12 -07:00
2022-03-22 17:03:12 -07:00
2022-03-22 17:03:12 -07:00
2022-03-22 17:03:12 -07:00
2022-03-22 18:26:56 -07:00
2022-03-24 19:06:44 -07:00
2022-01-23 06:20:44 +02:00
2021-05-07 00:26:35 -07:00
2022-03-22 18:26:56 -07:00
2022-03-22 18:26:56 -07:00
2022-03-22 15:57:03 -07:00
2022-03-22 15:57:03 -07:00
2022-03-23 12:33:21 -07:00
2022-03-23 12:33:21 -07:00
2022-03-22 18:26:56 -07:00
2022-03-24 19:06:45 -07:00
2022-03-22 18:26:56 -07:00
2022-03-22 17:03:12 -07:00
2022-03-24 11:58:57 -07:00
2022-03-22 17:03:12 -07:00
2022-03-22 17:03:12 -07:00
2022-01-15 16:30:31 +02:00