diff options
| author | Eric Dumazet <[email protected]> | 2024-08-27 01:52:50 +0000 |
|---|---|---|
| committer | Jakub Kicinski <[email protected]> | 2024-08-29 00:08:17 +0000 |
| commit | c0a11493ee6141d475fc96cf3ba24441299c9f16 (patch) | |
| tree | 71dd91a1ed63c2f0da76adf59ec690614dd6d02c /net/ipv4/tcp_ipv4.c | |
| parent | tcp: remove volatile qualifier on tw_substate (diff) | |
| download | kernel-c0a11493ee6141d475fc96cf3ba24441299c9f16.tar.gz kernel-c0a11493ee6141d475fc96cf3ba24441299c9f16.zip | |
tcp: annotate data-races around tcptw->tw_rcv_nxt
No lock protects tcp tw fields.
tcptw->tw_rcv_nxt can be changed from twsk_rcv_nxt_update()
while other threads might read this field.
Add READ_ONCE()/WRITE_ONCE() annotations, and make sure
tcp_timewait_state_process() reads tcptw->tw_rcv_nxt only once.
Signed-off-by: Eric Dumazet <[email protected]>
Reviewed-by: Jason Xing <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Jakub Kicinski <[email protected]>
Diffstat (limited to 'net/ipv4/tcp_ipv4.c')
| -rw-r--r-- | net/ipv4/tcp_ipv4.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c index 7c29158e1abc..eb631e66ee03 100644 --- a/net/ipv4/tcp_ipv4.c +++ b/net/ipv4/tcp_ipv4.c @@ -1073,7 +1073,7 @@ static void tcp_v4_timewait_ack(struct sock *sk, struct sk_buff *skb) } tcp_v4_send_ack(sk, skb, - tcptw->tw_snd_nxt, tcptw->tw_rcv_nxt, + tcptw->tw_snd_nxt, READ_ONCE(tcptw->tw_rcv_nxt), tcptw->tw_rcv_wnd >> tw->tw_rcv_wscale, tcp_tw_tsval(tcptw), READ_ONCE(tcptw->tw_ts_recent), |
