From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 05425C433FF for ; Wed, 14 Aug 2019 00:11:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D20B12067D for ; Wed, 14 Aug 2019 00:11:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726530AbfHNALa (ORCPT ); Tue, 13 Aug 2019 20:11:30 -0400 Received: from charlotte.tuxdriver.com ([70.61.120.58]:43574 "EHLO smtp.tuxdriver.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726316AbfHNAL3 (ORCPT ); Tue, 13 Aug 2019 20:11:29 -0400 Received: from cpe-2606-a000-1405-226e-0-0-0-cbf.dyn6.twc.com ([2606:a000:1405:226e::cbf] helo=localhost) by smtp.tuxdriver.com with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.63) (envelope-from ) id 1hxgsf-00020w-Q1; Tue, 13 Aug 2019 20:11:12 -0400 Date: Tue, 13 Aug 2019 20:10:37 -0400 From: Neil Horman To: zhengbin Cc: vyasevich@gmail.com, marcelo.leitner@gmail.com, davem@davemloft.net, linux-sctp@vger.kernel.org, netdev@vger.kernel.org, yi.zhang@huawei.com Subject: Re: [PATCH] sctp: fix memleak in sctp_send_reset_streams Message-ID: <20190814001037.GB11098@localhost.localdomain> References: <1565705150-17242-1-git-send-email-zhengbin13@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1565705150-17242-1-git-send-email-zhengbin13@huawei.com> User-Agent: Mutt/1.12.0 (2019-05-25) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Tue, Aug 13, 2019 at 10:05:50PM +0800, zhengbin wrote: > 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 > --- > net/sctp/stream.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/net/sctp/stream.c b/net/sctp/stream.c > index 2594660..e83cdaa 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.7.4 > > Acked-by: Neil Horman