fix(coredump): don't allow mapping of non-encrypted coredump partition

This commit is contained in:
Erhan Kurubas 2024-05-06 15:39:02 +02:00
parent d744aefcec
commit d2dd264c64

View File

@ -774,6 +774,14 @@ static esp_err_t elf_core_dump_image_mmap(esp_partition_mmap_handle_t* core_data
return err;
}
/* Data read from the mmapped core dump partition will be garbage if flash
* encryption is enabled in hardware and core dump partition is not encrypted
*/
if (esp_flash_encryption_enabled() && !core_part->encrypted) {
ESP_COREDUMP_LOGE("Flash encryption enabled in hardware and core dump partition is not encrypted!");
return ESP_ERR_NOT_SUPPORTED;
}
/* map the full core dump partition, including the checksum. */
return esp_partition_mmap(core_part, 0, out_size, ESP_PARTITION_MMAP_DATA,
map_addr, core_data_handle);