zephyr/subsys
Tobias Svehagen 50ed105d05 fs: nvs: Fix handling of corrupt ate's in garbage collector
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>
2020-06-26 12:07:13 -05:00
..
bluetooth Bluetooth: host: Fix adv object not released on directed adv timeout 2020-06-25 19:34:16 +02:00
canbus
console console: tty: Fix k_sem_take with wait time from ISR 2020-06-17 17:10:08 +02:00
cpp cpp: Fixed compile warning with extern array declaration 2020-06-09 14:42:16 +02:00
debug
dfu dfu: flash_img: Constify flash_img_buffered_write() data parameter 2020-06-10 09:30:08 +02:00
disk
fb
fs fs: nvs: Fix handling of corrupt ate's in garbage collector 2020-06-26 12:07:13 -05:00
jwt
logging logging: enhanced external logsystems 2020-06-17 17:08:12 +02:00
mgmt mgmt: fs: Add security warning 2020-06-12 11:15:24 +02:00
net net: conn: Handle multi interface AF_PACKET recv() properly 2020-06-24 23:34:27 +03:00
power device: provide internal access to static device array 2020-06-23 13:27:14 +02:00
random
settings settings: Fix uninitialised variables 2020-06-17 08:55:59 +03:00
shell shell: kernel: select dependencies 2020-06-24 21:37:12 -04:00
stats
storage storage/stream: allow NULL data pointer 2020-06-22 14:36:05 +02:00
testsuite test: remove TEST_SHELL 2020-06-24 21:37:12 -04:00
tracing
usb usb: Correct USB setup packet endianness in USB core. 2020-06-23 19:21:41 +02:00
CMakeLists.txt
Kconfig