Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp84919imu; Wed, 21 Nov 2018 15:51:54 -0800 (PST) X-Google-Smtp-Source: AFSGD/WGCGf2rMRWORtXqx1RioZhSYAfynNKvrUXMtqCfB79OP0PCO0emWaDcz3yAKu06ezR8WKD X-Received: by 2002:a17:902:74c1:: with SMTP id f1mr8722843plt.273.1542844314308; Wed, 21 Nov 2018 15:51:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542844314; cv=none; d=google.com; s=arc-20160816; b=eLy0F73guRgbKS0h0FcvY4VdVtFDv/izJEtHGrLZhM2N2uGkUycsIdWS+kM9J+o0/V gvYcGdR6GpA/2zJVaf30+JNRy05tMLMeV8VJET7RZhZhw0B7Z06lmqY44HXmi1zl/BKC p5jZAieW12VqwrRv8yPl027HA05TalR3l4/tpTeYHzv/lcPRxB1RUPC5XUO9x/io/BpG zf2QJGDfeDFdQgUORWZ3wY3X/16zuHS+HZP6ZQZjyA8Te1W6gMml1LfwXngElJsyHFiZ ePf1/8Svd4sz0eJ3N6GTK0GgWsHGyoi6+u4IQTmlyB9BkvJ3RHqjIXmeqlGwsAwi58GY 2D7g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=7peb1bw+eK9tlMSv6h5vWiKwK6Dt9ASG0JNGnTE/35A=; b=xIrobwwTrM+MWE820rAvt7GlxMmc1mcPzQPpjdfBgvqTBk1FN79zJTMCjIzcmqRuwP B0vgrd460XPZEzUQTZxbTXlBnmXiu3UqcAuFPgeODArxnbEbs97dzq9Xrf6jKqzeWJvV o+1Lt5OWhFrCC7mLI8ZGNRBl+eDqt9TZa88oD6nqIzoCYti5I2/OhIE0HlMzimYAeovq ZcnWG9Vb/A26Sn6LySHs0qbrNti2WZFBeY8Jg5nd97rA0M3AhkKH1JzRTk/Mg/ZQOqe+ o5VbM1SUX2Os7b/m1Jrvw5Jj0dFvTGQXFSOQPJEduAehb6hzZL+572UXRvBALsN1/Zge yYZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=1DDGAjW9; 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 27si47718424pgp.135.2018.11.21.15.51.39; Wed, 21 Nov 2018 15:51:54 -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; dkim=pass header.i=@kernel.org header.s=default header.b=1DDGAjW9; 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 S2388274AbeKVFog (ORCPT + 99 others); Thu, 22 Nov 2018 00:44:36 -0500 Received: from mail.kernel.org ([198.145.29.99]:39170 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726862AbeKVFof (ORCPT ); Thu, 22 Nov 2018 00:44:35 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id D5267214D9; Wed, 21 Nov 2018 19:09:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1542827342; bh=baKAklJM3BM8ZGuxCSO5DafktI6aNqMuu/XyJIroHF0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=1DDGAjW9ZzweZb05l//ePcfcufed4dBXVpBEWPoB3WHgtk3zKY0Xg3mQKfZaf4uFw wbhw4j2SENkyaQCpxQpxS7l6vIJPJKnGRSnJkyXQMUl44JZRILDFB5vHpK4Wust+Xv YzgvbcrDZ+ugeQJNWRmfAr1yLFNKz0cMXndMnVys= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jianwen Ji , Xin Long , "David S. Miller" Subject: [PATCH 4.14 14/21] sctp: not increase streams incnt before sending addstrm_in request Date: Wed, 21 Nov 2018 20:06:58 +0100 Message-Id: <20181121183422.714815106@linuxfoundation.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181121183422.103826775@linuxfoundation.org> References: <20181121183422.103826775@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 e1e46479847e66f78f79d8c24d5169a5954b3fc2 ] Different from processing the addstrm_out request, The receiver handles an addstrm_in request by sending back an addstrm_out request to the sender who will increase its stream's in and incnt later. Now stream->incnt has been increased since it sent out the addstrm_in request in sctp_send_add_streams(), with the wrong stream->incnt will even cause crash when copying stream info from the old stream's in to the new one's in sctp_process_strreset_addstrm_out(). This patch is to fix it by simply removing the stream->incnt change from sctp_send_add_streams(). Fixes: 242bd2d519d7 ("sctp: implement sender-side procedures for Add Incoming/Outgoing Streams Request Parameter") Reported-by: Jianwen Ji Signed-off-by: Xin Long Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- net/sctp/stream.c | 1 - 1 file changed, 1 deletion(-) --- a/net/sctp/stream.c +++ b/net/sctp/stream.c @@ -310,7 +310,6 @@ int sctp_send_add_streams(struct sctp_as goto out; } - stream->incnt = incnt; stream->outcnt = outcnt; asoc->strreset_outstanding = !!out + !!in;