tcp: Fix a data-race around sysctl_tcp_min_tso_segs.
authorKuniyuki Iwashima <kuniyu@amazon.com>
Wed, 20 Jul 2022 16:50:22 +0000 (09:50 -0700)
committerDavid S. Miller <davem@davemloft.net>
Fri, 22 Jul 2022 11:06:17 +0000 (12:06 +0100)
commite0bb4ab9dfddd872622239f49fb2bd403b70853b
treef3895146eebbbe2c08fc536606825365f0bc1f78
parentdb3815a2fa691da145cfbe834584f31ad75df9ff
tcp: Fix a data-race around sysctl_tcp_min_tso_segs.

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

Fixes: 95bd09eb2750 ("tcp: TSO packets automatic sizing")
Signed-off-by: Kuniyuki Iwashima <kuniyu@amazon.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/tcp_output.c