mirror of
https://github.com/torvalds/linux.git
synced 2024-11-30 08:01:59 +00:00
6c2f761dad
HW_TAGS KASAN skips zeroing page_alloc allocations backing vmalloc
mappings via __GFP_SKIP_ZERO. Instead, these pages are zeroed via
kasan_unpoison_vmalloc() by passing the KASAN_VMALLOC_INIT flag.
The problem is that __kasan_unpoison_vmalloc() does not zero pages when
either kasan_vmalloc_enabled() or is_vmalloc_or_module_addr() fail.
Thus:
1. Change __vmalloc_node_range() to only set KASAN_VMALLOC_INIT when
__GFP_SKIP_ZERO is set.
2. Change __kasan_unpoison_vmalloc() to always zero pages when the
KASAN_VMALLOC_INIT flag is set.
3. Add WARN_ON() asserts to check that KASAN_VMALLOC_INIT cannot be set
in other early return paths of __kasan_unpoison_vmalloc().
Also clean up the comment in __kasan_unpoison_vmalloc.
Link: https://lkml.kernel.org/r/4bc503537efdc539ffc3f461c1b70162eea31cf6.1654798516.git.andreyknvl@google.com
Fixes:
|
||
---|---|---|
.. | ||
common.c | ||
generic.c | ||
hw_tags.c | ||
init.c | ||
kasan.h | ||
Makefile | ||
quarantine.c | ||
report_generic.c | ||
report_hw_tags.c | ||
report_sw_tags.c | ||
report_tags.c | ||
report.c | ||
shadow.c | ||
sw_tags.c | ||
tags.c |