Received: by 10.223.176.5 with SMTP id f5csp989840wra; Fri, 2 Feb 2018 09:19:44 -0800 (PST) X-Google-Smtp-Source: AH8x224OoMF9l1BPUXVec8DdP60JwIYrp+CMsqyzHNWFuGAhvICdH61caIgQTrSYWuULMc1Shoa8 X-Received: by 2002:a17:902:20c8:: with SMTP id v8-v6mr35493585plg.226.1517591984331; Fri, 02 Feb 2018 09:19:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517591984; cv=none; d=google.com; s=arc-20160816; b=pl47/ka7T1szC5aK4TOC3DB5EE5H6kyBS9wMncMJ+mBHu7AY4T5jk9cF4sl9GtZJWd BDJmp3Q9iF8wscSRGY8f2fT3vmy4UP2qNUicGMs7hsMajoRmy2uTD7PxJhyxuulVkf++ 4450Id2+L+GkOtKVfRLO92hpJ1l9IoBab0xlShQ81Da3OkgfoQIwGNzwoBcomlyUtL5Z /Y5y6SfML78AgBfdl11I5o+IKoqzbajJcxoo9MAxzYgr23bYzNiJ58ptilteDF5x3lCa yexYPLK8VX4qTQBfKEgQziiMnXsdp6pQenaUlyLgLm4IhN1A0Nn8+RbRvYWQur0Obxzt 0FJw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=I9tUJDBkBxC4dm76IEndzDWYwkkZgGbE6ZzqryfKStk=; b=fM+XwAs5VajlpIlqbA5qUADCu7KHXAt3G+MgfTOjhm4Q7VuBf8rKRP59Mcg2UwYS/u yfvi1oG7kn4AChcVnGq0nlOhxFDerJiCpsf8MqqzZ/UX+aV0tcWiC30K4s9wC+njnOwE PPJfJy2kIaDvsmNcJJ6ubT8wWdMk2hVaYk2oDw4EruMjTgdrCRVIcpEaBrmCfF6UsFcw F3RFgVrO4DpVf1qQEBLUvFwMwNoFxCrinU56v7ayBl13JiHSnyAwZAq5y1tumk4LlLZ1 /IOd2ymlVShnENtj7CVcU7/kOVn9wHR+l9VtcJsJIdXWeW7IyxYUU09jN3tPreFszUYQ 9nTA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b13si2116236pfm.305.2018.02.02.09.19.29; Fri, 02 Feb 2018 09:19:44 -0800 (PST) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753772AbeBBRTA (ORCPT + 99 others); Fri, 2 Feb 2018 12:19:00 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:38762 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753122AbeBBRLq (ORCPT ); Fri, 2 Feb 2018 12:11:46 -0500 Received: from localhost (LFbn-1-12258-90.w90-92.abo.wanadoo.fr [90.92.71.90]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id A6453F15; Fri, 2 Feb 2018 17:11:45 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Xin Long , Marcelo Ricardo Leitner , "David S. Miller" , Sasha Levin Subject: [PATCH 4.14 074/156] sctp: set sender next_tsn for the old result with ctsn_ack_point plus 1 Date: Fri, 2 Feb 2018 17:57:35 +0100 Message-Id: <20180202140843.628645681@linuxfoundation.org> X-Mailer: git-send-email 2.16.1 In-Reply-To: <20180202140840.242829545@linuxfoundation.org> References: <20180202140840.242829545@linuxfoundation.org> User-Agent: quilt/0.65 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Xin Long [ Upstream commit 52a395896a051a3d5c34fba67c324f69ec5e67c6 ] When doing asoc reset, if the sender of the response has already sent some chunk and increased asoc->next_tsn before the duplicate request comes, the response will use the old result with an incorrect sender next_tsn. Better than asoc->next_tsn, asoc->ctsn_ack_point can't be changed after the sender of the response has performed the asoc reset and before the peer has confirmed it, and it's value is still asoc->next_tsn original value minus 1. This patch sets sender next_tsn for the old result with ctsn_ack_point plus 1 when processing the duplicate request, to make sure the sender next_tsn value peer gets will be always right. Fixes: 692787cef651 ("sctp: implement receiver-side procedures for the SSN/TSN Reset Request Parameter") Signed-off-by: Xin Long Acked-by: Marcelo Ricardo Leitner Signed-off-by: David S. Miller Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- net/sctp/stream.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/net/sctp/stream.c +++ b/net/sctp/stream.c @@ -541,7 +541,7 @@ struct sctp_chunk *sctp_process_strreset i = asoc->strreset_inseq - request_seq - 1; result = asoc->strreset_result[i]; if (result == SCTP_STRRESET_PERFORMED) { - next_tsn = asoc->next_tsn; + next_tsn = asoc->ctsn_ack_point + 1; init_tsn = sctp_tsnmap_get_ctsn(&asoc->peer.tsn_map) + 1; }