aboutsummaryrefslogtreecommitdiffstats
path: root/net/core
diff options
context:
space:
mode:
authorEric Dumazet <edumazet@google.com>2025-06-30 12:19:27 +0000
committerJakub Kicinski <kuba@kernel.org>2025-07-02 14:32:29 -0700
commit8f2b2282d04a5d5bcbec22f91572bb6803cfc771 (patch)
treeb78b4203652884e4eea1c2002f4a13a2db2ce1a2 /net/core
parentnet: dst: annotate data-races around dst->expires (diff)
downloadlinux-8f2b2282d04a5d5bcbec22f91572bb6803cfc771.tar.gz
linux-8f2b2282d04a5d5bcbec22f91572bb6803cfc771.zip
net: dst: annotate data-races around dst->lastuse
(dst_entry)->lastuse is read and written locklessly, add corresponding annotations. Signed-off-by: Eric Dumazet <edumazet@google.com> Reviewed-by: Kuniyuki Iwashima <kuniyu@google.com> Link: https://patch.msgid.link/20250630121934.3399505-4-edumazet@google.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'net/core')
-rw-r--r--net/core/rtnetlink.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c
index c57692eb8da9..a9555bfc372f 100644
--- a/net/core/rtnetlink.c
+++ b/net/core/rtnetlink.c
@@ -1026,9 +1026,11 @@ int rtnl_put_cacheinfo(struct sk_buff *skb, struct dst_entry *dst, u32 id,
.rta_error = error,
.rta_id = id,
};
+ unsigned long delta;
if (dst) {
- ci.rta_lastuse = jiffies_delta_to_clock_t(jiffies - dst->lastuse);
+ delta = jiffies - READ_ONCE(dst->lastuse);
+ ci.rta_lastuse = jiffies_delta_to_clock_t(delta);
ci.rta_used = dst->__use;
ci.rta_clntref = rcuref_read(&dst->__rcuref);
}