unleashed-firmware/furi/core
Kris Bahnsen 26da5f564b
furi/core/timer: resolve timer handle use-after-free post deletion (#3431)
When xTimerDelete is called using a dymanic timer handle, the timer
handle should immediately be considered unusable for any operation;
including checking if the timer is still running. Under high system
loads, that memory region may see fast reuse while furi_timer_free
is sleeping between timer active checks. That reuse could result in
memory at that pointer causing the timer active check to return true.

Rework the furi_timer_delete process (in the case of dynamically
allocated callback memory) to stop the timer, wait for it to stop,
free the memory, and then delete the timer. Timers without dynamically
allocated callback memory are just sent a delete command; no need
to stop it first.

Fixes: ff33bc6aea ("Furi: wait for timer wind down in destructor (#1716)")

Signed-off-by: Kris Bahnsen <Kris@KBEmbedded.com>
2024-02-08 16:22:03 +07:00
..
base.h Furi, FuriHal: remove FreeRTOS headers leaks (#3179) 2023-11-01 11:24:11 +04:00
check.c FuriHal: UART refactoring (#3211) 2024-01-16 03:09:37 +04:00
check.h Furi: cleanup crash use (#3175) 2023-10-31 14:40:32 +04:00
common_defines.h FuriHal: various GPIO improvements (#3406) 2024-02-07 12:09:29 +03:00
core_defines.h [FL-3330] fbt: added hooks for build & dist environments; added FW_ORIGIN_* macro for apps & SDK (#2705) 2023-05-30 01:40:56 +09:00
critical.c Furi, FuriHal: remove FreeRTOS headers leaks (#3179) 2023-11-01 11:24:11 +04:00
dangerous_defines.h Furi: core refactoring and CMSIS removal part 2 (#1410) 2022-07-20 13:56:33 +03:00
event_flag.c Furi, FuriHal: remove FreeRTOS headers leaks (#3179) 2023-11-01 11:24:11 +04:00
event_flag.h Furi: core refactoring and CMSIS removal part 2 (#1410) 2022-07-20 13:56:33 +03:00
kernel.c Furi, FuriHal: remove FreeRTOS headers leaks (#3179) 2023-11-01 11:24:11 +04:00
kernel.h Furi, FuriHal: remove FreeRTOS headers leaks (#3179) 2023-11-01 11:24:11 +04:00
log.c [FL-3669] Expansion module protocol (#3250) 2024-01-16 18:18:56 +09:00
log.h FuriHal: UART refactoring (#3211) 2024-01-16 03:09:37 +04:00
memmgr.c [FL-2627] Flipper applications: SDK, build and debug system (#1387) 2022-09-15 02:21:03 +09:00
memmgr.h Fix for spelling (#2051) 2022-11-29 01:51:51 +09:00
memmgr_heap.c FuriHal: UART refactoring (#3211) 2024-01-16 03:09:37 +04:00
memmgr_heap.h Fix for spelling (#2051) 2022-11-29 01:51:51 +09:00
message_queue.c Furi, FuriHal: remove FreeRTOS headers leaks (#3179) 2023-11-01 11:24:11 +04:00
message_queue.h Furi: core refactoring and CMSIS removal part 2 (#1410) 2022-07-20 13:56:33 +03:00
mutex.c FuriHal: UART refactoring (#3211) 2024-01-16 03:09:37 +04:00
mutex.h Furi: core refactoring and CMSIS removal part 2 (#1410) 2022-07-20 13:56:33 +03:00
pubsub.c Furi: core refactoring and CMSIS removal part 2 (#1410) 2022-07-20 13:56:33 +03:00
pubsub.h Furi: core refactoring and CMSIS removal part 2 (#1410) 2022-07-20 13:56:33 +03:00
record.c M*LIB: non-inlined strings, FuriString primitive (#1795) 2022-10-06 00:15:23 +09:00
record.h fbt: fixed include paths; added PVS-Studio configuration (#1615) 2022-08-23 02:06:17 +09:00
semaphore.c Furi, FuriHal: remove FreeRTOS headers leaks (#3179) 2023-11-01 11:24:11 +04:00
semaphore.h Furi: core refactoring and CMSIS removal part 2 (#1410) 2022-07-20 13:56:33 +03:00
stream_buffer.c Furi, FuriHal: remove FreeRTOS headers leaks (#3179) 2023-11-01 11:24:11 +04:00
stream_buffer.h [FL-3669] Expansion module protocol (#3250) 2024-01-16 18:18:56 +09:00
string.c Fix M*LIB usage (#2762) 2023-06-27 19:50:09 +09:00
string.h Fix M*LIB usage (#2762) 2023-06-27 19:50:09 +09:00
thread.c FuriHal: UART refactoring (#3211) 2024-01-16 03:09:37 +04:00
thread.h Furi, FuriHal: remove FreeRTOS headers leaks (#3179) 2023-11-01 11:24:11 +04:00
timer.c furi/core/timer: resolve timer handle use-after-free post deletion (#3431) 2024-02-08 16:22:03 +07:00
timer.h Various Fixes for 0.95 (#3215) 2023-11-15 20:11:05 +04:00