mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-01-23 00:20:52 -05:00
mptcp: annotate a data-race around sysctl_tcp_wmem[0]
It's possible that writer and the reader can manipulate the same sysctl knob concurrently. Using READ_ONCE() to prevent reading an old value. Signed-off-by: Jason Xing <kernelxing@tencent.com> Reviewed-by: Eric Dumazet <edumazet@google.com> Reviewed-by: Mat Martineau <martineau@kernel.org> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
900b2801bf
commit
9eb430d40e
1 changed files with 1 additions and 1 deletions
|
@ -850,7 +850,7 @@ static inline void __mptcp_sync_sndbuf(struct sock *sk)
|
|||
if (sk->sk_userlocks & SOCK_SNDBUF_LOCK)
|
||||
return;
|
||||
|
||||
new_sndbuf = sock_net(sk)->ipv4.sysctl_tcp_wmem[0];
|
||||
new_sndbuf = READ_ONCE(sock_net(sk)->ipv4.sysctl_tcp_wmem[0]);
|
||||
mptcp_for_each_subflow(mptcp_sk(sk), subflow) {
|
||||
ssk_sndbuf = READ_ONCE(mptcp_subflow_tcp_sock(subflow)->sk_sndbuf);
|
||||
|
||||
|
|
Loading…
Reference in a new issue