Skip to content

Commit ff2932a

Browse files
q2vengregkh
authored andcommitted
tcp: Fix a data-race around sysctl_tcp_challenge_ack_limit.
commit db3815a upstream. While reading sysctl_tcp_challenge_ack_limit, it can be changed concurrently. Thus, we need to add READ_ONCE() to its reader. Fixes: 282f23c ("tcp: implement RFC 5961 3.2") Signed-off-by: Kuniyuki Iwashima <[email protected]> Signed-off-by: David S. Miller <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent a88de75 commit ff2932a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

net/ipv4/tcp_input.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3622,7 +3622,7 @@ static void tcp_send_challenge_ack(struct sock *sk, const struct sk_buff *skb)
36223622
/* Then check host-wide RFC 5961 rate limit. */
36233623
now = jiffies / HZ;
36243624
if (now != challenge_timestamp) {
3625-
u32 ack_limit = net->ipv4.sysctl_tcp_challenge_ack_limit;
3625+
u32 ack_limit = READ_ONCE(net->ipv4.sysctl_tcp_challenge_ack_limit);
36263626
u32 half = (ack_limit + 1) >> 1;
36273627

36283628
challenge_timestamp = now;

0 commit comments

Comments
 (0)