diff options
author | Eric Dumazet <edumazet@google.com> | 2025-06-30 12:19:29 +0000 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2025-08-15 12:13:41 +0200 |
commit | 939135ddeae23a5d883ab428d49725d9969b765c (patch) | |
tree | c02a42352e668d80764131c8dc8b3b158f28f2fe /net/core/dst.c | |
parent | 002bb5722d7e87d82c2fe19030349ef6d2a61317 (diff) |
net: dst: annotate data-races around dst->output
[ Upstream commit 2dce8c52a98995c4719def6f88629ab1581c0b82 ]
dst_dev_put() can overwrite dst->output while other
cpus might read this field (for instance from dst_output())
Add READ_ONCE()/WRITE_ONCE() annotations to suppress
potential issues.
We will likely need RCU protection in the future.
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-6-edumazet@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'net/core/dst.c')
-rw-r--r-- | net/core/dst.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/core/dst.c b/net/core/dst.c index 0eef85f8f1f3..cc990706b645 100644 --- a/net/core/dst.c +++ b/net/core/dst.c @@ -149,7 +149,7 @@ void dst_dev_put(struct dst_entry *dst) if (dst->ops->ifdown) dst->ops->ifdown(dst, dev); WRITE_ONCE(dst->input, dst_discard); - dst->output = dst_discard_out; + WRITE_ONCE(dst->output, dst_discard_out); dst->dev = blackhole_netdev; netdev_ref_replace(dev, blackhole_netdev, &dst->dev_tracker, GFP_ATOMIC); |