You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2022/08/01 08:03:59 UTC

[GitHub] [incubator-nuttx] anchao opened a new pull request, #6749: mm/kasan: node header should updated from poisoning memory

anchao opened a new pull request, #6749:
URL: https://github.com/apache/incubator-nuttx/pull/6749

   ## Summary
   
   mm/kasan: node header should updated from poisoning memory
   
   ```
   | (gdb) bt
   | #0  up_assert (filename=0x7fffffffdc6c "\001", lineno=0) at sim/up_assert.c:75
   | #1  0x00005555555e636b in _assert (filename=0x555555627225 "kasan/kasan.c", linenum=104) at assert/lib_assert.c:36
   | #2  0x00005555555a388e in kasan_report (addr=140737284458088, size=1, is_write=true) at kasan/kasan.c:104
   | #3  0x00005555555a40a1 in __asan_storeN_noabort (addr=140737284458088, size=1) at kasan/kasan.c:297
   | #4  0x00005555555a4519 in __asan_store1_noabort (addr=140737284458088) at kasan/kasan.c:348
   | #5  0x00005555555a26d7 in memset (s=0x7ffff3d8c668, c=0, n=63) at string/lib_memset.c:169
   | #6  0x00005555555a46a4 in mm_addregion (heap=0x7ffff3d8c000, heapstart=0x7ffff3d8c648, heapsize=66058656) at mm_heap/mm_initialize.c:131
   | #7  0x00005555555a4a00 in mm_initialize (name=0x555555627068 "Umem", heapstart=0x7ffff3d8c648, heapsize=67107256) at mm_heap/mm_initialize.c:231
   | #8  0x00005555555a33b1 in umm_initialize (heap_start=0x7ffff3d8c000, heap_size=67108864) at umm_heap/umm_initialize.c:84
   | #9  0x000055555558f17c in nx_start () at init/nx_start.c:469
   | #10 0x0000555555589559 in main (argc=1, argv=0x7fffffffdf58, envp=0x7fffffffdf68) at sim/up_head.c:131
   | (gdb)
   
   ```
   
   ## Impact
   
   N/A
   
   ## Testing
   
   sim/kasan
   
   enable config:
   CONFIG_DEBUG_MM=y
   CONFIG_MM_BACKTRACE=8
   CONFIG_MM_BACKTRACE_DEFAULT=y
   CONFIG_MM_DUMP_ON_FAILURE=y
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-nuttx] xiaoxiang781216 merged pull request #6749: mm/kasan: node header should updated from unpoisoning memory

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 merged PR #6749:
URL: https://github.com/apache/incubator-nuttx/pull/6749


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-nuttx] anchao commented on a diff in pull request #6749: mm/kasan: node header should updated from unpoisoning memory

Posted by GitBox <gi...@apache.org>.
anchao commented on code in PR #6749:
URL: https://github.com/apache/incubator-nuttx/pull/6749#discussion_r934632587


##########
mm/mm_heap/mm_malloc.c:
##########
@@ -239,6 +238,7 @@ FAR void *mm_malloc(FAR struct mm_heap_s *heap, size_t size)
   if (ret)
     {
       kasan_unpoison(ret, mm_malloc_size(ret));
+      MM_ADD_BACKTRACE(heap, node);

Review Comment:
   Done



##########
mm/mm_heap/mm_memalign.c:
##########
@@ -227,5 +226,7 @@ FAR void *mm_memalign(FAR struct mm_heap_s *heap, size_t alignment,
   kasan_unpoison((FAR void *)alignedchunk,
                  mm_malloc_size((FAR void *)alignedchunk));
 
+  MM_ADD_BACKTRACE(heap, node);

Review Comment:
   Done



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-nuttx] xiaoxiang781216 commented on a diff in pull request #6749: mm/kasan: node header should updated from unpoisoning memory

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on code in PR #6749:
URL: https://github.com/apache/incubator-nuttx/pull/6749#discussion_r934625210


##########
mm/mm_heap/mm_memalign.c:
##########
@@ -227,5 +226,7 @@ FAR void *mm_memalign(FAR struct mm_heap_s *heap, size_t alignment,
   kasan_unpoison((FAR void *)alignedchunk,
                  mm_malloc_size((FAR void *)alignedchunk));
 
+  MM_ADD_BACKTRACE(heap, node);

Review Comment:
   ditto



##########
mm/mm_heap/mm_malloc.c:
##########
@@ -239,6 +238,7 @@ FAR void *mm_malloc(FAR struct mm_heap_s *heap, size_t size)
   if (ret)
     {
       kasan_unpoison(ret, mm_malloc_size(ret));
+      MM_ADD_BACKTRACE(heap, node);

Review Comment:
   move before kasan_unpoison



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org