The patch titled Subject: kasan: make addr_has_metadata() return true for valid addresses has been added to the -mm tree. Its filename is kasan-make-addr_has_metadata-return-true-for-valid-addresses.patch This patch should soon appear at https://ozlabs.org/~akpm/mmots/broken-out/kasan-make-addr_has_metadata-return-true-for-valid-addresses.patch and later at https://ozlabs.org/~akpm/mmotm/broken-out/kasan-make-addr_has_metadata-return-true-for-valid-addresses.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: make addr_has_metadata() return true for valid addresses Currently, addr_has_metadata() returns true for every address. An invalid address (e.g. NULL) passed to the function when, KASAN_HW_TAGS is enabled, leads to a kernel panic. Make addr_has_metadata() return true for valid addresses only. Note: KASAN_HW_TAGS support for vmalloc will be added with a future patch. Link: https://lkml.kernel.org/r/20210126134409.47894-3-vincenzo.frascino@xxxxxxx Fixes: 2e903b91479782b7 ("kasan, arm64: implement HW_TAGS runtime") Signed-off-by: Vincenzo Frascino <vincenzo.frascino@xxxxxxx> Reviewed-by: Andrey Konovalov <andreyknvl@xxxxxxxxxx> Cc: Andrey Ryabinin <aryabinin@xxxxxxxxxxxxx> Cc: Alexander Potapenko <glider@xxxxxxxxxx> Cc: Dmitry Vyukov <dvyukov@xxxxxxxxxx> Cc: Leon Romanovsky <leonro@xxxxxxxxxxxx> Cc: Catalin Marinas <catalin.marinas@xxxxxxx> Cc: Mark Rutland <mark.rutland@xxxxxxx> Cc: Naresh Kamboju <naresh.kamboju@xxxxxxxxxx> Cc: "Paul E . McKenney" <paulmck@xxxxxxxxxx> Cc: Will Deacon <will@xxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- mm/kasan/kasan.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/mm/kasan/kasan.h~kasan-make-addr_has_metadata-return-true-for-valid-addresses +++ a/mm/kasan/kasan.h @@ -209,7 +209,7 @@ bool check_memory_region(unsigned long a static inline bool addr_has_metadata(const void *addr) { - return true; + return (is_vmalloc_addr(addr) || virt_addr_valid(addr)); } #endif /* CONFIG_KASAN_GENERIC || CONFIG_KASAN_SW_TAGS */ _ Patches currently in -mm which might be from vincenzo.frascino@xxxxxxx are kasan-add-explicit-preconditions-to-kasan_report.patch kasan-make-addr_has_metadata-return-true-for-valid-addresses.patch