]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
ipv6: annotate data-races in ip6_multipath_hash_{policy,fields}()
authorEric Dumazet <edumazet@google.com>
Thu, 15 Jan 2026 09:41:37 +0000 (09:41 +0000)
committerSasha Levin <sashal@kernel.org>
Wed, 4 Mar 2026 12:20:24 +0000 (07:20 -0500)
[ Upstream commit 03e9d91dd64e2f5ea632df5d59568d91757efc4d ]

Add missing READ_ONCE() when reading sysctl values.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://patch.msgid.link/20260115094141.3124990-5-edumazet@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
include/net/ipv6.h

index 6a933690e0ff5c40393c038a7a5e49179e16a50c..e759a00dbde19589b47bcf518a69787a9c3ffa18 100644 (file)
@@ -1010,11 +1010,11 @@ static inline int ip6_default_np_autolabel(struct net *net)
 #if IS_ENABLED(CONFIG_IPV6)
 static inline int ip6_multipath_hash_policy(const struct net *net)
 {
-       return net->ipv6.sysctl.multipath_hash_policy;
+       return READ_ONCE(net->ipv6.sysctl.multipath_hash_policy);
 }
 static inline u32 ip6_multipath_hash_fields(const struct net *net)
 {
-       return net->ipv6.sysctl.multipath_hash_fields;
+       return READ_ONCE(net->ipv6.sysctl.multipath_hash_fields);
 }
 #else
 static inline int ip6_multipath_hash_policy(const struct net *net)