zhhyu7 opened a new pull request, #18664:
URL: https://github.com/apache/nuttx/pull/18664

   ## Summary
   Move conn_unlock() after the data event handling in can_callback() and 
udp_callback().
   
   ## Impact
   Previously, the connection lock was released immediately after 
devif_conn_event(), leaving the subsequent can_data_event() / net_dataevent() 
and read-ahead buffer operations unprotected. This could lead to a race 
condition where another context modifies the connection state while data is 
being stored into the read-ahead buffer.
   
   This PR moves conn_unlock() to after the entire callback processing is 
complete, ensuring the connection remains locked during both the event dispatch 
and the data buffering phases.
   
   ## Testing
   Build and runtime test on CAN and UDP network configurations. Verified no 
deadlock or lock ordering issues introduced by extending the lock hold 
duration. And the issue that high-priority recv after poll fails to read data 
has also been resolved.
   


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