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

   ## Summary
   
   All STM32 SDIO/SDMMC drivers are affected by this bug which comes from the 
original addition of interrupt handing to the base STM32 SDIO driver in 2009 
(https://github.com/apache/nuttx/commit/373959f7dbce2233c56f0267a31deab67edd7aa4).
   
   When the buffer to send has a size not multiple of 4 bytes, 4-byte words are 
sent correctly, but when the code reaches the section to send the remaining 
bytes (1, 2 or 3) it takes the *remaining byte count* as origin of the copy, 
instead of the *buffer* (as it should). The explicit cast (used to convert a 
uint32_t pointer to a uint8_t pointer) prevents the compiler warning/error to 
appear and hides the fact an integer (non-pointer) is used as a pointer.
   
   ## Impact
   
   This has been around since 2009 and has not triggered, probably because most 
(all?) SDIO transfers are word-sized so that section of the code is not being 
used at all.
   
   ## Testing
   
   The change has been tested on custom HW, using STM32H5, with STM32H7 SDMMC 
driver ported (it requires almost no changes to work on STM32H5). This has no 
effect (meaning: the driver still works after this change). I have not been 
able to find a use case triggering the bug, so I can not really test that this 
fixes it.


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