All of lore.kernel.org
 help / color / mirror / Atom feed
* [MPTCP] [PATCH mptcp 2/4] options: ignore mptcp-level ack that is ahead of write_seq
@ 2019-11-05 17:05 Florian Westphal
  0 siblings, 0 replies; only message in thread
From: Florian Westphal @ 2019-11-05 17:05 UTC (permalink / raw)
  To: mptcp

[-- Attachment #1: Type: text/plain, Size: 1230 bytes --]

We should not allow a peer to ack data that we haven't even sent yet,
so test incoming una vs. write_seq.

squashto:  mptcp: update per unacked sequence on pkt reception

Signed-off-by: Florian Westphal <fw(a)strlen.de>
---
 net/mptcp/options.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/net/mptcp/options.c b/net/mptcp/options.c
index 1b08e1193991..80dbe7662cea 100644
--- a/net/mptcp/options.c
+++ b/net/mptcp/options.c
@@ -566,12 +566,18 @@ static void update_una(struct mptcp_sock *msk,
 		       struct mptcp_options_received *mp_opt)
 {
 	u64 new_snd_una, snd_una, old_snd_una = atomic64_read(&msk->snd_una);
+	u64 write_seq = READ_ONCE(msk->write_seq);
 
 	/* avoid ack expansion on update conflict, to reduce the risk of
 	 * wrongly expanding to a future ack sequence number, which is way
 	 * more dangerous than missing an ack
 	 */
 	new_snd_una = expand_ack(old_snd_una, mp_opt->data_ack, mp_opt->ack64);
+
+	/* ACK for data not even sent yet? Ignore. */
+	if (after64(new_snd_una, write_seq))
+		new_snd_una = old_snd_una;
+
 	while (after64(new_snd_una, old_snd_una)) {
 		snd_una = old_snd_una;
 		old_snd_una = atomic64_cmpxchg(&msk->snd_una, snd_una,
-- 
2.23.0

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2019-11-05 17:05 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-05 17:05 [MPTCP] [PATCH mptcp 2/4] options: ignore mptcp-level ack that is ahead of write_seq Florian Westphal

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.