]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
tcp: Fix a data-race around sysctl_tcp_comp_sack_nr.
authorKuniyuki Iwashima <kuniyu@amazon.com>
Fri, 22 Jul 2022 18:22:03 +0000 (11:22 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 3 Aug 2022 10:05:26 +0000 (12:05 +0200)
commit68ee3ded64e5f251e70534b9873964852ccb64e5
treebd28bff28f57a105bdf3cad274eccdd8961085b9
parent2dc6e8f72d0d7f5d9e15a8940f7c3b9505e672ea
tcp: Fix a data-race around sysctl_tcp_comp_sack_nr.

[ Upstream commit 79f55473bfc8ac51bd6572929a679eeb4da22251 ]

While reading sysctl_tcp_comp_sack_nr, it can be changed concurrently.
Thus, we need to add READ_ONCE() to its reader.

Fixes: 9c21d2fc41c0 ("tcp: add tcp_comp_sack_nr sysctl")
Signed-off-by: Kuniyuki Iwashima <kuniyu@amazon.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/ipv4/tcp_input.c