lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20171031170636.GA3230@hmswarspite.think-freely.org>
Date:   Tue, 31 Oct 2017 13:06:36 -0400
From:   Neil Horman <nhorman@...driver.com>
To:     Wei Yongjun <weiyongjun1@...wei.com>
Cc:     Vlad Yasevich <vyasevich@...il.com>,
        Marcelo Ricardo Leitner <marcelo.leitner@...il.com>,
        linux-sctp@...r.kernel.org, netdev@...r.kernel.org
Subject: Re: [PATCH net-next] sctp: fix error return code in
 sctp_send_add_streams()

On Tue, Oct 31, 2017 at 01:28:16PM +0000, Wei Yongjun wrote:
> Fix to returnerror code -ENOMEM from the sctp_make_strreset_addstrm()
> error handling case instead of 0. 'retval' can be overwritten to 0 after
> call sctp_stream_alloc_out().
> 
> Fixes: e090abd0d81c ("sctp: factor out stream->out allocation")
> Signed-off-by: Wei Yongjun <weiyongjun1@...wei.com>
> ---
>  net/sctp/stream.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/net/sctp/stream.c b/net/sctp/stream.c
> index 03764fc..b8c8cab 100644
> --- a/net/sctp/stream.c
> +++ b/net/sctp/stream.c
> @@ -393,7 +393,7 @@ int sctp_send_add_streams(struct sctp_association *asoc,
>  {
>  	struct sctp_stream *stream = &asoc->stream;
>  	struct sctp_chunk *chunk = NULL;
> -	int retval = -ENOMEM;
> +	int retval;
>  	__u32 outcnt, incnt;
>  	__u16 out, in;
>  
> @@ -425,8 +425,10 @@ int sctp_send_add_streams(struct sctp_association *asoc,
>  	}
>  
>  	chunk = sctp_make_strreset_addstrm(asoc, out, in);
> -	if (!chunk)
> +	if (!chunk) {
> +		retval = -ENOMEM;
>  		goto out;
> +	}
>  
>  	asoc->strreset_chunk = chunk;
>  	sctp_chunk_hold(asoc->strreset_chunk);
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-sctp" in
> the body of a message to majordomo@...r.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 
Acked-by: Neil Horman <nhorman@...driver.com>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ