Skip to content

Commit 0b484c9

Browse files
q2vendavem330
authored andcommitted
tcp: Fix a data-race around sysctl_tcp_rfc1337.
While reading sysctl_tcp_rfc1337, 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 <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 4e08ed4 commit 0b484c9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

net/ipv4/tcp_minisocks.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ tcp_timewait_state_process(struct inet_timewait_sock *tw, struct sk_buff *skb,
173173
* Oh well... nobody has a sufficient solution to this
174174
* protocol bug yet.
175175
*/
176-
if (twsk_net(tw)->ipv4.sysctl_tcp_rfc1337 == 0) {
176+
if (!READ_ONCE(twsk_net(tw)->ipv4.sysctl_tcp_rfc1337)) {
177177
kill:
178178
inet_twsk_deschedule_put(tw);
179179
return TCP_TW_SUCCESS;

0 commit comments

Comments
 (0)