Commit 9eb430d4 authored by Jason Xing's avatar Jason Xing Committed by David S. Miller

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: default avatarJason Xing <kernelxing@tencent.com>
Reviewed-by: default avatarEric Dumazet <edumazet@google.com>
Reviewed-by: default avatarMat Martineau <martineau@kernel.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 900b2801
...@@ -850,7 +850,7 @@ static inline void __mptcp_sync_sndbuf(struct sock *sk) ...@@ -850,7 +850,7 @@ static inline void __mptcp_sync_sndbuf(struct sock *sk)
if (sk->sk_userlocks & SOCK_SNDBUF_LOCK) if (sk->sk_userlocks & SOCK_SNDBUF_LOCK)
return; 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) { mptcp_for_each_subflow(mptcp_sk(sk), subflow) {
ssk_sndbuf = READ_ONCE(mptcp_subflow_tcp_sock(subflow)->sk_sndbuf); ssk_sndbuf = READ_ONCE(mptcp_subflow_tcp_sock(subflow)->sk_sndbuf);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment