diff options
author | Eric Dumazet | 2023-07-28 15:03:12 +0000 |
---|---|---|
committer | Greg Kroah-Hartman | 2023-09-13 09:42:23 +0200 |
commit | a2b5a9654a1d528c3df6a1b6d1e1e2cfabf9b0ad (patch) | |
tree | 5363d1c12b3b01a9c69e2cd93ee2cdfa203775d2 /net/sched | |
parent | 94515e9aa84c0458c8825ca661b61381146ba599 (diff) |
net: annotate data-races around sk->sk_{rcv|snd}timeo
[ Upstream commit 285975dd674258ccb33e77a1803e8f2015e67105 ]
sk_getsockopt() runs without locks, we must add annotations
to sk->sk_rcvtimeo and sk->sk_sndtimeo.
In the future we might allow fetching these fields before
we lock the socket in TCP fast path.
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'net/sched')
-rw-r--r-- | net/sched/em_meta.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/net/sched/em_meta.c b/net/sched/em_meta.c index 49bae3d5006b..b1f1b49d35ed 100644 --- a/net/sched/em_meta.c +++ b/net/sched/em_meta.c @@ -568,7 +568,7 @@ META_COLLECTOR(int_sk_rcvtimeo) *err = -1; return; } - dst->value = sk->sk_rcvtimeo / HZ; + dst->value = READ_ONCE(sk->sk_rcvtimeo) / HZ; } META_COLLECTOR(int_sk_sndtimeo) @@ -579,7 +579,7 @@ META_COLLECTOR(int_sk_sndtimeo) *err = -1; return; } - dst->value = sk->sk_sndtimeo / HZ; + dst->value = READ_ONCE(sk->sk_sndtimeo) / HZ; } META_COLLECTOR(int_sk_sendmsg_off) |