summaryrefslogtreecommitdiff
path: root/net/ipv4
diff options
context:
space:
mode:
authorEric Dumazet <edumazet@google.com>2025-06-30 12:19:28 +0000
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-08-15 12:08:46 +0200
commite0b8b6687b7d5c4428d9042b5963034e4bf9b995 (patch)
tree0dd39b5afa2d666312a1439ac6231395c186a7d7 /net/ipv4
parent62d7cf455c887941ed6f105cd430ba04ee0b6c9f (diff)
downloadlinux-e0b8b6687b7d5c4428d9042b5963034e4bf9b995.tar.gz
linux-e0b8b6687b7d5c4428d9042b5963034e4bf9b995.tar.bz2
linux-e0b8b6687b7d5c4428d9042b5963034e4bf9b995.zip
net: dst: annotate data-races around dst->input
[ Upstream commit f1c5fd34891a1c242885f48c2e4dc52df180f311 ] dst_dev_put() can overwrite dst->input while other cpus might read this field (for instance from dst_input()) Add READ_ONCE()/WRITE_ONCE() annotations to suppress potential issues. We will likely need full RCU protection later. Fixes: 4a6ce2b6f2ec ("net: introduce a new function dst_dev_put()") Signed-off-by: Eric Dumazet <edumazet@google.com> Reviewed-by: Kuniyuki Iwashima <kuniyu@google.com> Link: https://patch.msgid.link/20250630121934.3399505-5-edumazet@google.com Signed-off-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'net/ipv4')
-rw-r--r--net/ipv4/route.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/ipv4/route.c b/net/ipv4/route.c
index 8ee1ad2d8c13..f8538507ce3f 100644
--- a/net/ipv4/route.c
+++ b/net/ipv4/route.c
@@ -1699,7 +1699,7 @@ struct rtable *rt_dst_clone(struct net_device *dev, struct rtable *rt)
else if (rt->rt_gw_family == AF_INET6)
new_rt->rt_gw6 = rt->rt_gw6;
- new_rt->dst.input = rt->dst.input;
+ new_rt->dst.input = READ_ONCE(rt->dst.input);
new_rt->dst.output = rt->dst.output;
new_rt->dst.error = rt->dst.error;
new_rt->dst.lastuse = jiffies;