mirror of
https://github.com/falcosecurity/falco.git
synced 2026-03-18 18:58:41 +00:00
The watchdog thread and stop() consume the timeout pointer with m_timeout.exchange(nullptr, ...). That exchange was using memory_order_release. The load part of the RMW needs acquire semantics so it synchronizes-with the release store in set_timeout()/cancel_timeout(); otherwise the consumer can see the pointer value without seeing the writes that initialized the timeout_data and payload (data race). Use memory_order_acq_rel on the consumer exchanges so the load synchronizes-with the producer and the pointed-to memory is visible before use. Signed-off-by: irozzo-1A <iacopo@sysdig.com>