aboutsummaryrefslogtreecommitdiffstats
path: root/net/core/dst.c
diff options
context:
space:
mode:
authorEric Dumazet <[email protected]>2025-06-30 12:19:28 +0000
committerJakub Kicinski <[email protected]>2025-07-02 21:32:29 +0000
commitf1c5fd34891a1c242885f48c2e4dc52df180f311 (patch)
tree57b3b2594bd1abb26ae65a0c65fcdb2a571900a1 /net/core/dst.c
parentnet: dst: annotate data-races around dst->lastuse (diff)
downloadkernel-f1c5fd34891a1c242885f48c2e4dc52df180f311.tar.gz
kernel-f1c5fd34891a1c242885f48c2e4dc52df180f311.zip
net: dst: annotate data-races around dst->input
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 <[email protected]> Reviewed-by: Kuniyuki Iwashima <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
Diffstat (limited to 'net/core/dst.c')
-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 8f2a3138d60c..13c629dc7123 100644
--- a/net/core/dst.c
+++ b/net/core/dst.c
@@ -148,7 +148,7 @@ void dst_dev_put(struct dst_entry *dst)
WRITE_ONCE(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,