tcp: annotate tp->write_seq lockless reads
There are few places where we fetch tp->write_seq while this field can change from IRQ or other cpu. We need to add READ_ONCE() annotations, and also make sure write sides 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>
This commit is contained in:

committed by
David S. Miller

parent
7db48e9839
commit
0f31746452
@@ -498,7 +498,7 @@ struct sock *tcp_create_openreq_child(const struct sock *sk,
|
||||
newtp->total_retrans = req->num_retrans;
|
||||
|
||||
tcp_init_xmit_timers(newsk);
|
||||
newtp->write_seq = newtp->pushed_seq = treq->snt_isn + 1;
|
||||
WRITE_ONCE(newtp->write_seq, newtp->pushed_seq = treq->snt_isn + 1);
|
||||
|
||||
if (sock_flag(newsk, SOCK_KEEPOPEN))
|
||||
inet_csk_reset_keepalive_timer(newsk,
|
||||
|
Reference in New Issue
Block a user