kasan: remove kasan report recursive check

PANIC never returns and abort is called to exit the process after calling assert
When BOARD_RESET_ON_ASSERT < 2, the second kasan_report will not be executed.

Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
This commit is contained in:
yinshengkai 2024-04-22 18:21:04 +08:00 committed by Xiang Xiao
parent 5ee7c563a5
commit d365be9f2f

View File

@ -121,12 +121,9 @@ static void kasan_show_memory(FAR const uint8_t *addr, size_t size,
static void kasan_report(FAR const void *addr, size_t size,
bool is_write, FAR void *return_address)
{
static int recursion;
irqstate_t flags;
flags = enter_critical_section();
if (++recursion == 1)
{
_alert("kasan detected a %s access error, address at %p,"
"size is %zu, return address: %p\n",
is_write ? "write" : "read",
@ -138,9 +135,7 @@ static void kasan_report(FAR const void *addr, size_t size,
#else
dump_stack();
#endif
}
--recursion;
leave_critical_section(flags);
}