mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
fix(coredump): fix buffer overflow inside esp_core_dump_get_summary
Closes https://github.com/espressif/esp-idf/issues/13754
This commit is contained in:
parent
8dd40eeeda
commit
d72b765404
@ -933,7 +933,7 @@ static void elf_parse_version_info(esp_core_dump_summary_t *summary, void *data)
|
|||||||
{
|
{
|
||||||
core_dump_elf_version_info_t *version = (core_dump_elf_version_info_t *)data;
|
core_dump_elf_version_info_t *version = (core_dump_elf_version_info_t *)data;
|
||||||
summary->core_dump_version = version->version;
|
summary->core_dump_version = version->version;
|
||||||
memcpy(summary->app_elf_sha256, version->app_elf_sha256, ELF_APP_SHA256_SIZE);
|
memcpy(summary->app_elf_sha256, version->app_elf_sha256, sizeof(summary->app_elf_sha256));
|
||||||
ESP_COREDUMP_LOGD("Core dump version 0x%x", summary->core_dump_version);
|
ESP_COREDUMP_LOGD("Core dump version 0x%x", summary->core_dump_version);
|
||||||
ESP_COREDUMP_LOGD("App ELF SHA2 %s", (char *)summary->app_elf_sha256);
|
ESP_COREDUMP_LOGD("App ELF SHA2 %s", (char *)summary->app_elf_sha256);
|
||||||
}
|
}
|
||||||
|
@ -285,6 +285,11 @@ void test_coredump_summary(void)
|
|||||||
if (err == ESP_OK) {
|
if (err == ESP_OK) {
|
||||||
printf("App ELF file SHA256: %s\n", (char *)summary->app_elf_sha256);
|
printf("App ELF file SHA256: %s\n", (char *)summary->app_elf_sha256);
|
||||||
printf("Crashed task: %s\n", summary->exc_task);
|
printf("Crashed task: %s\n", summary->exc_task);
|
||||||
|
#if __XTENSA__
|
||||||
|
printf("Exception cause: %ld\n", summary->ex_info.exc_cause);
|
||||||
|
#else
|
||||||
|
printf("Exception cause: %ld\n", summary->ex_info.mcause);
|
||||||
|
#endif
|
||||||
char panic_reason[200];
|
char panic_reason[200];
|
||||||
err = esp_core_dump_get_panic_reason(panic_reason, sizeof(panic_reason));
|
err = esp_core_dump_get_panic_reason(panic_reason, sizeof(panic_reason));
|
||||||
if (err == ESP_OK) {
|
if (err == ESP_OK) {
|
||||||
|
@ -1024,6 +1024,10 @@ def _test_coredump_summary(dut: PanicTestDut, flash_encrypted: bool, coredump_en
|
|||||||
return
|
return
|
||||||
dut.expect_elf_sha256('App ELF file SHA256: ')
|
dut.expect_elf_sha256('App ELF file SHA256: ')
|
||||||
dut.expect_exact('Crashed task: main')
|
dut.expect_exact('Crashed task: main')
|
||||||
|
if dut.is_xtensa:
|
||||||
|
dut.expect_exact('Exception cause: 29')
|
||||||
|
else:
|
||||||
|
dut.expect_exact('Exception cause: 7')
|
||||||
dut.expect(PANIC_ABORT_PREFIX + r'assert failed:[\s\w()]*?\s[.\w/]*\.(?:c|cpp|h|hpp):\d.*$')
|
dut.expect(PANIC_ABORT_PREFIX + r'assert failed:[\s\w()]*?\s[.\w/]*\.(?:c|cpp|h|hpp):\d.*$')
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user