Netdev Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH] sctp: fix memleak in sctp_send_reset_streams
@ 2019-08-13 14:05 zhengbin
  2019-08-13 16:29 ` Marcelo Ricardo Leitner
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: zhengbin @ 2019-08-13 14:05 UTC (permalink / raw)
  To: vyasevich, nhorman, marcelo.leitner, davem, linux-sctp, netdev
  Cc: yi.zhang, zhengbin13

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 <hulkci@huawei.com>
Signed-off-by: zhengbin <zhengbin13@huawei.com>
---
 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


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] sctp: fix memleak in sctp_send_reset_streams
  2019-08-13 14:05 [PATCH] sctp: fix memleak in sctp_send_reset_streams zhengbin
@ 2019-08-13 16:29 ` Marcelo Ricardo Leitner
  2019-08-14  0:10 ` Neil Horman
  2019-08-14  3:53 ` Jakub Kicinski
  2 siblings, 0 replies; 4+ messages in thread
From: Marcelo Ricardo Leitner @ 2019-08-13 16:29 UTC (permalink / raw)
  To: zhengbin; +Cc: vyasevich, nhorman, davem, linux-sctp, netdev, yi.zhang

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 <hulkci@huawei.com>
> Signed-off-by: zhengbin <zhengbin13@huawei.com>

Acked-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>

> ---
>  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
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] sctp: fix memleak in sctp_send_reset_streams
  2019-08-13 14:05 [PATCH] sctp: fix memleak in sctp_send_reset_streams zhengbin
  2019-08-13 16:29 ` Marcelo Ricardo Leitner
@ 2019-08-14  0:10 ` Neil Horman
  2019-08-14  3:53 ` Jakub Kicinski
  2 siblings, 0 replies; 4+ messages in thread
From: Neil Horman @ 2019-08-14  0:10 UTC (permalink / raw)
  To: zhengbin; +Cc: vyasevich, marcelo.leitner, davem, linux-sctp, netdev, yi.zhang

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 <hulkci@huawei.com>
> Signed-off-by: zhengbin <zhengbin13@huawei.com>
> ---
>  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 <nhorman@tuxdriver.com>


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] sctp: fix memleak in sctp_send_reset_streams
  2019-08-13 14:05 [PATCH] sctp: fix memleak in sctp_send_reset_streams zhengbin
  2019-08-13 16:29 ` Marcelo Ricardo Leitner
  2019-08-14  0:10 ` Neil Horman
@ 2019-08-14  3:53 ` Jakub Kicinski
  2 siblings, 0 replies; 4+ messages in thread
From: Jakub Kicinski @ 2019-08-14  3:53 UTC (permalink / raw)
  To: zhengbin
  Cc: vyasevich, nhorman, marcelo.leitner, davem, linux-sctp, netdev, yi.zhang

On Tue, 13 Aug 2019 22:05:50 +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 <hulkci@huawei.com>
> Signed-off-by: zhengbin <zhengbin13@huawei.com>

Applied, thank you!

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, back to index

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-13 14:05 [PATCH] sctp: fix memleak in sctp_send_reset_streams zhengbin
2019-08-13 16:29 ` Marcelo Ricardo Leitner
2019-08-14  0:10 ` Neil Horman
2019-08-14  3:53 ` Jakub Kicinski

Netdev Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/netdev/0 netdev/git/0.git
	git clone --mirror https://lore.kernel.org/netdev/1 netdev/git/1.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 netdev netdev/ https://lore.kernel.org/netdev \
		netdev@vger.kernel.org netdev@archiver.kernel.org
	public-inbox-index netdev


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.netdev


AGPL code for this site: git clone https://public-inbox.org/ public-inbox