mirror of
https://github.com/apache/nuttx.git
synced 2026-05-23 23:28:29 +08:00
mm/kasan: add null pointer access configuration
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
This commit is contained in:
@@ -288,6 +288,12 @@ config MM_KASAN_ALL
|
||||
to check. Enabling this option will get image size increased
|
||||
and performance decreased significantly.
|
||||
|
||||
config MM_KASAN_DISABLE_NULL_POINTER_CHECK
|
||||
bool "Disable null pointer access check"
|
||||
default n
|
||||
---help---
|
||||
This option enables KASan check null pointer access.
|
||||
|
||||
config MM_KASAN_DISABLE_READS_CHECK
|
||||
bool "Disable reads check"
|
||||
depends on MM_KASAN
|
||||
|
||||
@@ -173,10 +173,12 @@ static inline void kasan_check_report(FAR const void *addr, size_t size,
|
||||
return;
|
||||
}
|
||||
|
||||
#ifndef CONFIG_MM_KASAN_DISABLE_NULL_POINTER_CHECK
|
||||
if (addr == NULL)
|
||||
{
|
||||
kasan_report(addr, size, is_write, return_address);
|
||||
}
|
||||
#endif
|
||||
|
||||
if (kasan_is_poisoned(addr, size))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user