All of lore.kernel.org
 help / color / mirror / Atom feed
From: Shan Wei <shanwei@cn.fujitsu.com>
To: linux-sctp@vger.kernel.org
Subject: Re: [PATCH CLEANUP] sctp: fix the comment of  sctp_sf_violation_paramlen()
Date: Tue, 18 May 2010 10:08:33 +0000	[thread overview]
Message-ID: <4BF26721.8070608@cn.fujitsu.com> (raw)
In-Reply-To: <4BF0DD56.70105@cn.fujitsu.com>

Vlad Yasevich wrote, at 05/17/2010 10:30 PM:
>> @@sctp_verify_asconf()
>> 3045                 if (param.v > chunk_end - length ||
>> 3046                     length < sizeof(sctp_paramhdr_t))
>> 3047                         return 0;
>>
> 
> This doesn't check the 'true' length of the parameter.  It makes sure that
> the length specified is at least as long as sctp_paramhdr_t (minimum length),
> and not longer then the end of the chunk.  It makes no assumptions about
> the actual length of the parameter.

Thanks for your exact description.

How about fixing like this?

diff --git a/net/sctp/sm_statefuns.c b/net/sctp/sm_statefuns.c
index 565a690..32e2c34 100644
--- a/net/sctp/sm_statefuns.c
+++ b/net/sctp/sm_statefuns.c
@@ -4329,8 +4329,9 @@ static sctp_disposition_t sctp_sf_violation_chunklen(
 
 /*
  * Handle a protocol violation when the parameter length is invalid.
- * "Invalid" length is identified as smaller than the minimal length a
- * given parameter can be.
+ * If the length is smaller than the minimum length of a given parameter,
+ * or accumulated length in multi parameters exceeds the end of the chunk,
+ * the length is considered as invalid.
  */
 static sctp_disposition_t sctp_sf_violation_paramlen(
 				     const struct sctp_endpoint *ep,

-- 
Best Regards
-----
Shan Wei


> 
> -vlad
> 
> 
> 



      parent reply	other threads:[~2010-05-18 10:08 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-17  6:08 [PATCH CLEANUP] sctp: fix the comment of sctp_sf_violation_paramlen() Shan Wei
2010-05-17  6:14 ` Wei Yongjun
2010-05-17  7:55 ` Shan Wei
2010-05-17 14:30 ` Vlad Yasevich
2010-05-18 10:08 ` Shan Wei [this message]

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=4BF26721.8070608@cn.fujitsu.com \
    --to=shanwei@cn.fujitsu.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.