From ec6745a1376f222dc4b1349205d3ddb32d7e4a79 Mon Sep 17 00:00:00 2001 From: Martin Vychodil Date: Tue, 5 Oct 2021 11:58:31 +0200 Subject: [PATCH] System/Security: wrong check of the Memprot feature in esp_restart()/panic_restart() esp_restart()/panic_restart() never resets the Digital system (so far required only by the Memprot feature) as there's a typo in the corresponding #define: it checks CONFIG_ESP_SYSTEM_CONFIG_MEMPROT_FEATURE instead of CONFIG_ESP_SYSTEM_MEMPROT_FEATURE. Issue fixed. IDF-4094 --- components/esp_system/port/panic_handler.c | 2 +- components/esp_system/system_api.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/components/esp_system/port/panic_handler.c b/components/esp_system/port/panic_handler.c index 45a238acce..9acbacdd9c 100644 --- a/components/esp_system/port/panic_handler.c +++ b/components/esp_system/port/panic_handler.c @@ -228,7 +228,7 @@ void __attribute__((noreturn)) panic_restart(void) digital_reset_needed = true; } #endif -#if CONFIG_ESP_SYSTEM_CONFIG_MEMPROT_FEATURE +#if CONFIG_ESP_SYSTEM_MEMPROT_FEATURE if (esp_memprot_is_intr_ena_any() || esp_memprot_is_locked_any()) { digital_reset_needed = true; } diff --git a/components/esp_system/system_api.c b/components/esp_system/system_api.c index da96bf72e1..d20cb00102 100644 --- a/components/esp_system/system_api.c +++ b/components/esp_system/system_api.c @@ -76,7 +76,7 @@ void IRAM_ATTR esp_restart(void) vTaskSuspendAll(); bool digital_reset_needed = false; -#if CONFIG_ESP_SYSTEM_CONFIG_MEMPROT_FEATURE +#if CONFIG_ESP_SYSTEM_MEMPROT_FEATURE if (esp_memprot_is_intr_ena_any() || esp_memprot_is_locked_any()) { digital_reset_needed = true; }