Re: [PATCH net v2] net: openvswitch: fix data race in ovs_vport_get_upcall_stats
From: Aaron Conole
Date: Wed Jan 21 2026 - 09:32:42 EST
David Yang <mmyangfl@xxxxxxxxx> writes:
> 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@xxxxxxxxx>
> ---
> v1: https://lore.kernel.org/r/20260119181339.1847451-1-mmyangfl@xxxxxxxxx
> - use u64 instead of __u64
> net/openvswitch/vport.c | 11 ++++++-----
> 1 file changed, 6 insertions(+), 5 deletions(-)
Thanks for the patch - I did a spot-check of the rest of the module with
the following:
~/git/linux/net/openvswitch$ grep -nr 'while\(.*fetch.*\)'
and didn't find any other places that seemed to duplicate this
mistaken read pattern (at least in the OVS kernel module).
Reviewed-by: Aaron Conole <aconole@xxxxxxxxxx>