diff options
author | 2020-07-28 15:12:10 -0700 | |
---|---|---|
committer | 2020-07-28 17:02:42 -0700 | |
commit | 721e9089905ab7aebd5364b86b5f068f632a0e49 (patch) | |
tree | 2bd8b02c5c6923f3b9795f15cec739e5fab68891 /net/mptcp | |
parent | mptcp: Safely read sequence number when lock isn't held (diff) | |
download | linux-721e9089905ab7aebd5364b86b5f068f632a0e49.tar.gz linux-721e9089905ab7aebd5364b86b5f068f632a0e49.tar.bz2 linux-721e9089905ab7aebd5364b86b5f068f632a0e49.zip |
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; |