The patch titled Subject: kasan, mm: untag page address in free_reserved_area has been added to the -mm tree. Its filename is kasan-mm-untag-page-address-in-free_reserved_area.patch This patch should soon appear at https://ozlabs.org/~akpm/mmots/broken-out/kasan-mm-untag-page-address-in-free_reserved_area.patch and later at https://ozlabs.org/~akpm/mmotm/broken-out/kasan-mm-untag-page-address-in-free_reserved_area.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: Vincenzo Frascino <vincenzo.frascino@xxxxxxx> Subject: kasan, mm: untag page address in free_reserved_area free_reserved_area() memsets the pages belonging to a given memory area. As that memory hasn't been allocated via page_alloc, the KASAN tags that those pages have are 0x00. As the result the memset might result in a tag mismatch. Untag the address to avoid spurious faults. Link: https://lkml.kernel.org/r/ebef6425f4468d063e2f09c1b62ccbb2236b71d3.1606161801.git.andreyknvl@xxxxxxxxxx Cc: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> Signed-off-by: Vincenzo Frascino <vincenzo.frascino@xxxxxxx> Signed-off-by: Andrey Konovalov <andreyknvl@xxxxxxxxxx> Reviewed-by: Alexander Potapenko <glider@xxxxxxxxxx> Tested-by: Vincenzo Frascino <vincenzo.frascino@xxxxxxx> Cc: Andrey Ryabinin <aryabinin@xxxxxxxxxxxxx> Cc: Branislav Rankov <Branislav.Rankov@xxxxxxx> Cc: Catalin Marinas <catalin.marinas@xxxxxxx> Cc: Dmitry Vyukov <dvyukov@xxxxxxxxxx> Cc: Evgenii Stepanov <eugenis@xxxxxxxxxx> Cc: Kevin Brodsky <kevin.brodsky@xxxxxxx> Cc: Marco Elver <elver@xxxxxxxxxx> Cc: Vasily Gorbik <gor@xxxxxxxxxxxxx> Cc: Will Deacon <will.deacon@xxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- mm/page_alloc.c | 5 +++++ 1 file changed, 5 insertions(+) --- a/mm/page_alloc.c~kasan-mm-untag-page-address-in-free_reserved_area +++ a/mm/page_alloc.c @@ -7662,6 +7662,11 @@ unsigned long free_reserved_area(void *s * alias for the memset(). */ direct_map_addr = page_address(page); + /* + * Perform a kasan-unchecked memset() since this memory + * has not been initialized. + */ + direct_map_addr = kasan_reset_tag(direct_map_addr); if ((unsigned int)poison <= 0xFF) memset(direct_map_addr, poison, PAGE_SIZE); _ Patches currently in -mm which might be from vincenzo.frascino@xxxxxxx are mm-vmalloc-fix-kasan-shadow-poisoning-size.patch arm64-enable-armv85-a-asm-arch-option.patch arm64-mte-add-in-kernel-mte-helpers.patch arm64-mte-reset-the-page-tag-in-page-flags.patch arm64-mte-add-in-kernel-tag-fault-handler.patch arm64-kasan-allow-enabling-in-kernel-mte.patch arm64-mte-convert-gcr_user-into-an-exclude-mask.patch arm64-mte-switch-gcr_el1-in-kernel-entry-and-exit.patch kasan-mm-untag-page-address-in-free_reserved_area.patch kselftest-arm64-check-gcr_el1-after-context-switch.patch