]> git.ipfire.org Git - thirdparty/kernel/linux.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)
committerJakub Kicinski <kuba@kernel.org>
Mon, 19 Jan 2026 17:56:42 +0000 (09:56 -0800)
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>
include/net/ipv6.h

index f39cd85e89123a06f7660868ef42c8050d693fbf..c7f597da01cd92293b9ffbd9e692dea75fd581b8 100644 (file)
@@ -1014,11 +1014,11 @@ static inline int ip6_default_np_autolabel(const 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)