Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp1500673ybl; Thu, 22 Aug 2019 15:58:15 -0700 (PDT) X-Google-Smtp-Source: APXvYqw8B3paFsPa8aWsQ8BcQJBhdeo6hasjASPPZWLlvmlUi8hXH/2/LHFLCFu7pMOIiSYYIVVv X-Received: by 2002:a17:90a:ad94:: with SMTP id s20mr2170566pjq.42.1566514695377; Thu, 22 Aug 2019 15:58:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566514695; cv=none; d=google.com; s=arc-20160816; b=pQWEiZlxhGUnsTfyCexnxSQEm2t29+UTS/zLFCzaw06wlEqmbfio9Po+LBZoFo8NWo x1KIDejvzKz9KO5TUt8yEJlkbMXBzU0pisXcDhM8Fi8bfWg3eAHWU2SePMYSMX0RSGJ8 v2A3D5Zl8TRUSs67/hX0DvqHzR8D+WB/0QtunuUyCil6+WNyAr59OXM6GdyCEhNeUieQ AG0PwsZ25TQJH88lkuapGuBlNrPNvMUXRR2Ay/q0wrRu+/DVzBcWptvLJKPKK35fJU7h XhHkj1qtAtyvrCvdaGc1R9POflIS6wQe1f3cRC9K7H4KUJBfmKzUzh6f8XoRdovcUi2S LwvA== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=dv9wrqt06veWCoQ9jpWM92EKu/g9/8DKRjX1jUw18KM=; b=KoI8sgr0KZ7tsneV8cJmQYNvpNIWETh9Nh+nAJ7FQkpWnT/pR7tmXXQqbdvjQwA1Wy 5RModJz2CukdJrSGEVie+UJ4wejjBggspEQiExTvlJjgV+EjOWVvJR11FObreweWEdx4 SLuiV7G4qaenvcuCoqu5GA/4nstDZ6A4mlvD7zruXffzNSsP6wBwy6Oxg3pRKGCy6KZF szSjtBWNU7Yn6O2anyPsgm5pokevdFoTo+bZVoU6Qv7UK9ZRMcwPXIYdljX/hEpYME4g XAtlF3QUX+Pt20bTfaiKqi9gKdd4bomV+eDkMdXPRiR/GiHAaU4hq1GdVl5JbzkvL/Gj pJ0g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=C2acb7KX; 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 123si887698pfy.61.2019.08.22.15.58.00; Thu, 22 Aug 2019 15:58:15 -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=C2acb7KX; 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 S1732297AbfHVRL2 (ORCPT + 99 others); Thu, 22 Aug 2019 13:11:28 -0400 Received: from mail.kernel.org ([198.145.29.99]:59470 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390716AbfHVRJQ (ORCPT ); Thu, 22 Aug 2019 13:09:16 -0400 Received: from sasha-vm.mshome.net (wsip-184-188-36-2.sd.sd.cox.net [184.188.36.2]) (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 85A4B23407; Thu, 22 Aug 2019 17:09:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1566493755; bh=Gff5SQSPmRmvtp8vZDvZq7goePM271B+gwda976FxFI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=C2acb7KXMRi0oKpTKDOoiJCjAgggkKSP7K1edUK2AdpFwl7N/56u+bIuZGMF4hsSZ q7FZXdL5sPSuNbGzNjyTAh+Zm8U/0Co35n/BZJxHxMjeyarOG0BLFYEqqKlGi1td/G 8d6nhNrTiSp0XMzgyvlJCX6fdqxFQx15FXEaLXpw= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: zhengbin , Hulk Robot , Marcelo Ricardo Leitner , Neil Horman , Jakub Kicinski , Greg Kroah-Hartman Subject: [PATCH 5.2 113/135] sctp: fix memleak in sctp_send_reset_streams Date: Thu, 22 Aug 2019 13:07:49 -0400 Message-Id: <20190822170811.13303-114-sashal@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190822170811.13303-1-sashal@kernel.org> References: <20190822170811.13303-1-sashal@kernel.org> MIME-Version: 1.0 X-KernelTest-Patch: http://kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.2.10-rc1.gz X-KernelTest-Tree: git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git X-KernelTest-Branch: linux-5.2.y X-KernelTest-Patches: git://git.kernel.org/pub/scm/linux/kernel/git/stable/stable-queue.git X-KernelTest-Version: 5.2.10-rc1 X-KernelTest-Deadline: 2019-08-24T17:07+00:00 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: zhengbin [ Upstream commit 6d5afe20397b478192ed8c38ec0ee10fa3aec649 ] If the stream outq is not empty, need to kfree nstr_list. Fixes: d570a59c5b5f ("sctp: only allow the out stream reset when the stream outq is empty") Reported-by: Hulk Robot Signed-off-by: zhengbin Acked-by: Marcelo Ricardo Leitner Acked-by: Neil Horman Signed-off-by: Jakub Kicinski Signed-off-by: Greg Kroah-Hartman --- net/sctp/stream.c | 1 + 1 file changed, 1 insertion(+) diff --git a/net/sctp/stream.c b/net/sctp/stream.c index 25946604af85c..e83cdaa2ab765 100644 --- a/net/sctp/stream.c +++ b/net/sctp/stream.c @@ -316,6 +316,7 @@ int sctp_send_reset_streams(struct sctp_association *asoc, nstr_list[i] = htons(str_list[i]); if (out && !sctp_stream_outq_is_empty(stream, str_nums, nstr_list)) { + kfree(nstr_list); retval = -EAGAIN; goto out; } -- 2.20.1