From f00234fb1347b80acb847a465c850489ba477470 Mon Sep 17 00:00:00 2001 From: Guillaume Souchere Date: Fri, 29 Sep 2023 10:49:51 +0200 Subject: [PATCH] fix(doc): Add warning that canary check not supported for TLSF in ROM The function heap_caps_check_integrity does not perform canary check on used block as documented. The problem is fixed in the heap component but no patch is provided for the ROM implementation. Update the documentation with a warning for the targets supporting the TLSF implementation in ROM feature. --- docs/en/api-reference/system/heap_debug.rst | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/docs/en/api-reference/system/heap_debug.rst b/docs/en/api-reference/system/heap_debug.rst index 4a4517a7d6..b9ce083c48 100644 --- a/docs/en/api-reference/system/heap_debug.rst +++ b/docs/en/api-reference/system/heap_debug.rst @@ -154,6 +154,11 @@ In both cases, the functions involve checking that the first 4 bytes of an alloc Different values usually indicate buffer underrun or overrun. Overrun indicates that when writing to memory, the data written exceeds the size of the allocated memory, resulting in writing to an unallocated memory area; underrun indicates that when reading memory, the data read exceeds the allocated memory and reads data from an unallocated memory area. +.. only:: CONFIG_ESP_ROM_HAS_HEAP_TLSF + + .. warning:: + + When the ROM implementation of the heap TLSF is used, note that :cpp:func:`heap_caps_check_integrity` will not perform the check of the canary bytes. Comprehensive +++++++++++++ @@ -179,6 +184,12 @@ Calls to :cpp:func:`heap_caps_check_integrity` may print errors relating to ``0x - For free heap blocks, the checker expects to find all bytes set to ``0xFE``. Any other values indicate a use-after-free bug where free memory has been incorrectly overwritten. - For allocated heap blocks, the behavior is the same as for the Light Impact mode. The canary bytes ``0xABBA1234`` and ``0xBAAD5678`` are checked at the head and tail of each allocated buffer, and any variation indicates a buffer overrun or underrun. +.. only:: CONFIG_ESP_ROM_HAS_HEAP_TLSF + + .. warning:: + + When the ROM implementation of the heap TLSF is used, note that :cpp:func:`heap_caps_check_integrity` will not perform the check of the canary bytes. + .. _heap-task-tracking: Heap Task Tracking