Просмотр исходного кода

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
Martin Vychodil 4 лет назад
Родитель
Сommit
ec6745a137
2 измененных файлов с 2 добавлено и 2 удалено
  1. 1 1
      components/esp_system/port/panic_handler.c
  2. 1 1
      components/esp_system/system_api.c

+ 1 - 1
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;
     }

+ 1 - 1
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;
     }