This is an automated email from the ASF dual-hosted git repository.

raiden00pl pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git

commit dd86c9240561dcb92b47012bee8178a4f7150513
Author: leisiji <[email protected]>
AuthorDate: Tue Jun 9 10:22:28 2026 +0800

    mm/umm_heap: disable KASAN for user-space heap in kernel build
    
    When CONFIG_BUILD_KERNEL is enabled, user-space and kernel-space have
    separate address spaces. User-space addresses passed via syscalls
    (e.g., open) are registered by KASAN but should not be monitored,
    as they are not kernel heap allocations. This causes KASAN to
    report false positives on user-space pointers accessed through
    system calls.
    
    Mark the user-space heap with nokasan=true so KASAN skips checking
    its address range, consistent with how rptun already handles this.
    
    Signed-off-by: leisiji <[email protected]>
---
 mm/umm_heap/umm_initialize.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/mm/umm_heap/umm_initialize.c b/mm/umm_heap/umm_initialize.c
index 58a63f41083..66b13a7fce4 100644
--- a/mm/umm_heap/umm_initialize.c
+++ b/mm/umm_heap/umm_initialize.c
@@ -92,6 +92,7 @@ void umm_initialize(FAR void *heap_start, size_t heap_size)
   config.start = heap_start;
   config.size  = heap_size;
 #ifdef CONFIG_BUILD_KERNEL
+  config.nokasan = true;
   USR_HEAP = mm_initialize_pool(&config, NULL);
 #else
   config.name = "Umem";

Reply via email to