mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-07-22 05:47:30 -04:00
bridge: add a READ_ONCE() in br_timer_value()
br_timer_value() can be called locklessly, the expires field could be changed concurrently. Signed-off-by: Eric Dumazet <edumazet@google.com> Reviewed-by: Ido Schimmel <idosch@nvidia.com> Acked-by: Nikolay Aleksandrov <razor@blackwall.org> Link: https://patch.msgid.link/20260604141343.2124500-2-edumazet@google.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
committed by
Jakub Kicinski
parent
2eb9a81a7f
commit
032c8f6f21
@@ -160,5 +160,5 @@ void br_stp_port_timer_init(struct net_bridge_port *p)
|
||||
unsigned long br_timer_value(const struct timer_list *timer)
|
||||
{
|
||||
return timer_pending(timer)
|
||||
? jiffies_delta_to_clock_t(timer->expires - jiffies) : 0;
|
||||
? jiffies_delta_to_clock_t(READ_ONCE(timer->expires) - jiffies) : 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user