HARD FAULT: Add sanity check to sx126x driver when handling retention list#72
Open
MarekNovakACRIOS wants to merge 1 commit intoLora-net:masterfrom
Open
HARD FAULT: Add sanity check to sx126x driver when handling retention list#72MarekNovakACRIOS wants to merge 1 commit intoLora-net:masterfrom
MarekNovakACRIOS wants to merge 1 commit intoLora-net:masterfrom
Conversation
Author
|
Also backported for loramac-node: Lora-net/LoRaMac-node#1615 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
If an invalid value is read and present in buffer[0], then :
here happens reading out of bounds of the buffer[] array.
Even more - the buffer[0] is made on stack:
Which is ok, but in combination with the bug above and with the fact, that the stack is in 99.9% cases placed at the end of the RAM, this will cause reading values in an address which is out of bound of RAM/SRAM and therefore a hardfault/memfault/crash will be generated.
The issue can happen and an invalid value can be read out of SX1261 due to power variation, EMC, etc.. and happened to me, when stressing and testing my hardware and generating variations of power of SX1261 close to the allowed voltage area.
This should not happen during normal operation, but it CAN happen - and it is not ok to take down the whole microcontroller system in that case.