tcp: annotate data-races around icsk->icsk_syn_retries

[ Upstream commit 3a037f0f3c4bfe44518f2fbb478aa2f99a9cd8bb ]

do_tcp_getsockopt() and reqsk_timer_handler() read
icsk->icsk_syn_retries while another cpu might change its value.

Fixes: 1da177e4c3 ("Linux-2.6.12-rc2")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Link: https://lore.kernel.org/r/20230719212857.3943972-7-edumazet@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
Eric Dumazet
2023-07-19 21:28:52 +00:00
committed by Greg Kroah-Hartman
parent 7b0084918c
commit 9168bd8f54
2 changed files with 4 additions and 4 deletions

View File

@@ -740,7 +740,7 @@ static void reqsk_timer_handler(struct timer_list *t)
if (inet_sk_state_load(sk_listener) != TCP_LISTEN)
goto drop;
max_syn_ack_retries = icsk->icsk_syn_retries ? :
max_syn_ack_retries = READ_ONCE(icsk->icsk_syn_retries) ? :
READ_ONCE(net->ipv4.sysctl_tcp_synack_retries);
/* Normally all the openreqs are young and become mature
* (i.e. converted to established socket) for first timeout.