net: Fix data-races around sysctl_max_skb_frags.
authorKuniyuki Iwashima <kuniyu@amazon.com>
Tue, 23 Aug 2022 17:46:54 +0000 (10:46 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 31 Aug 2022 15:16:44 +0000 (17:16 +0200)
commit70564ad8d1904cccba13f002cb07730b3aac25dd
treefb2a22ddd5352dcf77144733026fcd93176047d1
parent289f2f58266777f45a52cd55dea96d736e6244c9
net: Fix data-races around sysctl_max_skb_frags.

[ Upstream commit 657b991afb89d25fe6c4783b1b75a8ad4563670d ]

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

Fixes: 5f74f82ea34c ("net:Add sysctl_max_skb_frags")
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.c
net/mptcp/protocol.c