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 2021/12/09 05:44:43 UTC

[GitHub] [incubator-nuttx] anchao opened a new pull request #4961: arch/arm/assert: fix the stack dump overflow

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


   
   
   ## Summary
   
   arch/arm/assert: fix the stack dump overflow
   
   ```
   [ EMERG] kasan_report: kasan detected a read access error, address at 0x3c24fca8, size is 4
   [ EMERG] up_assert: Assertion failed at file:kasan/kasan.c line: 104 task: init
   [ EMERG] backtrace|10:  0x2c334666 0x2c35f0d6 0x2c359ef6 0x2c35f830 0x2c360ed4 0x2c3615c0 0x2c324e0c 0x2c30a168
   [ EMERG] up_registerdump: R0: ffffffff R1: 00000004 R2: ffffffff R3: ffffffff
   [ EMERG] up_registerdump: R4: 3c20d4f0 R5: 2c35acd5 R6: 00000000 FP: 3c24fae8
   [ EMERG] up_registerdump: R8: 3c20d504 SB: ffffffff SL: 2c413e7c R11: 2c411eb8
   [ EMERG] up_registerdump: IP: 00000002 SP: 3c24fae8 LR: 00000003 PC: 2c35f0d6
   [ EMERG] up_registerdump: xPSR: 61010000 BASEPRI: 000000e0 CONTROL: 00000004
   ```
   
   Signed-off-by: chao.an <an...@xiaomi.com>
   
   ## Impact
   
   N/A
   
   ## Testing
   
   stack dump with kasan


-- 
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 #4961: arch/arm/assert: fix the stack dump overflow

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


   


-- 
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 change in pull request #4961: arch/arm/assert: fix the stack dump overflow

Posted by GitBox <gi...@apache.org>.
anchao commented on a change in pull request #4961:
URL: https://github.com/apache/incubator-nuttx/pull/4961#discussion_r767447828



##########
File path: arch/arm/src/armv6-m/arm_assert.c
##########
@@ -76,7 +76,7 @@ static void up_stackdump(uint32_t sp, uint32_t stack_top)
 {
   uint32_t stack;
 
-  for (stack = sp & ~0x1f; stack < stack_top; stack += 32)
+  for (stack = sp & ~0x1f; stack < stack_top - 32; stack += 32)

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 change in pull request #4961: arch/arm/assert: fix the stack dump overflow

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on a change in pull request #4961:
URL: https://github.com/apache/incubator-nuttx/pull/4961#discussion_r765453185



##########
File path: arch/arm/src/armv6-m/arm_assert.c
##########
@@ -76,7 +76,7 @@ static void up_stackdump(uint32_t sp, uint32_t stack_top)
 {
   uint32_t stack;
 
-  for (stack = sp & ~0x1f; stack < stack_top; stack += 32)
+  for (stack = sp & ~0x1f; stack < stack_top - 32; stack += 32)

Review comment:
       let's modify other arch too

##########
File path: arch/arm/src/arm/arm_assert.c
##########
@@ -77,7 +77,7 @@ static void up_stackdump(uint32_t sp, uint32_t stack_top)
 {
   uint32_t stack;
 
-  for (stack = sp & ~0x1f; stack < stack_top; stack += 32)
+  for (stack = sp & ~0x1f; stack < stack_top - 32; stack += 32)

Review comment:
       should be stack_top &~0x1f




-- 
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