mirror of
https://github.com/apache/nuttx.git
synced 2026-06-04 14:53:47 +08:00
mm: Support the kernel address sanitizer
Signed-off-by: chenwei23 <chenwei23@xiaomi.com>
This commit is contained in:
committed by
Gustavo Henrique Nihei
parent
5cb6b042aa
commit
39cdd99d77
@@ -31,6 +31,7 @@
|
||||
#include <nuttx/mm/mm.h>
|
||||
|
||||
#include "mm_heap/mm.h"
|
||||
#include "kasan/kasan.h"
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
@@ -86,6 +87,10 @@ void mm_addregion(FAR struct mm_heap_s *heap, FAR void *heapstart,
|
||||
DEBUGASSERT(heapsize <= MMSIZE_MAX + 1);
|
||||
#endif
|
||||
|
||||
/* Register to KASan for access check */
|
||||
|
||||
kasan_register(heapstart, &heapsize);
|
||||
|
||||
DEBUGVERIFY(mm_takesemaphore(heap));
|
||||
|
||||
/* Adjust the provided heap start and size so that they are both aligned
|
||||
|
||||
Reference in New Issue
Block a user