summaryrefslogtreecommitdiffstats
path: root/net/core
diff options
context:
space:
mode:
authorEric Dumazet <edumazet@google.com>2023-09-21 20:28:18 +0000
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-11-28 16:46:31 +0000
commitac41b10e834f5f7479f91220668e90c505808d1c (patch)
tree3b9d5bf64ab69722c4d97cdd9c5cf756c7f5e72b /net/core
parentbd4f1843a141fc77995108b08d9cc07f67d5d894 (diff)
downloadlinux-stable-ac41b10e834f5f7479f91220668e90c505808d1c.tar.gz
linux-stable-ac41b10e834f5f7479f91220668e90c505808d1c.tar.bz2
linux-stable-ac41b10e834f5f7479f91220668e90c505808d1c.zip
net: annotate data-races around sk->sk_dst_pending_confirm
[ Upstream commit eb44ad4e635132754bfbcb18103f1dcb7058aedd ] This field can be read or written without socket lock being held. Add annotations to avoid load-store tearing. 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/core')
-rw-r--r--net/core/sock.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/core/sock.c b/net/core/sock.c
index e1d0c8c715b8..62d169bcfcfa 100644
--- a/net/core/sock.c
+++ b/net/core/sock.c
@@ -496,7 +496,7 @@ struct dst_entry *__sk_dst_check(struct sock *sk, u32 cookie)
if (dst && dst->obsolete && dst->ops->check(dst, cookie) == NULL) {
sk_tx_queue_clear(sk);
- sk->sk_dst_pending_confirm = 0;
+ WRITE_ONCE(sk->sk_dst_pending_confirm, 0);
RCU_INIT_POINTER(sk->sk_dst_cache, NULL);
dst_release(dst);
return NULL;