summaryrefslogtreecommitdiffstats
path: root/net/ipv4/tcp_input.c
diff options
context:
space:
mode:
authorEric Dumazet <edumazet@google.com>2019-10-11 05:17:43 +0200
committerDavid S. Miller <davem@davemloft.net>2019-10-13 19:13:08 +0200
commitd9b55bf7b6788ec0bd1db1acefbc4feb1399144a (patch)
tree428615c37202b0d44173735a2efe04651aff469b /net/ipv4/tcp_input.c
parenttcp: annotate tp->snd_nxt lockless reads (diff)
downloadlinux-d9b55bf7b6788ec0bd1db1acefbc4feb1399144a.tar.xz
linux-d9b55bf7b6788ec0bd1db1acefbc4feb1399144a.zip
tcp: annotate tp->urg_seq lockless reads
There two places where we fetch tp->urg_seq while this field can change from IRQ or other cpu. We need to add READ_ONCE() annotations, and also make sure write side use corresponding WRITE_ONCE() to avoid store-tearing. Signed-off-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/tcp_input.c')
-rw-r--r--net/ipv4/tcp_input.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index a30aae3a6a18..16342e043ab3 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -5356,7 +5356,7 @@ static void tcp_check_urg(struct sock *sk, const struct tcphdr *th)
}
tp->urg_data = TCP_URG_NOTYET;
- tp->urg_seq = ptr;
+ WRITE_ONCE(tp->urg_seq, ptr);
/* Disable header prediction. */
tp->pred_flags = 0;