Skip to content

Commit db3815a

Browse files
q2vendavem330
authored andcommitted
tcp: Fix a data-race around sysctl_tcp_challenge_ack_limit.
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]>
1 parent 9fb9019 commit db3815a

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
@@ -3629,7 +3629,7 @@ static void tcp_send_challenge_ack(struct sock *sk)
36293629
/* Then check host-wide RFC 5961 rate limit. */
36303630
now = jiffies / HZ;
36313631
if (now != challenge_timestamp) {
3632-
u32 ack_limit = net->ipv4.sysctl_tcp_challenge_ack_limit;
3632+
u32 ack_limit = READ_ONCE(net->ipv4.sysctl_tcp_challenge_ack_limit);
36333633
u32 half = (ack_limit + 1) >> 1;
36343634

36353635
challenge_timestamp = now;

0 commit comments

Comments
 (0)