tcp: Fix data-races around sysctl_tcp_reflect_tos.
authorKuniyuki Iwashima <kuniyu@amazon.com>
Fri, 22 Jul 2022 18:22:04 +0000 (11:22 -0700)
committerDavid S. Miller <davem@davemloft.net>
Mon, 25 Jul 2022 11:42:10 +0000 (12:42 +0100)
commit870e3a634b6a6cb1543b359007aca73fe6a03ac5
tree10515d0f8ef7795e20f52550afb617b148a55e14
parent79f55473bfc8ac51bd6572929a679eeb4da22251
tcp: Fix data-races around sysctl_tcp_reflect_tos.

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

Fixes: ac8f1710c12b ("tcp: reflect tos value received in SYN to the socket")
Signed-off-by: Kuniyuki Iwashima <kuniyu@amazon.com>
Acked-by: Wei Wang <weiwan@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/tcp_ipv4.c
net/ipv6/tcp_ipv6.c