acrn-kernel/mm/kasan
Catalin Marinas ed0a6d1d97 mm: kasan: Ensure the tags are visible before the tag in page->flags
__kasan_unpoison_pages() colours the memory with a random tag and stores
it in page->flags in order to re-create the tagged pointer via
page_to_virt() later. When the tag from the page->flags is read, ensure
that the in-memory tags are already visible by re-ordering the
page_kasan_tag_set() after kasan_unpoison(). The former already has
barriers in place through try_cmpxchg(). On the reader side, the order
is ensured by the address dependency between page->flags and the memory
access.

Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Reviewed-by: Andrey Konovalov <andreyknvl@gmail.com>
Cc: Andrey Ryabinin <ryabinin.a.a@gmail.com>
Cc: Vincenzo Frascino <vincenzo.frascino@arm.com>
Reviewed-by: Vincenzo Frascino <vincenzo.frascino@arm.com>
Link: https://lore.kernel.org/r/20220610152141.2148929-2-catalin.marinas@arm.com
Signed-off-by: Will Deacon <will@kernel.org>
2022-07-07 10:48:37 +01:00
..
Makefile mm/kasan: remove unnecessary CONFIG_KASAN option 2022-03-24 19:06:48 -07:00
common.c mm: kasan: Ensure the tags are visible before the tag in page->flags 2022-07-07 10:48:37 +01:00
generic.c kasan: give better names to shadow values 2022-05-13 07:20:19 -07:00
hw_tags.c kasan: fix hw tags enablement when KUNIT tests are disabled 2022-04-15 14:49:55 -07:00
init.c
kasan.h kasan: give better names to shadow values 2022-05-13 07:20:19 -07:00
quarantine.c kasan: give better names to shadow values 2022-05-13 07:20:19 -07:00
report.c mm: kasan: fix input of vmalloc_to_page() 2022-05-27 09:33:46 -07:00
report_generic.c kasan: give better names to shadow values 2022-05-13 07:20:19 -07:00
report_hw_tags.c kasan: simplify kasan_find_first_bad_addr call sites 2022-03-24 19:06:49 -07:00
report_sw_tags.c kasan: simplify kasan_find_first_bad_addr call sites 2022-03-24 19:06:49 -07:00
report_tags.c kasan: rename kasan_access_info to kasan_report_info 2022-03-24 19:06:50 -07:00
shadow.c kasan, vmalloc: only tag normal vmalloc allocations 2022-03-24 19:06:48 -07:00
sw_tags.c
tags.c