Re: [PATCH] mac80211_hwsim: close the race between running and enqueuing hrtimer

From: Thomas Gleixner
Date: Tue Sep 29 2020 - 15:29:02 EST


On Tue, Sep 29 2020 at 16:57, Hillf Danton wrote:
> So the timer was armed at some point and then the expiry which does the
> forward races with the ioctl which starts the timer. Lack of
> serialization or such ...
> ===
>
> To close the race, replace hrtimer_is_queued() with hrtimer_active() on
> enqueuing timer, because it also covers the case of a running timer in
> addition to the queued one.
>
> Link: https://lore.kernel.org/lkml/87pn65khft.fsf@xxxxxxxxxxxxxxxxxxxxxxx/
> Reported-by: syzbot+ca740b95a16399ceb9a5@xxxxxxxxxxxxxxxxxxxxxxxxx
> Decoded-by: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
> Signed-off-by: Hillf Danton <hdanton@xxxxxxxx>

Reviewed-by: Thomas Gleixner <tglx@xxxxxxxxxxxxx>