projects
/
platform
/
kernel
/
linux-rpi.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
06827b3
)
mptcp: Safely read sequence number when lock isn't held
author
Mat Martineau
<mathew.j.martineau@linux.intel.com>
Tue, 28 Jul 2020 22:12:09 +0000
(15:12 -0700)
committer
David S. Miller
<davem@davemloft.net>
Wed, 29 Jul 2020 00:02:42 +0000
(17:02 -0700)
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>
net/mptcp/protocol.c
patch
|
blob
|
history
diff --git
a/net/mptcp/protocol.c
b/net/mptcp/protocol.c
index f264ea15e081b38d5670e02f1e61129304cce2bc..f2455a68d2315c1abb6571bd0971f879f43819e7 100644
(file)
--- 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);