xiaoxiang781216 commented on code in PR #17300:
URL: https://github.com/apache/nuttx/pull/17300#discussion_r2513445006


##########
sched/sched/sched_lock.c:
##########
@@ -76,13 +76,13 @@ void sched_lock(void)
        * integer type.
        */
 
-      DEBUGASSERT(rtcb == NULL || rtcb->lockcount < MAX_LOCK_COUNT);
+      DEBUGASSERT(rtcb && rtcb->lockcount < MAX_LOCK_COUNT);

Review Comment:
   > > I have tested some QEMU Armv8-M scenarios, and null pointers do not 
necessarily trigger errors
   > 
   > @xiaoxiang781216 @hujun260
   > 
   > Nice catch! I think you could submit an MPU protection patch to the QEMU 
architecture :)
   > 
   
   it's not special to qemu, but a common problem. After you fix all projects 
under nuttx/boards folder, NULL check is required.
   
   > Also, if you believe that NULL pointer access doesn't require hardware 
restrictions, I think your product has significant security issues.
   
   I just talk the mainline projects, don't extend the situation to other 
project you don't know.
   



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to