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:
parent
5ee7c563a5
commit
d365be9f2f
@ -121,26 +121,21 @@ static void kasan_show_memory(FAR const uint8_t *addr, size_t size,
|
|||||||
static void kasan_report(FAR const void *addr, size_t size,
|
static void kasan_report(FAR const void *addr, size_t size,
|
||||||
bool is_write, FAR void *return_address)
|
bool is_write, FAR void *return_address)
|
||||||
{
|
{
|
||||||
static int recursion;
|
|
||||||
irqstate_t flags;
|
irqstate_t flags;
|
||||||
|
|
||||||
flags = enter_critical_section();
|
flags = enter_critical_section();
|
||||||
if (++recursion == 1)
|
_alert("kasan detected a %s access error, address at %p,"
|
||||||
{
|
"size is %zu, return address: %p\n",
|
||||||
_alert("kasan detected a %s access error, address at %p,"
|
is_write ? "write" : "read",
|
||||||
"size is %zu, return address: %p\n",
|
addr, size, return_address);
|
||||||
is_write ? "write" : "read",
|
|
||||||
addr, size, return_address);
|
|
||||||
|
|
||||||
kasan_show_memory(addr, size, 80);
|
kasan_show_memory(addr, size, 80);
|
||||||
#ifndef CONFIG_MM_KASAN_DISABLE_PANIC
|
#ifndef CONFIG_MM_KASAN_DISABLE_PANIC
|
||||||
PANIC();
|
PANIC();
|
||||||
#else
|
#else
|
||||||
dump_stack();
|
dump_stack();
|
||||||
#endif
|
#endif
|
||||||
}
|
|
||||||
|
|
||||||
--recursion;
|
|
||||||
leave_critical_section(flags);
|
leave_critical_section(flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user