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>
This commit is contained in:

committed by
David S. Miller

parent
e0d694d638
commit
d9b55bf7b6
@@ -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;
|
||||
|
Reference in New Issue
Block a user