Skip to content

Commit 721e908

Browse files
mjmartineaudavem330
authored andcommitted
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 <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent c752939 commit 721e908

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

net/mptcp/protocol.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -793,7 +793,7 @@ static int mptcp_sendmsg_frag(struct sock *sk, struct sock *ssk,
793793
out:
794794
if (!retransmission)
795795
pfrag->offset += frag_truesize;
796-
*write_seq += ret;
796+
WRITE_ONCE(*write_seq, *write_seq + ret);
797797
mptcp_subflow_ctx(ssk)->rel_write_seq += ret;
798798

799799
return ret;

0 commit comments

Comments
 (0)