]> git.baikalelectronics.ru Git - kernel.git/commit
net/tcp_fastopen: fix data races around tfo_active_disable_stamp
authorEric Dumazet <edumazet@google.com>
Mon, 19 Jul 2021 09:12:18 +0000 (02:12 -0700)
committerDavid S. Miller <davem@davemloft.net>
Mon, 19 Jul 2021 17:11:51 +0000 (10:11 -0700)
commit3679fa2a095de305483c740743c4934eb9ea9487
tree592e5ed86c80efeea66fc3449361a17b04d7a2b4
parent96f8b85e3c02f88e9c699b7bce0d24880e8b2e71
net/tcp_fastopen: fix data races around tfo_active_disable_stamp

tfo_active_disable_stamp is read and written locklessly.
We need to annotate these accesses appropriately.

Then, we need to perform the atomic_inc(tfo_active_disable_times)
after the timestamp has been updated, and thus add barriers
to make sure tcp_fastopen_active_should_disable() wont read
a stale timestamp.

Fixes: b2194934b7e8 ("net/tcp_fastopen: Disable active side TFO in certain scenarios")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Wei Wang <weiwan@google.com>
Cc: Yuchung Cheng <ycheng@google.com>
Cc: Neal Cardwell <ncardwell@google.com>
Acked-by: Wei Wang <weiwan@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/tcp_fastopen.c