Re: [PATCH v2 05/12] rv: Prevent in-flight per-task handlers from using invalid slots
From: Nam Cao
Date: Thu May 28 2026 - 05:00:55 EST
Gabriele Monaco <gmonaco@xxxxxxxxxx> writes:
> Per-task monitors use a slot in the task_struct->rv[] array and store
> that locally (e.g. task_mon_slot), this slot is returned during the
> destruction process but currently hanlers can be running while that slot
> is returning and this race may lead to accessing an invalid slot.
>
> Synchronise with all in-flight tracepoint handlers using
> tracepoint_synchronize_unregister() before returning the slot.
>
> Fixes: f5587d1b6ec9 ("rv: Add Hybrid Automata monitor type")
> Fixes: a9769a5b9878 ("rv: Add support for LTL monitors")
> Suggested-by: Wen Yang <wen.yang@xxxxxxxxx>
> Signed-off-by: Gabriele Monaco <gmonaco@xxxxxxxxxx>
Reviewed-by: Nam Cao <namcao@xxxxxxxxxxxxx>