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

   Solve the problem of address misalignment exception triggered when 
sched_note_add parses note data.
   
   *Note: Please adhere to [Contributing 
Guidelines](https://github.com/apache/nuttx/blob/master/CONTRIBUTING.md).*
   
   ## Summary
   
   This PR fixes a data address alignment issue in the NuttX note driver 
subsystem.
   Previously, the sched_note_add and noterpmsg_add functions used the raw note 
length (notelen) for pointer arithmetic and buffer management.
   On platforms with strict alignment requirements, this could cause misaligned 
memory accesses and trigger exceptions.
   
   The patch updates all relevant pointer and buffer operations to use 
NOTE_ALIGN(notelen) instead of notelen, ensuring that all note data is properly 
aligned during parsing and storage.
   
   ## Impact
   
   - Prevents address misalignment exceptions when handling note data.
   - Improves compatibility and stability on architectures with strict 
alignment requirements.
   - No impact on platforms that do not enforce alignment.
   
   ## Testing
   
   - Verified on hardware platforms with strict alignment requirements.
   - No misalignment exceptions observed after applying the patch.
   - Note data is correctly parsed and stored in all tested scenarios.
   
   


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