]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
net: openvswitch: fix data race in ovs_vport_get_upcall_stats
authorDavid Yang <mmyangfl@gmail.com>
Wed, 21 Jan 2026 07:29:26 +0000 (15:29 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 30 Jan 2026 09:27:37 +0000 (10:27 +0100)
commitc70e99dd37163e95aafe5ad33733f68d953c5aff
treed1eb3a296aa891cf9adf02327cd2e2bb24357c05
parent77c6aa2c388e95332a55e517ec279b483f63a641
net: openvswitch: fix data race in ovs_vport_get_upcall_stats

[ Upstream commit cc4816bdb08639e5cd9acb295a02d6f0f09736b4 ]

In ovs_vport_get_upcall_stats(), some statistics protected by
u64_stats_sync, are read and accumulated in ignorance of possible
u64_stats_fetch_retry() events. These statistics are already accumulated
by u64_stats_inc(). Fix this by reading them into temporary variables
first.

Fixes: 1933ea365aa7 ("net: openvswitch: Add support to count upcall packets")
Signed-off-by: David Yang <mmyangfl@gmail.com>
Acked-by: Ilya Maximets <i.maximets@ovn.org>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Reviewed-by: Aaron Conole <aconole@redhat.com>
Link: https://patch.msgid.link/20260121072932.2360971-1-mmyangfl@gmail.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/openvswitch/vport.c