summaryrefslogtreecommitdiff
path: root/net/core
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/core
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/core')
-rw-r--r--net/core/dst.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/core/dst.c b/net/core/dst.c
index aad197e761cb..def3dbbd37e3 100644
--- a/net/core/dst.c
+++ b/net/core/dst.c
@@ -150,7 +150,7 @@ void dst_dev_put(struct dst_entry *dst)
dst->obsolete = DST_OBSOLETE_DEAD;
if (dst->ops->ifdown)
dst->ops->ifdown(dst, dev);
- dst->input = dst_discard;
+ WRITE_ONCE(dst->input, dst_discard);
dst->output = dst_discard_out;
dst->dev = blackhole_netdev;
netdev_ref_replace(dev, blackhole_netdev, &dst->dev_tracker,