Received: by 2002:ac0:aa62:0:0:0:0:0 with SMTP id w31-v6csp2049555ima; Mon, 22 Oct 2018 03:25:17 -0700 (PDT) X-Google-Smtp-Source: AJdET5eg6d+1/OvlrQTh4nhdHdAzNbwb7gFr6IOxeHP9JC5CAVplTh3uOv5f4z8GAwTU3wF9p59V X-Received: by 2002:a63:6d49:: with SMTP id i70-v6mr6752134pgc.215.1540203917119; Mon, 22 Oct 2018 03:25:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540203917; cv=none; d=google.com; s=arc-20160816; b=g3OLUHVGXYnOMIx/FmfzmDRh6NYqmtY9K5YwevOS7GIB8GIeAnHtrFvABMV9rnPz8v bzbYOCxmTtA9kHBmyRvDKmscZ/t2mdRacsr84AWz52k0pC2ehKf/Sf/levtFuTSr7jY2 vAaN+z9sIeMFBcXOQ1dzfXbjw6RylRfjNWsfvJB1LB64OOpBlUitB0Ujm53aY2w10sV+ lWlzrKZT6Fbsp6MdbDKTW8IHCqcsf95dFhuJ+miVUa66oLTZgFFMvh4foGeZ49UHgBjB DR5lDD2J+wswG5HiiyrCTxQpUaG8hhjmT6aqIv9pUiAOsS7pLWZwi00Wky4eEqTAbDQf ix2Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=+BAjy+QUBccmjziMFM1JXnl9s+aPl8MzLBDMU53QTnY=; b=hlYtmg1AlKq3cwkNuESP2Lza8kdU6hcRXHyvDr0IhzNacw41ziEWkyGSpWGp984Qac Ijzs/Eg25CmpAg8f/B7+2ViCSRkZizAPw5Ggr0cBA1FYWyqIcOsto0/PMrSTw86Oy3+u 8HBTN1zpOhQl5h+m9pGTlduSCPkKOEpS5FujEdhHjUJAh1zfwI4xOBOVoxsK+RywoWY8 BHCcedEoiX+j8K5SOdZjEU5LueB+1Ssq/FF6r/4mHyawkLIBxBJ48CqkVypMKkf1QcUh p5stNCR2avC6Hnyp963niAKjnzFD3fvoJOR15e7qb+ShgNpo0X0T+6+nmZyFvLnV/Ory 3NdA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=TRieewdX; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u68-v6si34853108pfa.28.2018.10.22.03.25.02; Mon, 22 Oct 2018 03:25:17 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=TRieewdX; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729129AbeJVSit (ORCPT + 99 others); Mon, 22 Oct 2018 14:38:49 -0400 Received: from mail.kernel.org ([198.145.29.99]:49720 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728358AbeJVSis (ORCPT ); Mon, 22 Oct 2018 14:38:48 -0400 Received: from sasha-vm.mshome.net (unknown [167.98.65.38]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 205AF20898; Mon, 22 Oct 2018 10:20:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1540203653; bh=8shxMAY3KgbJ7TovIFt3TItMAIMzgchvu5ZccyCvatg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=TRieewdXSLzDv00o+ObbX/ttHjaq5cwTfPJh8MdOYabOmOzLOjrgmNKlCoqwLf7+u 8NsFW2P3eDc67nPKZ08n1DXOYQsUFLosMOiS3V84bKOTlBAztDRaMD9HwRcmvwQVkC WqnN+QWeVKdjmmCjqtlm6H8EmVfFiBxHq5b1B22w= From: Sasha Levin To: stable@vger.kernel.org, linux-kernel@vger.kernel.org Cc: David Howells , Sasha Levin Subject: [PATCH AUTOSEL 4.14 09/15] rxrpc: Only take the rwind and mtu values from latest ACK Date: Mon, 22 Oct 2018 06:20:20 -0400 Message-Id: <20181022102026.40869-9-sashal@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181022102026.40869-1-sashal@kernel.org> References: <20181022102026.40869-1-sashal@kernel.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: David Howells [ Upstream commit 298bc15b2079c324e82d0a6fda39c3d762af7282 ] Move the out-of-order and duplicate ACK packet check to before the call to rxrpc_input_ackinfo() so that the receive window size and MTU size are only checked in the latest ACK packet and don't regress. Fixes: 248f219cb8bc ("rxrpc: Rewrite the data and ack handling code") Signed-off-by: David Howells Signed-off-by: Sasha Levin --- net/rxrpc/input.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/net/rxrpc/input.c b/net/rxrpc/input.c index 3a501bf0fc1a..ea506a77f3c8 100644 --- a/net/rxrpc/input.c +++ b/net/rxrpc/input.c @@ -806,6 +806,16 @@ static void rxrpc_input_ack(struct rxrpc_call *call, struct sk_buff *skb, rxrpc_propose_ack_respond_to_ack); } + /* Discard any out-of-order or duplicate ACKs. */ + if (before_eq(sp->hdr.serial, call->acks_latest)) { + _debug("discard ACK %d <= %d", + sp->hdr.serial, call->acks_latest); + return; + } + call->acks_latest_ts = skb->tstamp; + call->acks_latest = sp->hdr.serial; + + /* Parse rwind and mtu sizes if provided. */ ioffset = offset + nr_acks + 3; if (skb->len >= ioffset + sizeof(buf.info)) { if (skb_copy_bits(skb, ioffset, &buf.info, sizeof(buf.info)) < 0) @@ -827,15 +837,6 @@ static void rxrpc_input_ack(struct rxrpc_call *call, struct sk_buff *skb, return; } - /* Discard any out-of-order or duplicate ACKs. */ - if (before_eq(sp->hdr.serial, call->acks_latest)) { - _debug("discard ACK %d <= %d", - sp->hdr.serial, call->acks_latest); - return; - } - call->acks_latest_ts = skb->tstamp; - call->acks_latest = sp->hdr.serial; - if (before(hard_ack, call->tx_hard_ack) || after(hard_ack, call->tx_top)) return rxrpc_proto_abort("AKW", call, 0); -- 2.17.1