mirror of
https://github.com/zephyrproject-rtos/zephyr
synced 2025-08-13 19:00:21 +00:00
nvs_gc does not verify the crc8 of close_ate before using close_ate.offset. This means that close_ate.offset could contain an offset that points beyond valid ate's in the sector. For example, there might be a valid ate at offset 0x100 but close_ate.offset is 0x200. If that is the case that value will not be moved and so it will be lost. Solve this by refactoring the recovery loop from nvs_prev_ate into nvs_recover_last_ate and use that function in nvs_gc if a corrupt close_ate is found. The crc8 of gc_ate is not checked before trying to find another ate with the same id. If there are no valid ate with that id in the whole fs the inner while(1)-loop will never stop since the break condition includes a check for a correct crc8. Solve this by skipping gc_ate's with an invalid crc8. Fixes #26407 Signed-off-by: Tobias Svehagen <tobias.svehagen@gmail.com> |
||
---|---|---|
.. | ||
bluetooth | ||
canbus | ||
console | ||
cpp | ||
debug | ||
dfu | ||
disk | ||
fb | ||
fs | ||
jwt | ||
logging | ||
mgmt | ||
net | ||
power | ||
random | ||
settings | ||
shell | ||
stats | ||
storage | ||
testsuite | ||
tracing | ||
usb | ||
CMakeLists.txt | ||
Kconfig |