netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 2/4] [SCTP]: Verify some mandatory parameters.
@ 2007-01-11 19:41 Sridhar Samudrala
  2007-01-16  3:15 ` David Miller
  2007-01-17 20:22 ` Brian Haley
  0 siblings, 2 replies; 4+ messages in thread
From: Sridhar Samudrala @ 2007-01-11 19:41 UTC (permalink / raw)
  To: davem; +Cc: netdev, lksctp-developers

[SCTP]: Verify some mandatory parameters.

Verify init_tag and a_rwnd mandatory parameters in INIT and
INIT-ACK chunks.

Signed-off-by: Vlad Yasevich <vladislav.yasevich@hp.com>
Signed-off-by: Sridhar Samudrala <sri@us.ibm.com>

---
 net/sctp/sm_make_chunk.c |    4 +++-
 net/sctp/sm_statefuns.c  |   19 -------------------
 2 files changed, 3 insertions(+), 20 deletions(-)

diff --git a/net/sctp/sm_make_chunk.c b/net/sctp/sm_make_chunk.c
index ea0f8fa..12c0e17 100644
--- a/net/sctp/sm_make_chunk.c
+++ b/net/sctp/sm_make_chunk.c
@@ -1775,7 +1775,9 @@ int sctp_verify_init(const struct sctp_association *asoc,

 	/* Verify stream values are non-zero. */
 	if ((0 == peer_init->init_hdr.num_outbound_streams) ||
-	    (0 == peer_init->init_hdr.num_inbound_streams)) {
+	    (0 == peer_init->init_hdr.num_inbound_streams) ||
+	    (0 == peer_init->init_hdr.init_tag) ||
+	    (SCTP_DEFAULT_MINWINDOW > ntohl(peer_init->init_hdr.a_rwnd))) {

 		sctp_process_inv_mandatory(asoc, chunk, errp);
 		return 0;
diff --git a/net/sctp/sm_statefuns.c b/net/sctp/sm_statefuns.c
index aa51d19..2c165dc 100644
--- a/net/sctp/sm_statefuns.c
+++ b/net/sctp/sm_statefuns.c
@@ -440,7 +440,6 @@ sctp_disposition_t sctp_sf_do_5_1C_ack(const struct sctp_endpoint *ep,
 {
 	struct sctp_chunk *chunk = arg;
 	sctp_init_chunk_t *initchunk;
-	__u32 init_tag;
 	struct sctp_chunk *err_chunk;
 	struct sctp_packet *packet;
 	sctp_error_t error;
@@ -462,24 +461,6 @@ sctp_disposition_t sctp_sf_do_5_1C_ack(const struct sctp_endpoint *ep,
 	/* Grab the INIT header.  */
 	chunk->subh.init_hdr = (sctp_inithdr_t *) chunk->skb->data;

-	init_tag = ntohl(chunk->subh.init_hdr->init_tag);
-
-	/* Verification Tag: 3.3.3
-	 *   If the value of the Initiate Tag in a received INIT ACK
-	 *   chunk is found to be 0, the receiver MUST treat it as an
-	 *   error and close the association by transmitting an ABORT.
-	 */
-	if (!init_tag) {
-		struct sctp_chunk *reply = sctp_make_abort(asoc, chunk, 0);
-		if (!reply)
-			goto nomem;
-
-		sctp_add_cmd_sf(commands, SCTP_CMD_REPLY, SCTP_CHUNK(reply));
-		return sctp_stop_t1_and_abort(commands, SCTP_ERROR_INV_PARAM,
-					      ECONNREFUSED, asoc,
-					      chunk->transport);
-	}
-
 	/* Verify the INIT chunk before processing it. */
 	err_chunk = NULL;
 	if (!sctp_verify_init(asoc, chunk->chunk_hdr->type,
--


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

* Re: [PATCH 2/4] [SCTP]: Verify some mandatory parameters.
  2007-01-11 19:41 [PATCH 2/4] [SCTP]: Verify some mandatory parameters Sridhar Samudrala
@ 2007-01-16  3:15 ` David Miller
  2007-01-17 20:22 ` Brian Haley
  1 sibling, 0 replies; 4+ messages in thread
From: David Miller @ 2007-01-16  3:15 UTC (permalink / raw)
  To: sri; +Cc: netdev, lksctp-developers

From: Sridhar Samudrala <sri@us.ibm.com>
Date: Thu, 11 Jan 2007 11:41:27 -0800

> [SCTP]: Verify some mandatory parameters.
> 
> Verify init_tag and a_rwnd mandatory parameters in INIT and
> INIT-ACK chunks.
> 
> Signed-off-by: Vlad Yasevich <vladislav.yasevich@hp.com>
> Signed-off-by: Sridhar Samudrala <sri@us.ibm.com>

Applied.

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

* Re: [PATCH 2/4] [SCTP]: Verify some mandatory parameters.
  2007-01-11 19:41 [PATCH 2/4] [SCTP]: Verify some mandatory parameters Sridhar Samudrala
  2007-01-16  3:15 ` David Miller
@ 2007-01-17 20:22 ` Brian Haley
  2007-01-24  6:32   ` David Miller
  1 sibling, 1 reply; 4+ messages in thread
From: Brian Haley @ 2007-01-17 20:22 UTC (permalink / raw)
  To: Sridhar Samudrala; +Cc: davem, netdev, lksctp-developers

[-- Attachment #1: Type: text/plain, Size: 389 bytes --]

> --- a/net/sctp/sm_statefuns.c
> +++ b/net/sctp/sm_statefuns.c
> @@ -462,24 +461,6 @@ sctp_disposition_t sctp_sf_do_5_1C_ack(const struct sctp_endpoint *ep,

> -	if (!init_tag) {
> -		struct sctp_chunk *reply = sctp_make_abort(asoc, chunk, 0);
> -		if (!reply)
> -			goto nomem;

This introduced a compiler warning, easily fixed.

-Brian


Signed-off-by: Brian Haley <brian.haley@hp.com>

[-- Attachment #2: sctp_warn.patch --]
[-- Type: text/x-patch, Size: 331 bytes --]

diff --git a/net/sctp/sm_statefuns.c b/net/sctp/sm_statefuns.c
index fce1f60..fbbc9e6 100644
--- a/net/sctp/sm_statefuns.c
+++ b/net/sctp/sm_statefuns.c
@@ -531,9 +531,6 @@ sctp_disposition_t sctp_sf_do_5_1C_ack(c
 			SCTP_CHUNK(err_chunk));
 
 	return SCTP_DISPOSITION_CONSUME;
-
-nomem:
-	return SCTP_DISPOSITION_NOMEM;
 }
 
 /*

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

* Re: [PATCH 2/4] [SCTP]: Verify some mandatory parameters.
  2007-01-17 20:22 ` Brian Haley
@ 2007-01-24  6:32   ` David Miller
  0 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2007-01-24  6:32 UTC (permalink / raw)
  To: brian.haley; +Cc: sri, netdev, lksctp-developers

From: Brian Haley <brian.haley@hp.com>
Date: Wed, 17 Jan 2007 15:22:21 -0500

> > --- a/net/sctp/sm_statefuns.c
> > +++ b/net/sctp/sm_statefuns.c
> > @@ -462,24 +461,6 @@ sctp_disposition_t sctp_sf_do_5_1C_ack(const struct sctp_endpoint *ep,
> 
> > -	if (!init_tag) {
> > -		struct sctp_chunk *reply = sctp_make_abort(asoc, chunk, 0);
> > -		if (!reply)
> > -			goto nomem;
> 
> This introduced a compiler warning, easily fixed.
> 
> Signed-off-by: Brian Haley <brian.haley@hp.com>

Applied, thanks a lot Brian.

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

end of thread, other threads:[~2007-01-24  6:32 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-01-11 19:41 [PATCH 2/4] [SCTP]: Verify some mandatory parameters Sridhar Samudrala
2007-01-16  3:15 ` David Miller
2007-01-17 20:22 ` Brian Haley
2007-01-24  6:32   ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).