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

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

commit a5262aafd9b7b2f16379c4f50ab5af125951a250
Author: Yongrong Wang <[email protected]>
AuthorDate: Wed Apr 30 17:06:00 2025 +0800

    addrenv.c: reset kasan tag when va convert to pa
    
    if enable kasan tag, va is not correct when convert to pa,
    so it is necessary to restore it to the original correct address
    
    Signed-off-by: Yongrong Wang <[email protected]>
    Signed-off-by: wangjianyu3 <[email protected]>
---
 drivers/misc/addrenv.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/misc/addrenv.c b/drivers/misc/addrenv.c
index bf32e154f2c..136e5a93d69 100644
--- a/drivers/misc/addrenv.c
+++ b/drivers/misc/addrenv.c
@@ -27,6 +27,7 @@
 #include <nuttx/config.h>
 #include <nuttx/list.h>
 #include <nuttx/kmalloc.h>
+#include <nuttx/mm/kasan.h>
 
 #include <string.h>
 
@@ -94,7 +95,7 @@ uintptr_t up_addrenv_va_to_pa(FAR void *va_)
 {
   FAR struct simple_addrenv_node_s *node;
   FAR const struct simple_addrenv_s *addrenv;
-  uintptr_t va = (uintptr_t)va_;
+  uintptr_t va = (uintptr_t)kasan_clear_tag(va_);
   uint32_t i;
 
   list_for_every_entry(&g_addrenv_list, node,

Reply via email to