@@ -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,
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@strlen.de> --- net/mptcp/options.c | 6 ++++++ 1 file changed, 6 insertions(+)