summaryrefslogtreecommitdiff
path: root/net/mptcp
diff options
context:
space:
mode:
authorMat Martineau <mathew.j.martineau@linux.intel.com>2020-07-29 01:12:10 +0300
committerDavid S. Miller <davem@davemloft.net>2020-07-29 03:02:42 +0300
commit721e9089905ab7aebd5364b86b5f068f632a0e49 (patch)
tree2bd8b02c5c6923f3b9795f15cec739e5fab68891 /net/mptcp
parentc75293925f24630326abdf79751d980ec3878f65 (diff)
downloadlinux-721e9089905ab7aebd5364b86b5f068f632a0e49.tar.xz
mptcp: Safely store sequence number when sending data
The MPTCP socket's write_seq member can be read without the msk lock held, so use WRITE_ONCE() to store it. Signed-off-by: Mat Martineau <mathew.j.martineau@linux.intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/mptcp')
-rw-r--r--net/mptcp/protocol.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c
index f2455a68d231..687f0bea2b35 100644
--- a/net/mptcp/protocol.c
+++ b/net/mptcp/protocol.c
@@ -793,7 +793,7 @@ static int mptcp_sendmsg_frag(struct sock *sk, struct sock *ssk,
out:
if (!retransmission)
pfrag->offset += frag_truesize;
- *write_seq += ret;
+ WRITE_ONCE(*write_seq, *write_seq + ret);
mptcp_subflow_ctx(ssk)->rel_write_seq += ret;
return ret;