signal: use work_cancel_sync() to fix used after free
bug: user thread: hpwork: timer_create() with SIGEV_THREAD timer_settime() irq -> work_queue() add nxsig_notification_worker to Q timer_delete() nxsig_cancel_notification() call nxsig_notification_worker() work_cancel() timer_free() nxsig_notification_worker() used after free root cause: work_cancel() can't cancel work completely, the worker may alreay be running. resolve: use work_cancel_sync() API to cancel the work completely Signed-off-by: ligd <liguiding1@xiaomi.com>
This commit is contained in:
parent
61ef7eb3dc
commit
415fe60695
@ -175,6 +175,6 @@ int nxsig_notification(pid_t pid, FAR struct sigevent *event,
|
|||||||
#ifdef CONFIG_SIG_EVTHREAD
|
#ifdef CONFIG_SIG_EVTHREAD
|
||||||
void nxsig_cancel_notification(FAR struct sigwork_s *work)
|
void nxsig_cancel_notification(FAR struct sigwork_s *work)
|
||||||
{
|
{
|
||||||
work_cancel(SIG_EVTHREAD_WORK, &work->work);
|
work_cancel_sync(SIG_EVTHREAD_WORK, &work->work);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user