]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
tcp: annotate data-races around tcptw->tw_rcv_nxt
authorEric Dumazet <edumazet@google.com>
Tue, 27 Aug 2024 01:52:50 +0000 (01:52 +0000)
committerJakub Kicinski <kuba@kernel.org>
Thu, 29 Aug 2024 00:08:17 +0000 (17:08 -0700)
commitc0a11493ee6141d475fc96cf3ba24441299c9f16
tree71dd91a1ed63c2f0da76adf59ec690614dd6d02c
parent3e5cbbb1fb9a64588a2c6ddc5e432a303d36a488
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 <edumazet@google.com>
Reviewed-by: Jason Xing <kerneljasonxing@gmail.com>
Link: https://patch.msgid.link/20240827015250.3509197-3-edumazet@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/ipv4/tcp_ipv4.c
net/ipv4/tcp_minisocks.c
net/ipv6/tcp_ipv6.c