]> 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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 28 Jul 2021 11:30:57 +0000 (13:30 +0200)
commitf7306b3122243ca9801e6984bd5d7ae927c7f9c9
tree8c863c482d7ff44d4ac861f454c879ded668b736
parenta3c631dc1ccfdb449884bb95f5b763b30d71a83c
net/tcp_fastopen: fix data races around tfo_active_disable_stamp

[ Upstream commit 6f20c8adb1813467ea52c1296d52c4e95978cb2f ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/ipv4/tcp_fastopen.c