Commit c7529392 authored by Mat Martineau's avatar Mat Martineau Committed by David S. Miller

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: default avatarMat Martineau <mathew.j.martineau@linux.intel.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 06827b34
...@@ -1269,7 +1269,7 @@ static void mptcp_retransmit_handler(struct sock *sk) ...@@ -1269,7 +1269,7 @@ static void mptcp_retransmit_handler(struct sock *sk)
{ {
struct mptcp_sock *msk = mptcp_sk(sk); struct mptcp_sock *msk = mptcp_sk(sk);
if (atomic64_read(&msk->snd_una) == msk->write_seq) { if (atomic64_read(&msk->snd_una) == READ_ONCE(msk->write_seq)) {
mptcp_stop_timer(sk); mptcp_stop_timer(sk);
} else { } else {
set_bit(MPTCP_WORK_RTX, &msk->flags); set_bit(MPTCP_WORK_RTX, &msk->flags);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment