Skip to content

Commit 5e817df

Browse files
committed
fix(coredump): don't allow mapping of non-encrypted coredump partition
1 parent bd8d7ea commit 5e817df

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

components/espcoredump/src/core_dump_elf.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -778,6 +778,14 @@ static esp_err_t elf_core_dump_image_mmap(esp_partition_mmap_handle_t* core_data
778778
return err;
779779
}
780780

781+
/* Data read from the mmapped core dump partition will be garbage if flash
782+
* encryption is enabled in hardware and core dump partition is not encrypted
783+
*/
784+
if (esp_flash_encryption_enabled() && !core_part->encrypted) {
785+
ESP_COREDUMP_LOGE("Flash encryption enabled in hardware and core dump partition is not encrypted!");
786+
return ESP_ERR_NOT_SUPPORTED;
787+
}
788+
781789
/* map the full core dump partition, including the checksum. */
782790
return esp_partition_mmap(core_part, 0, out_size, ESP_PARTITION_MMAP_DATA,
783791
map_addr, core_data_handle);

0 commit comments

Comments
 (0)