Skip to content

Commit dd491ee

Browse files
committed
Merge branch 'doc/fatal_errors_memprot' into 'master'
docs: describe memprot faults in the panic handler documentation See merge request espressif/esp-idf!14916
2 parents d504ca6 + 1238253 commit dd491ee

File tree

3 files changed

+27
-10
lines changed

3 files changed

+27
-10
lines changed

docs/en/api-guides/fatal-errors.rst

Lines changed: 25 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,17 @@ In certain situations, execution of the program can not be continued in a well d
1212
- CPU Exceptions: |CPU_EXCEPTIONS_LIST|
1313
- System level checks and safeguards:
1414

15-
- :doc:`Interrupt watchdog <../api-reference/system/wdts>` timeout
16-
- :doc:`Task watchdog <../api-reference/system/wdts>` timeout (only fatal if :ref:`CONFIG_ESP_TASK_WDT_PANIC` is set)
17-
- Cache access error
18-
- Brownout detection event
19-
- Stack overflow
20-
- Stack smashing protection check
21-
- Heap integrity check
22-
- Undefined behavior sanitizer (UBSAN) checks
15+
.. list::
16+
17+
- :doc:`Interrupt watchdog <../api-reference/system/wdts>` timeout
18+
- :doc:`Task watchdog <../api-reference/system/wdts>` timeout (only fatal if :ref:`CONFIG_ESP_TASK_WDT_PANIC` is set)
19+
- Cache access error
20+
:CONFIG_ESP_SYSTEM_MEMPROT_FEATURE: - Memory protection fault
21+
- Brownout detection event
22+
- Stack overflow
23+
- Stack smashing protection check
24+
- Heap integrity check
25+
- Undefined behavior sanitizer (UBSAN) checks
2326

2427
- Failed assertions, via ``assert``, ``configASSERT`` and similar macros.
2528

@@ -373,6 +376,20 @@ Indicates that interrupt watchdog timeout has occured. See :doc:`Watchdogs <../a
373376

374377
In some situations ESP-IDF will temporarily disable access to external SPI Flash and SPI RAM via caches. For example, this happens with spi_flash APIs are used to read/write/erase/mmap regions of SPI Flash. In these situations, tasks are suspended, and interrupt handlers not registered with ``ESP_INTR_FLAG_IRAM`` are disabled. Make sure that any interrupt handlers registered with this flag have all the code and data in IRAM/DRAM. Refer to the :ref:`SPI flash API documentation <iram-safe-interrupt-handlers>` for more details.
375378

379+
.. only:: CONFIG_ESP_SYSTEM_MEMPROT_FEATURE
380+
381+
Memory protection fault
382+
^^^^^^^^^^^^^^^^^^^^^^^
383+
384+
{IDF_TARGET_NAME} Permission Control feature is used in ESP-IDF to prevent the following types of memory access:
385+
386+
* writing to instruction RAM after the program is loaded
387+
* executing code from data RAM (areas used for heap and static .data and .bss)
388+
389+
Such operations are not necessary for most programs. Prohibiting such operations typically makes software vulnerabilities harder to exploit. Applications which rely on dynamic loading or self-modifying code may disable this protection using :ref:`CONFIG_ESP_SYSTEM_MEMPROT_FEATURE` Kconfig option.
390+
391+
When the fault occurs, the panic handler reports the address of the fault and the type of memory access that caused it.
392+
376393
Other Fatal Errors
377394
------------------
378395

docs/en/api-reference/storage/spi_flash_concurrency.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ There are no such constraints and impacts for flash chips on other SPI buses tha
2424

2525
For differences between IRAM, DRAM, and flash cache, please refer to the :ref:`application memory layout <memory-layout>` documentation.
2626

27-
.. only: not CONFIG_FREERTOS_UNICORE
27+
.. only:: not CONFIG_FREERTOS_UNICORE
2828

2929
To avoid reading flash cache accidentally, when one CPU initiates a flash write or erase operation, the other CPU is put into a blocked state, and all non-IRAM-safe interrupts are disabled on all CPUs until the flash operation completes.
3030

docs/zh_CN/api-reference/storage/spi_flash_concurrency.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ SPI1 Flash 并发约束
2424

2525
请参阅 :ref:`应用程序内存分布 <memory-layout>`,查看 IRAM、DRAM 和 flash cache 的区别。
2626

27-
.. only: not CONFIG_FREERTOS_UNICORE
27+
.. only:: not CONFIG_FREERTOS_UNICORE
2828

2929
为避免意外读取 flash cache,一个 CPU 在启动 flash 写入或擦除操作时,另一个 CPU 将阻塞,并且在 flash 操作完成前,所有 CPU 上,所有的非 IRAM 安全的中断都会被禁用。
3030

0 commit comments

Comments
 (0)