mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2026-06-07 09:41:30 +00:00
In the current implementation sigev_notify is configured as SIGEV_THREAD. When timer expires an async thread is created and the registered timer callback is called in the context of this thread. vrtc_update_timer will access the global data vrtc. There is a race condition that vrtc is freed when deinit and then a timer expires. In this case vrtc_update_timer will access a freed buffer which causes problem such as heap corruption and segment fault. In this patch signal model is used when timer is created. The signal is masked and a signalfd is used to poll on it with mevent. This avoids the race condition. Signed-off-by: Jian Jun Chen <jian.jun.chen@intel.com> Acked-by: Yin Fengwei <fengwei.yin@intel.com> Tracked-On: #1185
30 KiB
30 KiB