nuttx/mm
ligd d84c546d47 mm: Add double-free detection to delay list
When same memory is freed twice and both added to delay list
(race condition in interrupt context), it causes crash later
in mm_forcefree() when processing the delay list.

This patch adds early detection in add_delaylist() using:
1. Magic value (addr ^ 0xDEADBEEF) for O(1) fast path
2. List traversal for confirmation when magic matches

The double-free will be caught immediately with DEBUGASSERT
instead of crashing later in free_delaylist()

Changes:
- Add MM_DELAY_MAGIC and magic field to mm_delaynode_s
- Implement two-step detection in add_delaylist()
- Sync implementation across mm_heap and tlsf allocators

Signed-off-by: ligd <liguiding1@xiaomi.com>
2026-04-21 01:35:58 +08:00
..
iob net/pkt: support option SO_TIMESTAMPING and MSG_ERRQUEUE 2026-04-21 01:35:35 +08:00
kasan kasan/unregister: Modify the logic of unpoison 2026-04-21 01:35:57 +08:00
kmap fix the compilation error 2026-04-21 01:31:48 +08:00
kmm_heap mm: Change mm_initialize_heap/mm_initialize_pool to return int, heap via out param 2026-04-21 01:35:53 +08:00
map mm/map: remove error log unmap 2026-04-21 01:35:32 +08:00
mempool mempool_multiple: coverity warning fix 2026-04-21 01:35:38 +08:00
mm_gran mm_grantable.c: Fix infinite loop due to memory fragmentation 2026-04-21 01:23:15 +08:00
mm_heap mm: Add double-free detection to delay list 2026-04-21 01:35:58 +08:00
pool_heap fs/procfs: change procfs_register_meminfo to allocate entry dynamically 2026-04-21 01:35:53 +08:00
shm Merge branch 'master' into vela 2026-04-21 01:12:27 +08:00
tlsf mm: Add double-free detection to delay list 2026-04-21 01:35:58 +08:00
ubsan assert: remove its noreturn declaration 2026-04-21 01:33:31 +08:00
umm_heap mm: Change mm_initialize_heap/mm_initialize_pool to return int, heap via out param 2026-04-21 01:35:53 +08:00
CMakeLists.txt Merge branch 'master' into vela 2026-04-21 01:12:27 +08:00
Kconfig kmm/umm mempool config init for MM_POOL_MANAGER 2026-04-21 01:34:00 +08:00
Makefile MM_POOL_MANAGER feature, support mempool only for mm 2026-04-21 01:34:00 +08:00