forked from openvela/nuttx
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> |
||
|---|---|---|
| .. | ||
| iob | ||
| kasan | ||
| kmap | ||
| kmm_heap | ||
| map | ||
| mempool | ||
| mm_gran | ||
| mm_heap | ||
| pool_heap | ||
| shm | ||
| tlsf | ||
| ubsan | ||
| umm_heap | ||
| CMakeLists.txt | ||
| Kconfig | ||
| Makefile | ||