All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 2/3] sctp:check parameter value of length in HEARTBEAT chunk
@ 2010-05-12  9:30 Shan Wei
  2010-05-12 14:31 ` [PATCH 2/3] sctp:check parameter value of length in HEARTBEAT Vlad Yasevich
  0 siblings, 1 reply; 2+ messages in thread
From: Shan Wei @ 2010-05-12  9:30 UTC (permalink / raw)
  To: linux-sctp

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

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

end of thread, other threads:[~2010-05-12 14:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-12  9:30 [PATCH 2/3] sctp:check parameter value of length in HEARTBEAT chunk Shan Wei
2010-05-12 14:31 ` [PATCH 2/3] sctp:check parameter value of length in HEARTBEAT Vlad Yasevich

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.