Commit Graph
6 Commits
Author SHA1 Message Date
Konstantin Kondrashov 2c935ea861 fix(esp_event): protect is_handler_registered traversal with mutex (SEC-219)
esp_event_is_handler_registered() walked loop_nodes, base_nodes, id_nodes
and handler lists with no lock held, then released an unowned mutex at the
'out:' label via xSemaphoreGive().

Concurrent register/unregister/delete operations can free handler nodes
during the unlocked walk (SLIST UAF). The xSemaphoreGive on an unowned
recursive mutex corrupts the recursive call-count of any task that
legitimately holds the mutex.

Fix:
- Take loop->mutex with xSemaphoreTakeRecursive before the traversal.
- Replace xSemaphoreGive at the 'out:' label with xSemaphoreGiveRecursive
  so every exit path holds the mutex for exactly one balanced take/give.

Closes SEC_219
2026-07-21 15:25:57 +03:00
Jakob Hasse 417de470ec change(esp_event): reformat files with astyle 2024-01-31 11:07:07 +08:00
Darian Leung f50d83413e refactor(tools): Tidy up core component files copyright ignore
Some files that should have their copyrights checked are still placed on the
copyright ignore list.

- These entries have been tidied up
- Copyrights of those files have been updated.
2024-01-22 18:07:35 +08:00
Jakob Hasse 9b4815e3c8 ESP Event: multiple registrations to one event
* It's possible now to register the same handler
  several times to one specific event, using
  a dynamic handle object.
2020-02-11 10:52:05 +01:00
Renz Christian Bagaporo a10901f44b esp_event: dispatch order follows registration order 2019-01-30 20:59:47 +08:00
Renz Christian Bagaporo 5a83347bec event: Implement event loop library 2018-10-26 13:14:19 +08:00