Skip to content

Commit c752939

Browse files
mjmartineaudavem330
authored andcommitted
mptcp: Safely read sequence number when lock isn't held
The MPTCP socket's write_seq member should be read with READ_ONCE() when the msk lock is not held. Signed-off-by: Mat Martineau <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 06827b3 commit c752939

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
@@ -1269,7 +1269,7 @@ static void mptcp_retransmit_handler(struct sock *sk)
12691269
{
12701270
struct mptcp_sock *msk = mptcp_sk(sk);
12711271

1272-
if (atomic64_read(&msk->snd_una) == msk->write_seq) {
1272+
if (atomic64_read(&msk->snd_una) == READ_ONCE(msk->write_seq)) {
12731273
mptcp_stop_timer(sk);
12741274
} else {
12751275
set_bit(MPTCP_WORK_RTX, &msk->flags);

0 commit comments

Comments
 (0)