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: 1da177e4c3f4 ("Linux-2.6.12-rc2") Signed-off-by: Kuniyuki Iwashima <kuniyu@amazon.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 1a63cb9 commit 4e08ed4

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

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)