Skip to content

Commit 4e08ed4

Browse files
q2vendavem330
authored andcommitted
tcp: Fix a data-race around sysctl_tcp_stdurg.
While reading sysctl_tcp_stdurg, it can be changed concurrently. Thus, we need to add READ_ONCE() to its reader. Fixes: 1da177e ("Linux-2.6.12-rc2") Signed-off-by: Kuniyuki Iwashima <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 1a63cb9 commit 4e08ed4

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
@@ -5572,7 +5572,7 @@ static void tcp_check_urg(struct sock *sk, const struct tcphdr *th)
55725572
struct tcp_sock *tp = tcp_sk(sk);
55735573
u32 ptr = ntohs(th->urg_ptr);
55745574

5575-
if (ptr && !sock_net(sk)->ipv4.sysctl_tcp_stdurg)
5575+
if (ptr && !READ_ONCE(sock_net(sk)->ipv4.sysctl_tcp_stdurg))
55765576
ptr--;
55775577
ptr += ntohl(th->seq);
55785578

0 commit comments

Comments
 (0)