Re: timers: Add missing READ_ONCE() in __run_timer_base()

From: Frederic Weisbecker
Date: Thu Oct 31 2024 - 05:44:48 EST


On Wed, Oct 30, 2024 at 08:53:51AM +0100, Thomas Gleixner wrote:
> __run_timer_base() checks base::next_expiry without holding
> base::lock. That can race with a remote CPU updating next_expiry under the
> lock. This is an intentional and harmless data race, but lacks a
> READ_ONCE(), so KCSAN complains about this.
>
> Add the missing READ_ONCE(). All other places are covered already.
>
> Fixes: 79f8b28e85f8 ("timers: Annotate possible non critical data race of next_expiry")
> Reported-by: kernel test robot <oliver.sang@xxxxxxxxx>
> Signed-off-by: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
> Closes: https://lore.kernel.org/oe-lkp/202410301205.ef8e9743-lkp@xxxxxxxxx

Reviewed-by: Frederic Weisbecker <frederic@xxxxxxxxxx>