diff options
author | Mat Martineau <mathew.j.martineau@linux.intel.com> | 2020-07-28 15:12:10 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2020-07-28 17:02:42 -0700 |
commit | 721e9089905ab7aebd5364b86b5f068f632a0e49 (patch) | |
tree | 2bd8b02c5c6923f3b9795f15cec739e5fab68891 /net/mptcp | |
parent | c75293925f24630326abdf79751d980ec3878f65 (diff) | |
download | linux-721e9089905ab7aebd5364b86b5f068f632a0e49.tar.bz2 |
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.c | 2 |
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; |