diff options
author | Mat Martineau <mathew.j.martineau@linux.intel.com> | 2020-07-29 01:12:09 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2020-07-29 03:02:42 +0300 |
commit | c75293925f24630326abdf79751d980ec3878f65 (patch) | |
tree | 8114570e21e8b336d69ccfa0c9702740f909ceee /net/mptcp | |
parent | 06827b348b1d43850a63c3e490fe9712c124fa0c (diff) | |
download | linux-c75293925f24630326abdf79751d980ec3878f65.tar.xz |
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 <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 f264ea15e081..f2455a68d231 100644 --- a/net/mptcp/protocol.c +++ b/net/mptcp/protocol.c @@ -1269,7 +1269,7 @@ static void mptcp_retransmit_handler(struct sock *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); } else { set_bit(MPTCP_WORK_RTX, &msk->flags); |