All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vlad Yasevich <vladislav.yasevich@hp.com>
To: linux-sctp@vger.kernel.org
Subject: Re: connect() hangs after binding to three IP addresses and auth_enable
Date: Mon, 29 Mar 2010 13:02:46 +0000	[thread overview]
Message-ID: <4BB0A4F6.9070005@hp.com> (raw)
In-Reply-To: <001701cacc68$d6bb1390$84313ab0$@com>



Wei Yongjun wrote:
> George Cheimonidis wrote:
>> Hi Vlad!
>>
>> I have recompiled the 2.6.33 kernel with your debug patch. I have also
>> enabled SCTP debugging with with CONFIG_SCTP_DBG_MSG=y.
>> You can find the log messages in the attached file. Hope it helps!
>>
>> Best regards
> Hi George
> 
> With your description, I can reproduct this problem now.
> can your check whether this PATCH can fix this BUG?

Good catch Wei.   How did you reproduce this?

Looks like there are other parameters that need this as well.

- supported address family parameter (if only 1 address family, the size
  doesn't account for padding)

- supported extensions (depending on the extensions, we might be unaligned)

We just happen to luck out with the other parameters.

This also needs to be fixed in make_init_ack().

-vlad

> 
> [PATCH] sctp: fix to calc the init chunk length correctly
> 
> When calc the init chunk length, we should not only calc
> the length of parameters, but also plus the parameters
> zero padding length, such as AUTH HMACS parameter and
> CHUNKS parameter. Without the parameters zero padding
> length will cause oops.
> 
> Reported-by: George Cheimonidis <gchimon@gmail.com>
> Signed-off-by: Wei Yongjun <yjwei@cn.fujitsu.com>
> ---
>  net/sctp/sm_make_chunk.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/net/sctp/sm_make_chunk.c b/net/sctp/sm_make_chunk.c
> index 9e73291..c199cc8 100644
> --- a/net/sctp/sm_make_chunk.c
> +++ b/net/sctp/sm_make_chunk.c
> @@ -237,14 +237,14 @@ struct sctp_chunk *sctp_make_init(const struct sctp_association *asoc,
>  		/* Add HMACS parameter length if any were defined */
>  		auth_hmacs = (sctp_paramhdr_t *)asoc->c.auth_hmacs;
>  		if (auth_hmacs->length)
> -			chunksize += ntohs(auth_hmacs->length);
> +			chunksize += WORD_ROUND(ntohs(auth_hmacs->length));
>  		else
>  			auth_hmacs = NULL;
>  
>  		/* Add CHUNKS parameter length */
>  		auth_chunks = (sctp_paramhdr_t *)asoc->c.auth_chunks;
>  		if (auth_chunks->length)
> -			chunksize += ntohs(auth_chunks->length);
> +			chunksize += WORD_ROUND(ntohs(auth_chunks->length));
>  		else
>  			auth_chunks = NULL;
>  

  parent reply	other threads:[~2010-03-29 13:02 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-25 22:16 connect() hangs after binding to three IP addresses and auth_enable is set George Cheimonidis
2010-03-26 14:36 ` connect() hangs after binding to three IP addresses and auth_enable Vlad Yasevich
2010-03-27 12:51 ` George Cheimonidis
2010-03-29  4:11 ` Wei Yongjun
2010-03-29 13:02 ` Vlad Yasevich [this message]
2010-03-30  1:41 ` Wei Yongjun
2010-03-30 15:06 ` George Cheimonidis

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4BB0A4F6.9070005@hp.com \
    --to=vladislav.yasevich@hp.com \
    --cc=linux-sctp@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.