From: Shan Wei <shanwei@cn.fujitsu.com>
To: linux-sctp@vger.kernel.org
Subject: [PATCH 2/3] sctp:check parameter value of length in HEARTBEAT chunk
Date: Wed, 12 May 2010 09:30:30 +0000 [thread overview]
Message-ID: <4BEA7536.7080004@cn.fujitsu.com> (raw)
When an endpoint receives HEARTBEAT that parameter value is invalid,
send an ABORT to peer with a Protocol Violation error code.
Signed-off-by: Shan Wei <shanwei@cn.fujitsu.com>
---
net/sctp/sm_statefuns.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/net/sctp/sm_statefuns.c b/net/sctp/sm_statefuns.c
index 3d3e36b..32e75ea 100644
--- a/net/sctp/sm_statefuns.c
+++ b/net/sctp/sm_statefuns.c
@@ -1067,6 +1067,10 @@ sctp_disposition_t sctp_sf_beat_8_3(const struct sctp_endpoint *ep,
*/
chunk->subh.hb_hdr = (sctp_heartbeathdr_t *) chunk->skb->data;
paylen = ntohs(chunk->chunk_hdr->length) - sizeof(sctp_chunkhdr_t);
+
+ if (ntohs(chunk->subh.hb_hdr->info.length) != paylen)
+ sctp_sf_violation_paramvalue(ep, asoc, type, arg,
+ commands);
if (!pskb_pull(chunk->skb, paylen))
goto nomem;
--
1.6.3.3
next reply other threads:[~2010-05-12 9:30 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-05-12 9:30 Shan Wei [this message]
2010-05-12 14:31 ` [PATCH 2/3] sctp:check parameter value of length in HEARTBEAT Vlad Yasevich
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=4BEA7536.7080004@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.