Skip to content
This repository has been archived by the owner on Apr 18, 2024. It is now read-only.

Commit

Permalink
mptcp: Fix a data-race around sysctl_tcp_thin_linear_timeouts
Browse files Browse the repository at this point in the history
While reading sysctl_tcp_thin_linear_timeouts, it can be changed
concurrently. Thus, we need to add READ_ONCE() to its reader.

This is similar to commit 7c6f2a86ca59 ("tcp: Fix a data-race around
sysctl_tcp_thin_linear_timeouts."), recently backported to stable
kernels.

Fixes: 8de2ed1 ("Bug#85 - meta-retransmit timeouts")
Signed-off-by: Matthieu Baerts <[email protected]>
(cherry picked from commit 57d2ce6)
Signed-off-by: Matthieu Baerts <[email protected]>
(cherry picked from commit 20091e9)
Signed-off-by: Matthieu Baerts <[email protected]>
  • Loading branch information
matttbe committed Aug 10, 2022
1 parent 064a1b5 commit b99c47a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/mptcp/mptcp_output.c
Original file line number Diff line number Diff line change
Expand Up @@ -1743,7 +1743,7 @@ void mptcp_meta_retransmit_timer(struct sock *meta_sk)
* linear-timeout retransmissions into a black hole
*/
if (meta_sk->sk_state == TCP_ESTABLISHED &&
(meta_tp->thin_lto || sock_net(meta_sk)->ipv4.sysctl_tcp_thin_linear_timeouts) &&
(meta_tp->thin_lto || READ_ONCE(sock_net(meta_sk)->ipv4.sysctl_tcp_thin_linear_timeouts)) &&
tcp_stream_is_thin(meta_tp) &&
meta_icsk->icsk_retransmits <= TCP_THIN_LINEAR_RETRIES) {
meta_icsk->icsk_backoff = 0;
Expand Down

0 comments on commit b99c47a

Please sign in to comment.