linux/mm/kasan
Andrey Konovalov 1c0e5b24f1 kasan: only apply __GFP_ZEROTAGS when memory is zeroed
__GFP_ZEROTAGS should only be effective if memory is being zeroed.
Currently, hardware tag-based KASAN violates this requirement.

Fix by including an initialization check along with checking for
__GFP_ZEROTAGS.

Link: https://lkml.kernel.org/r/f4f4593f7f675262d29d07c1938db5bd0cd5e285.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:46 -07:00
..
common.c kasan, page_alloc: merge kasan_free_pages into free_pages_prepare 2022-03-24 19:06:46 -07:00
generic.c mm/kasan: Convert to struct folio and struct slab 2022-01-06 12:26:14 +01:00
hw_tags.c kasan: only apply __GFP_ZEROTAGS when memory is zeroed 2022-03-24 19:06:46 -07:00
init.c kasan: use MAX_PTRS_PER_* for early shadow tables 2021-06-29 10:53:53 -07:00
kasan.h mm/kasan: Convert to struct folio and struct slab 2022-01-06 12:26:14 +01:00
Makefile kasan: integrate the common part of two KASAN tag-based modes 2021-06-29 10:53:53 -07:00
quarantine.c Merge branch 'akpm' (patches from Andrew) 2022-01-15 20:37:06 +02:00
report_generic.c mm/kasan: switch from strlcpy to strscpy 2021-04-30 11:20:41 -07:00
report_hw_tags.c kasan: integrate the common part of two KASAN tag-based modes 2021-06-29 10:53:53 -07:00
report_sw_tags.c kasan: integrate the common part of two KASAN tag-based modes 2021-06-29 10:53:53 -07:00
report_tags.c mm/kasan: Convert to struct folio and struct slab 2022-01-06 12:26:14 +01:00
report.c kasan: no need to unset panic_on_warn in end_report() 2022-03-23 19:00:35 -07:00
shadow.c mm: defer kmemleak object creation of module_alloc() 2022-01-15 16:30:25 +02:00
sw_tags.c kasan: add kasan mode messages when kasan init 2021-11-11 09:34:35 -08:00
tags.c kasan: integrate the common part of two KASAN tag-based modes 2021-06-29 10:53:53 -07:00