From 496e44db7f9d52e00ad7e3deee3408e555fcb76e Mon Sep 17 00:00:00 2001 From: yinshengkai Date: Thu, 6 Jun 2024 17:06:36 +0800 Subject: [PATCH] mm: kasan supports checking 0 address access Signed-off-by: yinshengkai --- mm/kasan/hook.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/mm/kasan/hook.c b/mm/kasan/hook.c index 2ed8b34cb6..946257283d 100644 --- a/mm/kasan/hook.c +++ b/mm/kasan/hook.c @@ -173,6 +173,11 @@ static inline void kasan_check_report(FAR const void *addr, size_t size, return; } + if (addr == NULL) + { + kasan_report(addr, size, is_write, return_address); + } + if (kasan_is_poisoned(addr, size)) { kasan_report(addr, size, is_write, return_address);