* [PATCH 2.6.25 0/9]: SCTP: Update ADD-IP implementation to conform to spec
@ 2007-12-17 21:32 Vlad Yasevich
2007-12-17 21:32 ` [PATCH 2.6.25 1/9] SCTP: Discard unauthenticated ASCONF and ASCONF ACK chunks Vlad Yasevich
` (9 more replies)
0 siblings, 10 replies; 22+ messages in thread
From: Vlad Yasevich @ 2007-12-17 21:32 UTC (permalink / raw)
To: netdev; +Cc: lksctp-developers
The following is a set of patches that updates the SCTP ADD-IP implementation
to conform to the recently published RFC.
ADD-IP is a SCTP Dynamic Address Configuration extensions, whereby
the two end systems can dynamically modify the address lists for a given
connection. One of the applications of this is mobility. The systems
exchange Address Configuration (ASCONF) and Address Configuration
Acknowlegement (ASCONF-ACK) messages which contain the info. If you
want more info the operation, read RFC 5061.
The implementation in lksctp was a few years old and implemented draft-05
of the specification. So this long overdue.
-vlad
^ permalink raw reply [flat|nested] 22+ messages in thread
* [PATCH 2.6.25 1/9] SCTP: Discard unauthenticated ASCONF and ASCONF ACK chunks
2007-12-17 21:32 [PATCH 2.6.25 0/9]: SCTP: Update ADD-IP implementation to conform to spec Vlad Yasevich
@ 2007-12-17 21:32 ` Vlad Yasevich
2007-12-20 22:08 ` David Miller
2007-12-17 21:32 ` [PATCH 2.6.25 2/9] SCTP: Handle the wildcard ADD-IP Address parameter Vlad Yasevich
` (8 subsequent siblings)
9 siblings, 1 reply; 22+ messages in thread
From: Vlad Yasevich @ 2007-12-17 21:32 UTC (permalink / raw)
To: netdev; +Cc: lksctp-developers, Vlad Yasevich
Now that we support AUTH, discard unauthenticated ASCONF and ASCONF ACK
chunks as mandated in the ADD-IP spec.
Signed-off-by: Vlad Yasevich <vladislav.yasevich@hp.com>
---
net/sctp/sm_statefuns.c | 18 ++++++++++++++++++
1 files changed, 18 insertions(+), 0 deletions(-)
diff --git a/net/sctp/sm_statefuns.c b/net/sctp/sm_statefuns.c
index 5fb8477..859be75 100644
--- a/net/sctp/sm_statefuns.c
+++ b/net/sctp/sm_statefuns.c
@@ -3399,6 +3399,15 @@ sctp_disposition_t sctp_sf_do_asconf(const struct sctp_endpoint *ep,
return sctp_sf_pdiscard(ep, asoc, type, arg, commands);
}
+ /* ADD-IP: Section 4.1.1
+ * This chunk MUST be sent in an authenticated way by using
+ * the mechanism defined in [I-D.ietf-tsvwg-sctp-auth]. If this chunk
+ * is received unauthenticated it MUST be silently discarded as
+ * described in [I-D.ietf-tsvwg-sctp-auth].
+ */
+ if (!sctp_addip_noauth && !chunk->auth)
+ return sctp_sf_discard_chunk(ep, asoc, type, arg, commands);
+
/* Make sure that the ASCONF ADDIP chunk has a valid length. */
if (!sctp_chunk_length_valid(chunk, sizeof(sctp_addip_chunk_t)))
return sctp_sf_violation_chunklen(ep, asoc, type, arg,
@@ -3485,6 +3494,15 @@ sctp_disposition_t sctp_sf_do_asconf_ack(const struct sctp_endpoint *ep,
return sctp_sf_pdiscard(ep, asoc, type, arg, commands);
}
+ /* ADD-IP, Section 4.1.2:
+ * This chunk MUST be sent in an authenticated way by using
+ * the mechanism defined in [I-D.ietf-tsvwg-sctp-auth]. If this chunk
+ * is received unauthenticated it MUST be silently discarded as
+ * described in [I-D.ietf-tsvwg-sctp-auth].
+ */
+ if (!sctp_addip_noauth && !asconf_ack->auth)
+ return sctp_sf_discard_chunk(ep, asoc, type, arg, commands);
+
/* Make sure that the ADDIP chunk has a valid length. */
if (!sctp_chunk_length_valid(asconf_ack, sizeof(sctp_addip_chunk_t)))
return sctp_sf_violation_chunklen(ep, asoc, type, arg,
--
1.5.3.5
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [PATCH 2.6.25 2/9] SCTP: Handle the wildcard ADD-IP Address parameter
2007-12-17 21:32 [PATCH 2.6.25 0/9]: SCTP: Update ADD-IP implementation to conform to spec Vlad Yasevich
2007-12-17 21:32 ` [PATCH 2.6.25 1/9] SCTP: Discard unauthenticated ASCONF and ASCONF ACK chunks Vlad Yasevich
@ 2007-12-17 21:32 ` Vlad Yasevich
2007-12-20 22:09 ` David Miller
2007-12-17 21:32 ` [PATCH 2.6.25 3/9] SCTP: Add the handling of "Set Primary IP Address" parameter to INIT Vlad Yasevich
` (7 subsequent siblings)
9 siblings, 1 reply; 22+ messages in thread
From: Vlad Yasevich @ 2007-12-17 21:32 UTC (permalink / raw)
To: netdev; +Cc: lksctp-developers, Vlad Yasevich
The Address Parameter in the parameter list of the ASCONF chunk
may be a wildcard address. In this case special processing
is required. For the 'add' case, the source IP of the packet is
added. In the 'del' case, all addresses except the source IP
of packet are removed. In the "mark primary" case, the source
address is marked as primary.
Signed-off-by: Vlad Yasevich <vladislav.yasevich@hp.com>
---
include/net/sctp/structs.h | 2 ++
net/sctp/associola.c | 17 +++++++++++++++++
net/sctp/sm_make_chunk.c | 40 ++++++++++++++++++++++++++++++++++++----
3 files changed, 55 insertions(+), 4 deletions(-)
diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h
index 002a00a..55acadc 100644
--- a/include/net/sctp/structs.h
+++ b/include/net/sctp/structs.h
@@ -1938,6 +1938,8 @@ void sctp_assoc_rwnd_increase(struct sctp_association *, unsigned);
void sctp_assoc_rwnd_decrease(struct sctp_association *, unsigned);
void sctp_assoc_set_primary(struct sctp_association *,
struct sctp_transport *);
+void sctp_assoc_del_nonprimary_peers(struct sctp_association *,
+ struct sctp_transport *);
int sctp_assoc_set_bind_addr_from_ep(struct sctp_association *,
gfp_t);
int sctp_assoc_set_bind_addr_from_cookie(struct sctp_association *,
diff --git a/net/sctp/associola.c b/net/sctp/associola.c
index 33ae9b0..61bebb9 100644
--- a/net/sctp/associola.c
+++ b/net/sctp/associola.c
@@ -730,6 +730,23 @@ struct sctp_transport *sctp_assoc_lookup_paddr(
return NULL;
}
+/* Remove all transports except a give one */
+void sctp_assoc_del_nonprimary_peers(struct sctp_association *asoc,
+ struct sctp_transport *primary)
+{
+ struct sctp_transport *temp;
+ struct sctp_transport *t;
+
+ list_for_each_entry_safe(t, temp, &asoc->peer.transport_addr_list,
+ transports) {
+ /* if the current transport is not the primary one, delete it */
+ if (t != primary)
+ sctp_assoc_rm_peer(asoc, t);
+ }
+
+ return;
+}
+
/* Engage in transport control operations.
* Mark the transport up or down and send a notification to the user.
* Select and update the new active and retran paths.
diff --git a/net/sctp/sm_make_chunk.c b/net/sctp/sm_make_chunk.c
index f487629..00598ee 100644
--- a/net/sctp/sm_make_chunk.c
+++ b/net/sctp/sm_make_chunk.c
@@ -2721,7 +2721,6 @@ static __be16 sctp_process_asconf_param(struct sctp_association *asoc,
struct sctp_transport *peer;
struct sctp_af *af;
union sctp_addr addr;
- struct list_head *pos;
union sctp_addr_param *addr_param;
addr_param = (union sctp_addr_param *)
@@ -2732,8 +2731,24 @@ static __be16 sctp_process_asconf_param(struct sctp_association *asoc,
return SCTP_ERROR_INV_PARAM;
af->from_addr_param(&addr, addr_param, htons(asoc->peer.port), 0);
+
+ /* ADDIP 4.2.1 This parameter MUST NOT contain a broadcast
+ * or multicast address.
+ * (note: wildcard is permitted and requires special handling so
+ * make sure we check for that)
+ */
+ if (!af->is_any(&addr) && !af->addr_valid(&addr, NULL, asconf->skb))
+ return SCTP_ERROR_INV_PARAM;
+
switch (asconf_param->param_hdr.type) {
case SCTP_PARAM_ADD_IP:
+ /* Section 4.2.1:
+ * If the address 0.0.0.0 or ::0 is provided, the source
+ * address of the packet MUST be added.
+ */
+ if (af->is_any(&addr))
+ memcpy(&addr, &asconf->source, sizeof(addr));
+
/* ADDIP 4.3 D9) If an endpoint receives an ADD IP address
* request and does not have the local resources to add this
* new address to the association, it MUST return an Error
@@ -2755,8 +2770,7 @@ static __be16 sctp_process_asconf_param(struct sctp_association *asoc,
* MUST send an Error Cause TLV with the error cause set to the
* new error code 'Request to Delete Last Remaining IP Address'.
*/
- pos = asoc->peer.transport_addr_list.next;
- if (pos->next == &asoc->peer.transport_addr_list)
+ if (asoc->peer.transport_count == 1)
return SCTP_ERROR_DEL_LAST_IP;
/* ADDIP 4.3 D8) If a request is received to delete an IP
@@ -2769,9 +2783,27 @@ static __be16 sctp_process_asconf_param(struct sctp_association *asoc,
if (sctp_cmp_addr_exact(sctp_source(asconf), &addr))
return SCTP_ERROR_DEL_SRC_IP;
- sctp_assoc_del_peer(asoc, &addr);
+ /* Section 4.2.2
+ * If the address 0.0.0.0 or ::0 is provided, all
+ * addresses of the peer except the source address of the
+ * packet MUST be deleted.
+ */
+ if (af->is_any(&addr)) {
+ sctp_assoc_set_primary(asoc, asconf->transport);
+ sctp_assoc_del_nonprimary_peers(asoc,
+ asconf->transport);
+ } else
+ sctp_assoc_del_peer(asoc, &addr);
break;
case SCTP_PARAM_SET_PRIMARY:
+ /* ADDIP Section 4.2.4
+ * If the address 0.0.0.0 or ::0 is provided, the receiver
+ * MAY mark the source address of the packet as its
+ * primary.
+ */
+ if (af->is_any(&addr))
+ memcpy(&addr.v4, sctp_source(asconf), sizeof(addr));
+
peer = sctp_assoc_lookup_paddr(asoc, &addr);
if (!peer)
return SCTP_ERROR_INV_PARAM;
--
1.5.3.5
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [PATCH 2.6.25 3/9] SCTP: Add the handling of "Set Primary IP Address" parameter to INIT
2007-12-17 21:32 [PATCH 2.6.25 0/9]: SCTP: Update ADD-IP implementation to conform to spec Vlad Yasevich
2007-12-17 21:32 ` [PATCH 2.6.25 1/9] SCTP: Discard unauthenticated ASCONF and ASCONF ACK chunks Vlad Yasevich
2007-12-17 21:32 ` [PATCH 2.6.25 2/9] SCTP: Handle the wildcard ADD-IP Address parameter Vlad Yasevich
@ 2007-12-17 21:32 ` Vlad Yasevich
2007-12-20 22:10 ` David Miller
2007-12-17 21:32 ` [PATCH 2.6.25 4/9] SCTP: Update association lookup to look at ASCONF chunks as well Vlad Yasevich
` (6 subsequent siblings)
9 siblings, 1 reply; 22+ messages in thread
From: Vlad Yasevich @ 2007-12-17 21:32 UTC (permalink / raw)
To: netdev; +Cc: lksctp-developers, Vlad Yasevich
The ADD-IP "Set Primary IP Address" parameter is allowed in the
INIT/INIT-ACK exchange. Allow processing of this parameter during
the INIT/INIT-ACK.
Signed-off-by: Vlad Yasevich <vladislav.yasevich@hp.com>
---
include/net/sctp/structs.h | 1 +
net/sctp/sm_make_chunk.c | 27 +++++++++++++++++++++++++++
2 files changed, 28 insertions(+), 0 deletions(-)
diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h
index 55acadc..fb9b7e7 100644
--- a/include/net/sctp/structs.h
+++ b/include/net/sctp/structs.h
@@ -451,6 +451,7 @@ union sctp_params {
struct sctp_random_param *random;
struct sctp_chunks_param *chunks;
struct sctp_hmac_algo_param *hmac_algo;
+ struct sctp_addip_param *addip;
};
/* RFC 2960. Section 3.3.5 Heartbeat.
diff --git a/net/sctp/sm_make_chunk.c b/net/sctp/sm_make_chunk.c
index 00598ee..62af33d 100644
--- a/net/sctp/sm_make_chunk.c
+++ b/net/sctp/sm_make_chunk.c
@@ -1963,6 +1963,11 @@ static sctp_ierror_t sctp_verify_param(const struct sctp_association *asoc,
case SCTP_PARAM_SUPPORTED_EXT:
break;
+ case SCTP_PARAM_SET_PRIMARY:
+ if (sctp_addip_enable)
+ break;
+ goto fallthrough;
+
case SCTP_PARAM_HOST_NAME_ADDRESS:
/* Tell the peer, we won't support this param. */
sctp_process_hn_param(asoc, param, chunk, err_chunk);
@@ -2280,6 +2285,8 @@ static int sctp_process_param(struct sctp_association *asoc,
sctp_scope_t scope;
time_t stale;
struct sctp_af *af;
+ union sctp_addr_param *addr_param;
+ struct sctp_transport *t;
/* We maintain all INIT parameters in network byte order all the
* time. This allows us to not worry about whether the parameters
@@ -2370,6 +2377,26 @@ static int sctp_process_param(struct sctp_association *asoc,
asoc->peer.adaptation_ind = param.aind->adaptation_ind;
break;
+ case SCTP_PARAM_SET_PRIMARY:
+ addr_param = param.v + sizeof(sctp_addip_param_t);
+
+ af = sctp_get_af_specific(param_type2af(param.p->type));
+ af->from_addr_param(&addr, addr_param,
+ htons(asoc->peer.port), 0);
+
+ /* if the address is invalid, we can't process it.
+ * XXX: see spec for what to do.
+ */
+ if (!af->addr_valid(&addr, NULL, NULL))
+ break;
+
+ t = sctp_assoc_lookup_paddr(asoc, &addr);
+ if (!t)
+ break;
+
+ sctp_assoc_set_primary(asoc, t);
+ break;
+
case SCTP_PARAM_SUPPORTED_EXT:
sctp_process_ext_param(asoc, param);
break;
--
1.5.3.5
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [PATCH 2.6.25 4/9] SCTP: Update association lookup to look at ASCONF chunks as well
2007-12-17 21:32 [PATCH 2.6.25 0/9]: SCTP: Update ADD-IP implementation to conform to spec Vlad Yasevich
` (2 preceding siblings ...)
2007-12-17 21:32 ` [PATCH 2.6.25 3/9] SCTP: Add the handling of "Set Primary IP Address" parameter to INIT Vlad Yasevich
@ 2007-12-17 21:32 ` Vlad Yasevich
2007-12-20 22:10 ` David Miller
2007-12-17 21:32 ` [PATCH 2.6.25 5/9] SCTP: ADD-IP updates the states where ASCONFs can be sent Vlad Yasevich
` (5 subsequent siblings)
9 siblings, 1 reply; 22+ messages in thread
From: Vlad Yasevich @ 2007-12-17 21:32 UTC (permalink / raw)
To: netdev; +Cc: lksctp-developers, Vlad Yasevich
ADD-IP draft section 5.2 specifies that if an association can not
be found using the source and destination of the IP packet,
then, if the packet contains ASCONF chunks, the Address Parameter
TLV should be used to lookup an association.
Signed-off-by: Vlad Yasevich <vladislav.yasevich@hp.com>
---
net/sctp/input.c | 124 ++++++++++++++++++++++++++++++++++++++++++++---------
1 files changed, 103 insertions(+), 21 deletions(-)
diff --git a/net/sctp/input.c b/net/sctp/input.c
index b08c7cb..d695f71 100644
--- a/net/sctp/input.c
+++ b/net/sctp/input.c
@@ -891,14 +891,6 @@ static struct sctp_association *__sctp_rcv_init_lookup(struct sk_buff *skb,
ch = (sctp_chunkhdr_t *) skb->data;
- /* The code below will attempt to walk the chunk and extract
- * parameter information. Before we do that, we need to verify
- * that the chunk length doesn't cause overflow. Otherwise, we'll
- * walk off the end.
- */
- if (WORD_ROUND(ntohs(ch->length)) > skb->len)
- return NULL;
-
/*
* This code will NOT touch anything inside the chunk--it is
* strictly READ-ONLY.
@@ -935,6 +927,44 @@ static struct sctp_association *__sctp_rcv_init_lookup(struct sk_buff *skb,
return NULL;
}
+/* ADD-IP, Section 5.2
+ * When an endpoint receives an ASCONF Chunk from the remote peer
+ * special procedures may be needed to identify the association the
+ * ASCONF Chunk is associated with. To properly find the association
+ * the following procedures SHOULD be followed:
+ *
+ * D2) If the association is not found, use the address found in the
+ * Address Parameter TLV combined with the port number found in the
+ * SCTP common header. If found proceed to rule D4.
+ *
+ * D2-ext) If more than one ASCONF Chunks are packed together, use the
+ * address found in the ASCONF Address Parameter TLV of each of the
+ * subsequent ASCONF Chunks. If found, proceed to rule D4.
+ */
+static struct sctp_association *__sctp_rcv_asconf_lookup(
+ sctp_chunkhdr_t *ch,
+ const union sctp_addr *laddr,
+ __be32 peer_port,
+ struct sctp_transport **transportp)
+{
+ sctp_addip_chunk_t *asconf = (struct sctp_addip_chunk *)ch;
+ struct sctp_af *af;
+ union sctp_addr_param *param;
+ union sctp_addr paddr;
+
+ /* Skip over the ADDIP header and find the Address parameter */
+ param = (union sctp_addr_param *)(asconf + 1);
+
+ af = sctp_get_af_specific(param_type2af(param->v4.param_hdr.type));
+ if (unlikely(!af))
+ return NULL;
+
+ af->from_addr_param(&paddr, param, peer_port, 0);
+
+ return __sctp_lookup_association(laddr, &paddr, transportp);
+}
+
+
/* SCTP-AUTH, Section 6.3:
* If the receiver does not find a STCB for a packet containing an AUTH
* chunk as the first chunk and not a COOKIE-ECHO chunk as the second
@@ -943,20 +973,64 @@ static struct sctp_association *__sctp_rcv_init_lookup(struct sk_buff *skb,
*
* This means that any chunks that can help us identify the association need
* to be looked at to find this assocation.
-*
-* TODO: The only chunk currently defined that can do that is ASCONF, but we
-* don't support that functionality yet.
*/
-static struct sctp_association *__sctp_rcv_auth_lookup(struct sk_buff *skb,
- const union sctp_addr *paddr,
+static struct sctp_association *__sctp_rcv_walk_lookup(struct sk_buff *skb,
const union sctp_addr *laddr,
struct sctp_transport **transportp)
{
- /* XXX - walk through the chunks looking for something that can
- * help us find the association. INIT, and INIT-ACK are not permitted.
- * That leaves ASCONF, but we don't support that yet.
+ struct sctp_association *asoc = NULL;
+ sctp_chunkhdr_t *ch;
+ int have_auth = 0;
+ unsigned int chunk_num = 1;
+ __u8 *ch_end;
+
+ /* Walk through the chunks looking for AUTH or ASCONF chunks
+ * to help us find the association.
*/
- return NULL;
+ ch = (sctp_chunkhdr_t *) skb->data;
+ do {
+ /* Break out if chunk length is less then minimal. */
+ if (ntohs(ch->length) < sizeof(sctp_chunkhdr_t))
+ break;
+
+ ch_end = ((__u8 *)ch) + WORD_ROUND(ntohs(ch->length));
+ if (ch_end > skb_tail_pointer(skb))
+ break;
+
+ switch(ch->type) {
+ case SCTP_CID_AUTH:
+ have_auth = chunk_num;
+ break;
+
+ case SCTP_CID_COOKIE_ECHO:
+ /* If a packet arrives containing an AUTH chunk as
+ * a first chunk, a COOKIE-ECHO chunk as the second
+ * chunk, and possibly more chunks after them, and
+ * the receiver does not have an STCB for that
+ * packet, then authentication is based on
+ * the contents of the COOKIE- ECHO chunk.
+ */
+ if (have_auth == 1 && chunk_num == 2)
+ return NULL;
+ break;
+
+ case SCTP_CID_ASCONF:
+ if (have_auth || sctp_addip_noauth)
+ asoc = __sctp_rcv_asconf_lookup(ch, laddr,
+ sctp_hdr(skb)->source,
+ transportp);
+ default:
+ break;
+ }
+
+ if (asoc)
+ break;
+
+ ch = (sctp_chunkhdr_t *) ch_end;
+ chunk_num++;
+ } while (ch_end < skb_tail_pointer(skb));
+
+ return asoc;
}
/*
@@ -966,7 +1040,6 @@ static struct sctp_association *__sctp_rcv_auth_lookup(struct sk_buff *skb,
* chunks.
*/
static struct sctp_association *__sctp_rcv_lookup_harder(struct sk_buff *skb,
- const union sctp_addr *paddr,
const union sctp_addr *laddr,
struct sctp_transport **transportp)
{
@@ -974,6 +1047,14 @@ static struct sctp_association *__sctp_rcv_lookup_harder(struct sk_buff *skb,
ch = (sctp_chunkhdr_t *) skb->data;
+ /* The code below will attempt to walk the chunk and extract
+ * parameter information. Before we do that, we need to verify
+ * that the chunk length doesn't cause overflow. Otherwise, we'll
+ * walk off the end.
+ */
+ if (WORD_ROUND(ntohs(ch->length)) > skb->len)
+ return NULL;
+
/* If this is INIT/INIT-ACK look inside the chunk too. */
switch (ch->type) {
case SCTP_CID_INIT:
@@ -981,11 +1062,12 @@ static struct sctp_association *__sctp_rcv_lookup_harder(struct sk_buff *skb,
return __sctp_rcv_init_lookup(skb, laddr, transportp);
break;
- case SCTP_CID_AUTH:
- return __sctp_rcv_auth_lookup(skb, paddr, laddr, transportp);
+ default:
+ return __sctp_rcv_walk_lookup(skb, laddr, transportp);
break;
}
+
return NULL;
}
@@ -1004,7 +1086,7 @@ static struct sctp_association *__sctp_rcv_lookup(struct sk_buff *skb,
* parameters within the INIT or INIT-ACK.
*/
if (!asoc)
- asoc = __sctp_rcv_lookup_harder(skb, paddr, laddr, transportp);
+ asoc = __sctp_rcv_lookup_harder(skb, laddr, transportp);
return asoc;
}
--
1.5.3.5
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [PATCH 2.6.25 5/9] SCTP: ADD-IP updates the states where ASCONFs can be sent
2007-12-17 21:32 [PATCH 2.6.25 0/9]: SCTP: Update ADD-IP implementation to conform to spec Vlad Yasevich
` (3 preceding siblings ...)
2007-12-17 21:32 ` [PATCH 2.6.25 4/9] SCTP: Update association lookup to look at ASCONF chunks as well Vlad Yasevich
@ 2007-12-17 21:32 ` Vlad Yasevich
2007-12-20 22:11 ` David Miller
2007-12-17 21:32 ` [PATCH 2.6.25 6/9] SCTP: Update ASCONF processing to conform to spec Vlad Yasevich
` (4 subsequent siblings)
9 siblings, 1 reply; 22+ messages in thread
From: Vlad Yasevich @ 2007-12-17 21:32 UTC (permalink / raw)
To: netdev; +Cc: lksctp-developers, Vlad Yasevich
C4) Both ASCONF and ASCONF-ACK Chunks MUST NOT be sent in any SCTP
state except ESTABLISHED, SHUTDOWN-PENDING, SHUTDOWN-RECEIVED,
and SHUTDOWN-SENT.
Signed-off-by: Vlad Yasevich <vladislav.yasevich@hp.com>
---
net/sctp/sm_statetable.c | 18 +++++++++---------
1 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/net/sctp/sm_statetable.c b/net/sctp/sm_statetable.c
index a93a4bc..e6016e4 100644
--- a/net/sctp/sm_statetable.c
+++ b/net/sctp/sm_statetable.c
@@ -457,11 +457,11 @@ static const sctp_sm_table_entry_t chunk_event_table[SCTP_NUM_BASE_CHUNK_TYPES][
/* SCTP_STATE_ESTABLISHED */ \
TYPE_SCTP_FUNC(sctp_sf_do_asconf), \
/* SCTP_STATE_SHUTDOWN_PENDING */ \
- TYPE_SCTP_FUNC(sctp_sf_discard_chunk), \
+ TYPE_SCTP_FUNC(sctp_sf_do_asconf), \
/* SCTP_STATE_SHUTDOWN_SENT */ \
- TYPE_SCTP_FUNC(sctp_sf_discard_chunk), \
+ TYPE_SCTP_FUNC(sctp_sf_do_asconf), \
/* SCTP_STATE_SHUTDOWN_RECEIVED */ \
- TYPE_SCTP_FUNC(sctp_sf_discard_chunk), \
+ TYPE_SCTP_FUNC(sctp_sf_do_asconf), \
/* SCTP_STATE_SHUTDOWN_ACK_SENT */ \
TYPE_SCTP_FUNC(sctp_sf_discard_chunk), \
} /* TYPE_SCTP_ASCONF */
@@ -478,11 +478,11 @@ static const sctp_sm_table_entry_t chunk_event_table[SCTP_NUM_BASE_CHUNK_TYPES][
/* SCTP_STATE_ESTABLISHED */ \
TYPE_SCTP_FUNC(sctp_sf_do_asconf_ack), \
/* SCTP_STATE_SHUTDOWN_PENDING */ \
- TYPE_SCTP_FUNC(sctp_sf_discard_chunk), \
+ TYPE_SCTP_FUNC(sctp_sf_do_asconf_ack), \
/* SCTP_STATE_SHUTDOWN_SENT */ \
- TYPE_SCTP_FUNC(sctp_sf_discard_chunk), \
+ TYPE_SCTP_FUNC(sctp_sf_do_asconf_ack), \
/* SCTP_STATE_SHUTDOWN_RECEIVED */ \
- TYPE_SCTP_FUNC(sctp_sf_discard_chunk), \
+ TYPE_SCTP_FUNC(sctp_sf_do_asconf_ack), \
/* SCTP_STATE_SHUTDOWN_ACK_SENT */ \
TYPE_SCTP_FUNC(sctp_sf_discard_chunk), \
} /* TYPE_SCTP_ASCONF_ACK */
@@ -691,11 +691,11 @@ chunk_event_table_unknown[SCTP_STATE_NUM_STATES] = {
/* SCTP_STATE_ESTABLISHED */ \
TYPE_SCTP_FUNC(sctp_sf_do_prm_asconf), \
/* SCTP_STATE_SHUTDOWN_PENDING */ \
- TYPE_SCTP_FUNC(sctp_sf_error_shutdown), \
+ TYPE_SCTP_FUNC(sctp_sf_do_prm_asconf), \
/* SCTP_STATE_SHUTDOWN_SENT */ \
- TYPE_SCTP_FUNC(sctp_sf_error_shutdown), \
+ TYPE_SCTP_FUNC(sctp_sf_do_prm_asconf), \
/* SCTP_STATE_SHUTDOWN_RECEIVED */ \
- TYPE_SCTP_FUNC(sctp_sf_error_shutdown), \
+ TYPE_SCTP_FUNC(sctp_sf_do_prm_asconf), \
/* SCTP_STATE_SHUTDOWN_ACK_SENT */ \
TYPE_SCTP_FUNC(sctp_sf_error_shutdown), \
} /* TYPE_SCTP_PRIMITIVE_REQUESTHEARTBEAT */
--
1.5.3.5
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [PATCH 2.6.25 6/9] SCTP: Update ASCONF processing to conform to spec.
2007-12-17 21:32 [PATCH 2.6.25 0/9]: SCTP: Update ADD-IP implementation to conform to spec Vlad Yasevich
` (4 preceding siblings ...)
2007-12-17 21:32 ` [PATCH 2.6.25 5/9] SCTP: ADD-IP updates the states where ASCONFs can be sent Vlad Yasevich
@ 2007-12-17 21:32 ` Vlad Yasevich
2007-12-20 22:11 ` David Miller
2007-12-17 21:32 ` [PATCH 2.6.25 8/9] SCTP: Implement ADD-IP special case processing for ABORT chunk Vlad Yasevich
` (3 subsequent siblings)
9 siblings, 1 reply; 22+ messages in thread
From: Vlad Yasevich @ 2007-12-17 21:32 UTC (permalink / raw)
To: netdev; +Cc: lksctp-developers, Vlad Yasevich
The processing of the ASCONF chunks has changed a lot in the
spec. New items are:
1. A list of ASCONF-ACK chunks is now cached
2. The source of the packet is used in response.
3. New handling for unexpect ASCONF chunks.
Signed-off-by: Vlad Yasevich <vladislav.yasevich@hp.com>
---
include/net/sctp/structs.h | 24 +++++++++-------
net/sctp/associola.c | 58 ++++++++++++++++++++++++++++++++++++++-
net/sctp/outqueue.c | 29 ++++++++++++++++++-
net/sctp/sm_make_chunk.c | 12 +++-----
net/sctp/sm_statefuns.c | 64 ++++++++++++++++++++++++++++---------------
5 files changed, 143 insertions(+), 44 deletions(-)
diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h
index fb9b7e7..39e74d7 100644
--- a/include/net/sctp/structs.h
+++ b/include/net/sctp/structs.h
@@ -744,6 +744,7 @@ struct sctp_chunk {
__u8 tsn_missing_report; /* Data chunk missing counter. */
__u8 data_accepted; /* At least 1 chunk in this packet accepted */
__u8 auth; /* IN: was auth'ed | OUT: needs auth */
+ __u8 has_asconf; /* IN: have seen an asconf before */
};
void sctp_chunk_hold(struct sctp_chunk *);
@@ -1785,20 +1786,16 @@ struct sctp_association {
*/
struct sctp_chunk *addip_last_asconf;
- /* ADDIP Section 4.2 Upon reception of an ASCONF Chunk.
+ /* ADDIP Section 5.2 Upon reception of an ASCONF Chunk.
*
- * IMPLEMENTATION NOTE: As an optimization a receiver may wish
- * to save the last ASCONF-ACK for some predetermined period
- * of time and instead of re-processing the ASCONF (with the
- * same serial number) it may just re-transmit the
- * ASCONF-ACK. It may wish to use the arrival of a new serial
- * number to discard the previously saved ASCONF-ACK or any
- * other means it may choose to expire the saved ASCONF-ACK.
+ * This is needed to implement itmes E1 - E4 of the updated
+ * spec. Here is the justification:
*
- * [This is our saved ASCONF-ACK. We invalidate it when a new
- * ASCONF serial number arrives.]
+ * Since the peer may bundle multiple ASCONF chunks toward us,
+ * we now need the ability to cache multiple ACKs. The section
+ * describes in detail how they are cached and cleaned up.
*/
- struct sctp_chunk *addip_last_asconf_ack;
+ struct list_head asconf_ack_list;
/* These ASCONF chunks are waiting to be sent.
*
@@ -1947,6 +1944,11 @@ int sctp_assoc_set_bind_addr_from_cookie(struct sctp_association *,
struct sctp_cookie*,
gfp_t gfp);
int sctp_assoc_set_id(struct sctp_association *, gfp_t);
+void sctp_assoc_clean_asconf_ack_cache(const struct sctp_association *asoc);
+struct sctp_chunk *sctp_assoc_lookup_asconf_ack(
+ const struct sctp_association *asoc,
+ __be32 serial);
+
int sctp_cmp_addr_exact(const union sctp_addr *ss1,
const union sctp_addr *ss2);
diff --git a/net/sctp/associola.c b/net/sctp/associola.c
index 61bebb9..a016e78 100644
--- a/net/sctp/associola.c
+++ b/net/sctp/associola.c
@@ -61,6 +61,7 @@
/* Forward declarations for internal functions. */
static void sctp_assoc_bh_rcv(struct work_struct *work);
+static void sctp_assoc_free_asconf_acks(struct sctp_association *asoc);
/* 1st Level Abstractions. */
@@ -242,6 +243,7 @@ static struct sctp_association *sctp_association_init(struct sctp_association *a
asoc->addip_serial = asoc->c.initial_tsn;
INIT_LIST_HEAD(&asoc->addip_chunk_list);
+ INIT_LIST_HEAD(&asoc->asconf_ack_list);
/* Make an empty list of remote transport addresses. */
INIT_LIST_HEAD(&asoc->peer.transport_addr_list);
@@ -431,8 +433,7 @@ void sctp_association_free(struct sctp_association *asoc)
asoc->peer.transport_count = 0;
/* Free any cached ASCONF_ACK chunk. */
- if (asoc->addip_last_asconf_ack)
- sctp_chunk_free(asoc->addip_last_asconf_ack);
+ sctp_assoc_free_asconf_acks(asoc);
/* Free any cached ASCONF chunk. */
if (asoc->addip_last_asconf)
@@ -1485,3 +1486,56 @@ retry:
asoc->assoc_id = (sctp_assoc_t) assoc_id;
return error;
}
+
+/* Free asconf_ack cache */
+static void sctp_assoc_free_asconf_acks(struct sctp_association *asoc)
+{
+ struct sctp_chunk *ack;
+ struct sctp_chunk *tmp;
+
+ list_for_each_entry_safe(ack, tmp, &asoc->asconf_ack_list,
+ transmitted_list) {
+ list_del_init(&ack->transmitted_list);
+ sctp_chunk_free(ack);
+ }
+}
+
+/* Clean up the ASCONF_ACK queue */
+void sctp_assoc_clean_asconf_ack_cache(const struct sctp_association *asoc)
+{
+ struct sctp_chunk *ack;
+ struct sctp_chunk *tmp;
+
+ /* We can remove all the entries from the queue upto
+ * the "Peer-Sequence-Number".
+ */
+ list_for_each_entry_safe(ack, tmp, &asoc->asconf_ack_list,
+ transmitted_list) {
+ if (ack->subh.addip_hdr->serial ==
+ htonl(asoc->peer.addip_serial))
+ break;
+
+ list_del_init(&ack->transmitted_list);
+ sctp_chunk_free(ack);
+ }
+}
+
+/* Find the ASCONF_ACK whose serial number matches ASCONF */
+struct sctp_chunk *sctp_assoc_lookup_asconf_ack(
+ const struct sctp_association *asoc,
+ __be32 serial)
+{
+ struct sctp_chunk *ack = NULL;
+
+ /* Walk through the list of cached ASCONF-ACKs and find the
+ * ack chunk whose serial number matches that of the request.
+ */
+ list_for_each_entry(ack, &asoc->asconf_ack_list, transmitted_list) {
+ if (ack->subh.addip_hdr->serial == serial) {
+ sctp_chunk_hold(ack);
+ break;
+ }
+ }
+
+ return ack;
+}
diff --git a/net/sctp/outqueue.c b/net/sctp/outqueue.c
index fa76f23..a42af86 100644
--- a/net/sctp/outqueue.c
+++ b/net/sctp/outqueue.c
@@ -716,7 +716,29 @@ int sctp_outq_flush(struct sctp_outq *q, int rtx_timeout)
new_transport = chunk->transport;
if (!new_transport) {
- new_transport = asoc->peer.active_path;
+ /*
+ * If we have a prior transport pointer, see if
+ * the destination address of the chunk
+ * matches the destination address of the
+ * current transport. If not a match, then
+ * try to look up the transport with a given
+ * destination address. We do this because
+ * after processing ASCONFs, we may have new
+ * transports created.
+ */
+ if (transport &&
+ sctp_cmp_addr_exact(&chunk->dest,
+ &transport->ipaddr))
+ new_transport = transport;
+ else
+ new_transport = sctp_assoc_lookup_paddr(asoc,
+ &chunk->dest);
+
+ /* if we still don't have a new transport, then
+ * use the current active path.
+ */
+ if (!new_transport)
+ new_transport = asoc->peer.active_path;
} else if ((new_transport->state == SCTP_INACTIVE) ||
(new_transport->state == SCTP_UNCONFIRMED)) {
/* If the chunk is Heartbeat or Heartbeat Ack,
@@ -729,9 +751,12 @@ int sctp_outq_flush(struct sctp_outq *q, int rtx_timeout)
* address of the IP datagram containing the
* HEARTBEAT chunk to which this ack is responding.
* ...
+ *
+ * ASCONF_ACKs also must be sent to the source.
*/
if (chunk->chunk_hdr->type != SCTP_CID_HEARTBEAT &&
- chunk->chunk_hdr->type != SCTP_CID_HEARTBEAT_ACK)
+ chunk->chunk_hdr->type != SCTP_CID_HEARTBEAT_ACK &&
+ chunk->chunk_hdr->type != SCTP_CID_ASCONF_ACK)
new_transport = asoc->peer.active_path;
}
diff --git a/net/sctp/sm_make_chunk.c b/net/sctp/sm_make_chunk.c
index 62af33d..257236c 100644
--- a/net/sctp/sm_make_chunk.c
+++ b/net/sctp/sm_make_chunk.c
@@ -1269,6 +1269,9 @@ nodata:
/* Release the memory occupied by a chunk. */
static void sctp_chunk_destroy(struct sctp_chunk *chunk)
{
+ BUG_ON(!list_empty(&chunk->list));
+ list_del_init(&chunk->transmitted_list);
+
/* Free the chunk skb data and the SCTP_chunk stub itself. */
dev_kfree_skb(chunk->skb);
@@ -1279,9 +1282,6 @@ static void sctp_chunk_destroy(struct sctp_chunk *chunk)
/* Possibly, free the chunk. */
void sctp_chunk_free(struct sctp_chunk *chunk)
{
- BUG_ON(!list_empty(&chunk->list));
- list_del_init(&chunk->transmitted_list);
-
/* Release our reference on the message tracker. */
if (chunk->msg)
sctp_datamsg_put(chunk->msg);
@@ -2974,11 +2974,9 @@ done:
* after freeing the reference to old asconf ack if any.
*/
if (asconf_ack) {
- if (asoc->addip_last_asconf_ack)
- sctp_chunk_free(asoc->addip_last_asconf_ack);
-
sctp_chunk_hold(asconf_ack);
- asoc->addip_last_asconf_ack = asconf_ack;
+ list_add_tail(&asconf_ack->transmitted_list,
+ &asoc->asconf_ack_list);
}
return asconf_ack;
diff --git a/net/sctp/sm_statefuns.c b/net/sctp/sm_statefuns.c
index 859be75..8fe2e61 100644
--- a/net/sctp/sm_statefuns.c
+++ b/net/sctp/sm_statefuns.c
@@ -3424,48 +3424,68 @@ sctp_disposition_t sctp_sf_do_asconf(const struct sctp_endpoint *ep,
/* Verify the ASCONF chunk before processing it. */
if (!sctp_verify_asconf(asoc,
- (sctp_paramhdr_t *)((void *)addr_param + length),
- (void *)chunk->chunk_end,
- &err_param))
+ (sctp_paramhdr_t *)((void *)addr_param + length),
+ (void *)chunk->chunk_end,
+ &err_param))
return sctp_sf_violation_paramlen(ep, asoc, type,
- (void *)&err_param, commands);
+ (void *)&err_param, commands);
- /* ADDIP 4.2 C1) Compare the value of the serial number to the value
+ /* ADDIP 5.2 E1) Compare the value of the serial number to the value
* the endpoint stored in a new association variable
* 'Peer-Serial-Number'.
*/
if (serial == asoc->peer.addip_serial + 1) {
- /* ADDIP 4.2 C2) If the value found in the serial number is
- * equal to the ('Peer-Serial-Number' + 1), the endpoint MUST
- * do V1-V5.
+ /* If this is the first instance of ASCONF in the packet,
+ * we can clean our old ASCONF-ACKs.
+ */
+ if (!chunk->has_asconf)
+ sctp_assoc_clean_asconf_ack_cache(asoc);
+
+ /* ADDIP 5.2 E4) When the Sequence Number matches the next one
+ * expected, process the ASCONF as described below and after
+ * processing the ASCONF Chunk, append an ASCONF-ACK Chunk to
+ * the response packet and cache a copy of it (in the event it
+ * later needs to be retransmitted).
+ *
+ * Essentially, do V1-V5.
*/
asconf_ack = sctp_process_asconf((struct sctp_association *)
asoc, chunk);
if (!asconf_ack)
return SCTP_DISPOSITION_NOMEM;
- } else if (serial == asoc->peer.addip_serial) {
- /* ADDIP 4.2 C3) If the value found in the serial number is
- * equal to the value stored in the 'Peer-Serial-Number'
- * IMPLEMENTATION NOTE: As an optimization a receiver may wish
- * to save the last ASCONF-ACK for some predetermined period of
- * time and instead of re-processing the ASCONF (with the same
- * serial number) it may just re-transmit the ASCONF-ACK.
+ } else if (serial < asoc->peer.addip_serial + 1) {
+ /* ADDIP 5.2 E2)
+ * If the value found in the Sequence Number is less than the
+ * ('Peer- Sequence-Number' + 1), simply skip to the next
+ * ASCONF, and include in the outbound response packet
+ * any previously cached ASCONF-ACK response that was
+ * sent and saved that matches the Sequence Number of the
+ * ASCONF. Note: It is possible that no cached ASCONF-ACK
+ * Chunk exists. This will occur when an older ASCONF
+ * arrives out of order. In such a case, the receiver
+ * should skip the ASCONF Chunk and not include ASCONF-ACK
+ * Chunk for that chunk.
*/
- if (asoc->addip_last_asconf_ack)
- asconf_ack = asoc->addip_last_asconf_ack;
- else
+ asconf_ack = sctp_assoc_lookup_asconf_ack(asoc, hdr->serial);
+ if (!asconf_ack)
return SCTP_DISPOSITION_DISCARD;
} else {
- /* ADDIP 4.2 C4) Otherwise, the ASCONF Chunk is discarded since
+ /* ADDIP 5.2 E5) Otherwise, the ASCONF Chunk is discarded since
* it must be either a stale packet or from an attacker.
*/
return SCTP_DISPOSITION_DISCARD;
}
- /* ADDIP 4.2 C5) In both cases C2 and C3 the ASCONF-ACK MUST be sent
- * back to the source address contained in the IP header of the ASCONF
- * being responded to.
+ /* ADDIP 5.2 E6) The destination address of the SCTP packet
+ * containing the ASCONF-ACK Chunks MUST be the source address of
+ * the SCTP packet that held the ASCONF Chunks.
+ *
+ * To do this properly, we'll set the destination address of the chunk
+ * and at the transmit time, will try look up the transport to use.
+ * Since ASCONFs may be bundled, the correct transport may not be
+ * created untill we process the entire packet, thus this workaround.
*/
+ asconf_ack->dest = chunk->source;
sctp_add_cmd_sf(commands, SCTP_CMD_REPLY, SCTP_CHUNK(asconf_ack));
return SCTP_DISPOSITION_CONSUME;
--
1.5.3.5
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [PATCH 2.6.25 8/9] SCTP: Implement ADD-IP special case processing for ABORT chunk
2007-12-17 21:32 [PATCH 2.6.25 0/9]: SCTP: Update ADD-IP implementation to conform to spec Vlad Yasevich
` (5 preceding siblings ...)
2007-12-17 21:32 ` [PATCH 2.6.25 6/9] SCTP: Update ASCONF processing to conform to spec Vlad Yasevich
@ 2007-12-17 21:32 ` Vlad Yasevich
2007-12-20 22:13 ` David Miller
2007-12-17 21:32 ` [PATCH 2.6.25 9/9] SCTP: Follow Add-IP security consideratiosn wrt INIT/INIT-ACK Vlad Yasevich
` (2 subsequent siblings)
9 siblings, 1 reply; 22+ messages in thread
From: Vlad Yasevich @ 2007-12-17 21:32 UTC (permalink / raw)
To: netdev; +Cc: lksctp-developers, Vlad Yasevich
ADD-IP spec has a special case for processing ABORTs:
F4) ... One special consideration is that ABORT
Chunks arriving destined to the IP address being deleted MUST be
ignored (see Section 5.3.1 for further details).
Check if the address we received on is in the DEL state, and if
so, ignore the ABORT.
Signed-off-by: Vlad Yasevich <vladislav.yasevich@hp.com>
---
include/net/sctp/structs.h | 2 +
net/sctp/bind_addr.c | 26 ++++++++++++++++++++++
net/sctp/sm_statefuns.c | 52 ++++++++++++++++++++++++++++++++++++++++---
3 files changed, 76 insertions(+), 4 deletions(-)
diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h
index 32e6591..27e9cf5 100644
--- a/include/net/sctp/structs.h
+++ b/include/net/sctp/structs.h
@@ -1200,6 +1200,8 @@ int sctp_add_bind_addr(struct sctp_bind_addr *, union sctp_addr *,
int sctp_del_bind_addr(struct sctp_bind_addr *, union sctp_addr *);
int sctp_bind_addr_match(struct sctp_bind_addr *, const union sctp_addr *,
struct sctp_sock *);
+int sctp_bind_addr_state(const struct sctp_bind_addr *bp,
+ const union sctp_addr *addr);
union sctp_addr *sctp_find_unmatch_addr(struct sctp_bind_addr *bp,
const union sctp_addr *addrs,
int addrcnt,
diff --git a/net/sctp/bind_addr.c b/net/sctp/bind_addr.c
index 4326611..13fbfb4 100644
--- a/net/sctp/bind_addr.c
+++ b/net/sctp/bind_addr.c
@@ -353,6 +353,32 @@ int sctp_bind_addr_match(struct sctp_bind_addr *bp,
return match;
}
+/* Get the state of the entry in the bind_addr_list */
+int sctp_bind_addr_state(const struct sctp_bind_addr *bp,
+ const union sctp_addr *addr)
+{
+ struct sctp_sockaddr_entry *laddr;
+ struct sctp_af *af;
+ int state = -1;
+
+ af = sctp_get_af_specific(addr->sa.sa_family);
+ if (unlikely(!af))
+ return state;
+
+ rcu_read_lock();
+ list_for_each_entry_rcu(laddr, &bp->address_list, list) {
+ if (!laddr->valid)
+ continue;
+ if (af->cmp_addr(&laddr->a, addr)) {
+ state = laddr->state;
+ break;
+ }
+ }
+ rcu_read_unlock();
+
+ return state;
+}
+
/* Find the first address in the bind address list that is not present in
* the addrs packed array.
*/
diff --git a/net/sctp/sm_statefuns.c b/net/sctp/sm_statefuns.c
index 8fe2e61..eed47c6 100644
--- a/net/sctp/sm_statefuns.c
+++ b/net/sctp/sm_statefuns.c
@@ -143,6 +143,12 @@ static sctp_ierror_t sctp_sf_authenticate(const struct sctp_endpoint *ep,
const sctp_subtype_t type,
struct sctp_chunk *chunk);
+static sctp_disposition_t __sctp_sf_do_9_1_abort(const struct sctp_endpoint *ep,
+ const struct sctp_association *asoc,
+ const sctp_subtype_t type,
+ void *arg,
+ sctp_cmd_seq_t *commands);
+
/* Small helper function that checks if the chunk length
* is of the appropriate length. The 'required_length' argument
* is set to be the size of a specific chunk we are testing.
@@ -2095,11 +2101,20 @@ sctp_disposition_t sctp_sf_shutdown_pending_abort(
if (!sctp_chunk_length_valid(chunk, sizeof(sctp_abort_chunk_t)))
return sctp_sf_pdiscard(ep, asoc, type, arg, commands);
+ /* ADD-IP: Special case for ABORT chunks
+ * F4) One special consideration is that ABORT Chunks arriving
+ * destined to the IP address being deleted MUST be
+ * ignored (see Section 5.3.1 for further details).
+ */
+ if (SCTP_ADDR_DEL ==
+ sctp_bind_addr_state(&asoc->base.bind_addr, &chunk->dest))
+ return sctp_sf_discard_chunk(ep, asoc, type, arg, commands);
+
/* Stop the T5-shutdown guard timer. */
sctp_add_cmd_sf(commands, SCTP_CMD_TIMER_STOP,
SCTP_TO(SCTP_EVENT_TIMEOUT_T5_SHUTDOWN_GUARD));
- return sctp_sf_do_9_1_abort(ep, asoc, type, arg, commands);
+ return __sctp_sf_do_9_1_abort(ep, asoc, type, arg, commands);
}
/*
@@ -2131,6 +2146,15 @@ sctp_disposition_t sctp_sf_shutdown_sent_abort(const struct sctp_endpoint *ep,
if (!sctp_chunk_length_valid(chunk, sizeof(sctp_abort_chunk_t)))
return sctp_sf_pdiscard(ep, asoc, type, arg, commands);
+ /* ADD-IP: Special case for ABORT chunks
+ * F4) One special consideration is that ABORT Chunks arriving
+ * destined to the IP address being deleted MUST be
+ * ignored (see Section 5.3.1 for further details).
+ */
+ if (SCTP_ADDR_DEL ==
+ sctp_bind_addr_state(&asoc->base.bind_addr, &chunk->dest))
+ return sctp_sf_discard_chunk(ep, asoc, type, arg, commands);
+
/* Stop the T2-shutdown timer. */
sctp_add_cmd_sf(commands, SCTP_CMD_TIMER_STOP,
SCTP_TO(SCTP_EVENT_TIMEOUT_T2_SHUTDOWN));
@@ -2139,7 +2163,7 @@ sctp_disposition_t sctp_sf_shutdown_sent_abort(const struct sctp_endpoint *ep,
sctp_add_cmd_sf(commands, SCTP_CMD_TIMER_STOP,
SCTP_TO(SCTP_EVENT_TIMEOUT_T5_SHUTDOWN_GUARD));
- return sctp_sf_do_9_1_abort(ep, asoc, type, arg, commands);
+ return __sctp_sf_do_9_1_abort(ep, asoc, type, arg, commands);
}
/*
@@ -2366,8 +2390,6 @@ sctp_disposition_t sctp_sf_do_9_1_abort(const struct sctp_endpoint *ep,
sctp_cmd_seq_t *commands)
{
struct sctp_chunk *chunk = arg;
- unsigned len;
- __be16 error = SCTP_ERROR_NO_ERROR;
if (!sctp_vtag_verify_either(chunk, asoc))
return sctp_sf_pdiscard(ep, asoc, type, arg, commands);
@@ -2385,6 +2407,28 @@ sctp_disposition_t sctp_sf_do_9_1_abort(const struct sctp_endpoint *ep,
if (!sctp_chunk_length_valid(chunk, sizeof(sctp_abort_chunk_t)))
return sctp_sf_pdiscard(ep, asoc, type, arg, commands);
+ /* ADD-IP: Special case for ABORT chunks
+ * F4) One special consideration is that ABORT Chunks arriving
+ * destined to the IP address being deleted MUST be
+ * ignored (see Section 5.3.1 for further details).
+ */
+ if (SCTP_ADDR_DEL ==
+ sctp_bind_addr_state(&asoc->base.bind_addr, &chunk->dest))
+ return sctp_sf_discard_chunk(ep, asoc, type, arg, commands);
+
+ return __sctp_sf_do_9_1_abort(ep, asoc, type, arg, commands);
+}
+
+static sctp_disposition_t __sctp_sf_do_9_1_abort(const struct sctp_endpoint *ep,
+ const struct sctp_association *asoc,
+ const sctp_subtype_t type,
+ void *arg,
+ sctp_cmd_seq_t *commands)
+{
+ struct sctp_chunk *chunk = arg;
+ unsigned len;
+ __be16 error = SCTP_ERROR_NO_ERROR;
+
/* See if we have an error cause code in the chunk. */
len = ntohs(chunk->chunk_hdr->length);
if (len >= sizeof(struct sctp_chunkhdr) + sizeof(struct sctp_errhdr))
--
1.5.3.5
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [PATCH 2.6.25 9/9] SCTP: Follow Add-IP security consideratiosn wrt INIT/INIT-ACK
2007-12-17 21:32 [PATCH 2.6.25 0/9]: SCTP: Update ADD-IP implementation to conform to spec Vlad Yasevich
` (6 preceding siblings ...)
2007-12-17 21:32 ` [PATCH 2.6.25 8/9] SCTP: Implement ADD-IP special case processing for ABORT chunk Vlad Yasevich
@ 2007-12-17 21:32 ` Vlad Yasevich
2007-12-20 22:13 ` David Miller
2007-12-17 22:36 ` [PATCH 2.6.25 0/9]: SCTP: Update ADD-IP implementation to conform to spec David Miller
2007-12-19 20:53 ` Vlad Yasevich
9 siblings, 1 reply; 22+ messages in thread
From: Vlad Yasevich @ 2007-12-17 21:32 UTC (permalink / raw)
To: netdev; +Cc: lksctp-developers, Vlad Yasevich
The Security Considerations section of RFC 5061 has the following
text:
If an SCTP endpoint that supports this extension receives an INIT
that indicates that the peer supports the ASCONF extension but does
NOT support the [RFC4895] extension, the receiver of such an INIT
MUST send an ABORT in response. Note that an implementation is
allowed to silently discard such an INIT as an option as well, but
under NO circumstance is an implementation allowed to proceed with
the association setup by sending an INIT-ACK in response.
An implementation that receives an INIT-ACK that indicates that the
peer does not support the [RFC4895] extension MUST NOT send the
COOKIE-ECHO to establish the association. Instead, the
implementation MUST discard the INIT-ACK and report to the upper-
layer user that an association cannot be established destroying the
Transmission Control Block (TCB).
Follow the recomendations.
Signed-off-by: Vlad Yasevich <vladislav.yasevich@hp.com>
---
net/sctp/sm_make_chunk.c | 47 ++++++++++++++++++++++++++++++++++++++++++---
net/sctp/sm_statefuns.c | 7 ++---
2 files changed, 46 insertions(+), 8 deletions(-)
diff --git a/net/sctp/sm_make_chunk.c b/net/sctp/sm_make_chunk.c
index 68a994c..ae9fc9e 100644
--- a/net/sctp/sm_make_chunk.c
+++ b/net/sctp/sm_make_chunk.c
@@ -1830,6 +1830,39 @@ static int sctp_process_hn_param(const struct sctp_association *asoc,
return 0;
}
+static int sctp_verify_ext_param(union sctp_params param)
+{
+ __u16 num_ext = ntohs(param.p->length) - sizeof(sctp_paramhdr_t);
+ int have_auth = 0;
+ int have_asconf = 0;
+ int i;
+
+ for (i = 0; i < num_ext; i++) {
+ switch (param.ext->chunks[i]) {
+ case SCTP_CID_AUTH:
+ have_auth = 1;
+ break;
+ case SCTP_CID_ASCONF:
+ case SCTP_CID_ASCONF_ACK:
+ have_asconf = 1;
+ break;
+ }
+ }
+
+ /* ADD-IP Security: The draft requires us to ABORT or ignore the
+ * INIT/INIT-ACK if ADD-IP is listed, but AUTH is not. Do this
+ * only if ADD-IP is turned on and we are not backward-compatible
+ * mode.
+ */
+ if (sctp_addip_noauth)
+ return 1;
+
+ if (sctp_addip_enable && !have_auth && have_asconf)
+ return 0;
+
+ return 1;
+}
+
static void sctp_process_ext_param(struct sctp_association *asoc,
union sctp_params param)
{
@@ -1960,7 +1993,11 @@ static sctp_ierror_t sctp_verify_param(const struct sctp_association *asoc,
case SCTP_PARAM_UNRECOGNIZED_PARAMETERS:
case SCTP_PARAM_ECN_CAPABLE:
case SCTP_PARAM_ADAPTATION_LAYER_IND:
+ break;
+
case SCTP_PARAM_SUPPORTED_EXT:
+ if (!sctp_verify_ext_param(param))
+ return SCTP_IERROR_ABORT;
break;
case SCTP_PARAM_SET_PRIMARY:
@@ -2133,10 +2170,11 @@ int sctp_process_init(struct sctp_association *asoc, sctp_cid_t cid,
!asoc->peer.peer_hmacs))
asoc->peer.auth_capable = 0;
-
- /* If the peer claims support for ADD-IP without support
- * for AUTH, disable support for ADD-IP.
- * Do this only if backward compatible mode is turned off.
+ /* In a non-backward compatible mode, if the peer claims
+ * support for ADD-IP but not AUTH, the ADD-IP spec states
+ * that we MUST ABORT the association. Section 6. The section
+ * also give us an option to silently ignore the packet, which
+ * is what we'll do here.
*/
if (!sctp_addip_noauth &&
(asoc->peer.asconf_capable && !asoc->peer.auth_capable)) {
@@ -2144,6 +2182,7 @@ int sctp_process_init(struct sctp_association *asoc, sctp_cid_t cid,
SCTP_PARAM_DEL_IP |
SCTP_PARAM_SET_PRIMARY);
asoc->peer.asconf_capable = 0;
+ goto clean_up;
}
/* Walk list of transports, removing transports in the UNKNOWN state. */
diff --git a/net/sctp/sm_statefuns.c b/net/sctp/sm_statefuns.c
index eed47c6..aadbed1 100644
--- a/net/sctp/sm_statefuns.c
+++ b/net/sctp/sm_statefuns.c
@@ -507,7 +507,9 @@ sctp_disposition_t sctp_sf_do_5_1C_ack(const struct sctp_endpoint *ep,
&err_chunk)) {
/* This chunk contains fatal error. It is to be discarded.
- * Send an ABORT, with causes if there is any.
+ * Send an ABORT, with causes. If there are no causes,
+ * then there wasn't enough memory. Just terminate
+ * the association.
*/
if (err_chunk) {
packet = sctp_abort_pkt_new(ep, asoc, arg,
@@ -526,9 +528,6 @@ sctp_disposition_t sctp_sf_do_5_1C_ack(const struct sctp_endpoint *ep,
} else {
error = SCTP_ERROR_NO_RESOURCE;
}
- } else {
- sctp_sf_tabort_8_4_8(ep, asoc, type, arg, commands);
- error = SCTP_ERROR_INV_PARAM;
}
/* SCTP-AUTH, Section 6.3:
--
1.5.3.5
^ permalink raw reply related [flat|nested] 22+ messages in thread
* Re: [PATCH 2.6.25 0/9]: SCTP: Update ADD-IP implementation to conform to spec
2007-12-17 21:32 [PATCH 2.6.25 0/9]: SCTP: Update ADD-IP implementation to conform to spec Vlad Yasevich
` (7 preceding siblings ...)
2007-12-17 21:32 ` [PATCH 2.6.25 9/9] SCTP: Follow Add-IP security consideratiosn wrt INIT/INIT-ACK Vlad Yasevich
@ 2007-12-17 22:36 ` David Miller
2007-12-17 22:40 ` Vlad Yasevich
2007-12-19 20:53 ` Vlad Yasevich
9 siblings, 1 reply; 22+ messages in thread
From: David Miller @ 2007-12-17 22:36 UTC (permalink / raw)
To: vladislav.yasevich; +Cc: netdev, lksctp-developers
From: Vlad Yasevich <vladislav.yasevich@hp.com>
Date: Mon, 17 Dec 2007 16:32:40 -0500
> The following is a set of patches that updates the SCTP ADD-IP
> implementation to conform to the recently published RFC.
Patch 7 didn't seem to make it.
If you CC: on submissions like this, in the worst case at
least I'll get a copy even if the mailing list blocks it
for whatever reason (size, SPAM filter, etc.)
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH 2.6.25 0/9]: SCTP: Update ADD-IP implementation to conform to spec
2007-12-17 22:36 ` [PATCH 2.6.25 0/9]: SCTP: Update ADD-IP implementation to conform to spec David Miller
@ 2007-12-17 22:40 ` Vlad Yasevich
2007-12-17 22:43 ` David Miller
0 siblings, 1 reply; 22+ messages in thread
From: Vlad Yasevich @ 2007-12-17 22:40 UTC (permalink / raw)
To: David Miller; +Cc: netdev, lksctp-developers
David Miller wrote:
> From: Vlad Yasevich <vladislav.yasevich@hp.com>
> Date: Mon, 17 Dec 2007 16:32:40 -0500
>
>> The following is a set of patches that updates the SCTP ADD-IP
>> implementation to conform to the recently published RFC.
>
> Patch 7 didn't seem to make it.
>
> If you CC: on submissions like this, in the worst case at
> least I'll get a copy even if the mailing list blocks it
> for whatever reason (size, SPAM filter, etc.)
Hm... only missing from netdev.. :)
Do you want me to send just patch 7, or resend the whole series?
-vlad
> --
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH 2.6.25 0/9]: SCTP: Update ADD-IP implementation to conform to spec
2007-12-17 22:40 ` Vlad Yasevich
@ 2007-12-17 22:43 ` David Miller
0 siblings, 0 replies; 22+ messages in thread
From: David Miller @ 2007-12-17 22:43 UTC (permalink / raw)
To: vladislav.yasevich; +Cc: netdev, lksctp-developers
From: Vlad Yasevich <vladislav.yasevich@hp.com>
Date: Mon, 17 Dec 2007 17:40:25 -0500
> David Miller wrote:
> > From: Vlad Yasevich <vladislav.yasevich@hp.com>
> > Date: Mon, 17 Dec 2007 16:32:40 -0500
> >
> >> The following is a set of patches that updates the SCTP ADD-IP
> >> implementation to conform to the recently published RFC.
> >
> > Patch 7 didn't seem to make it.
> >
> > If you CC: on submissions like this, in the worst case at
> > least I'll get a copy even if the mailing list blocks it
> > for whatever reason (size, SPAM filter, etc.)
>
> Hm... only missing from netdev.. :)
>
> Do you want me to send just patch 7, or resend the whole series?
I'd like to see patch 7 so please send it.
Is it particularly big?
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH 2.6.25 0/9]: SCTP: Update ADD-IP implementation to conform to spec
2007-12-17 21:32 [PATCH 2.6.25 0/9]: SCTP: Update ADD-IP implementation to conform to spec Vlad Yasevich
` (8 preceding siblings ...)
2007-12-17 22:36 ` [PATCH 2.6.25 0/9]: SCTP: Update ADD-IP implementation to conform to spec David Miller
@ 2007-12-19 20:53 ` Vlad Yasevich
2007-12-20 7:58 ` David Miller
9 siblings, 1 reply; 22+ messages in thread
From: Vlad Yasevich @ 2007-12-19 20:53 UTC (permalink / raw)
To: netdev; +Cc: lksctp-developers, David Miller
Hi David
Vlad Yasevich wrote:
> The following is a set of patches that updates the SCTP ADD-IP implementation
> to conform to the recently published RFC.
>
> ADD-IP is a SCTP Dynamic Address Configuration extensions, whereby
> the two end systems can dynamically modify the address lists for a given
> connection. One of the applications of this is mobility. The systems
> exchange Address Configuration (ASCONF) and Address Configuration
> Acknowlegement (ASCONF-ACK) messages which contain the info. If you
> want more info the operation, read RFC 5061.
>
> The implementation in lksctp was a few years old and implemented draft-05
> of the specification. So this long overdue.
>
> -vlad
>
Not sure if you got the PATCH 7/9 resend, but it looks like netdev ate that
too.
I made this patch set available here:
master.kernel.org:/pub/scm/linux/kernel/git/vxy/lksctp-dev.git addip
Vlad Yasevich (9):
SCTP: Discard unauthenticated ASCONF and ASCONF ACK chunks
SCTP: Handle the wildcard ADD-IP Address parameter
SCTP: Add the handling of "Set Primary IP Address" parameter to INIT
SCTP: Update association lookup to look at ASCONF chunks as well
SCTP: ADD-IP updates the states where ASCONFs can be sent
SCTP: Update ASCONF processing to conform to spec.
SCTP: Change use_as_src into a full address state
SCTP: Implement ADD-IP special case processing for ABORT chunk
SCTP: Follow Add-IP security consideratiosn wrt INIT/INIT-ACK
include/net/sctp/structs.h | 39 ++++++++----
net/sctp/associola.c | 75 +++++++++++++++++++++++-
net/sctp/bind_addr.c | 35 ++++++++++-
net/sctp/input.c | 124 ++++++++++++++++++++++++++++++++-------
net/sctp/ipv6.c | 2 +-
net/sctp/outqueue.c | 29 ++++++++-
net/sctp/protocol.c | 8 +-
net/sctp/sm_make_chunk.c | 132 +++++++++++++++++++++++++++++++++++------
net/sctp/sm_statefuns.c | 141 ++++++++++++++++++++++++++++++++++---------
net/sctp/sm_statetable.c | 18 +++---
net/sctp/socket.c | 8 +-
11 files changed, 503 insertions(+), 108 deletions(-)
You may pull from there is you wish.
-vlad
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH 2.6.25 0/9]: SCTP: Update ADD-IP implementation to conform to spec
2007-12-19 20:53 ` Vlad Yasevich
@ 2007-12-20 7:58 ` David Miller
0 siblings, 0 replies; 22+ messages in thread
From: David Miller @ 2007-12-20 7:58 UTC (permalink / raw)
To: vladislav.yasevich; +Cc: netdev, lksctp-developers
From: Vlad Yasevich <vladislav.yasevich@hp.com>
Date: Wed, 19 Dec 2007 15:53:47 -0500
> Not sure if you got the PATCH 7/9 resend, but it looks like netdev ate that
> too.
>
> I made this patch set available here:
> master.kernel.org:/pub/scm/linux/kernel/git/vxy/lksctp-dev.git addip
I got the patch, there is probably some keyword in there
that is making it get consumed by the majordomo regexp
filters we have in place.
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH 2.6.25 1/9] SCTP: Discard unauthenticated ASCONF and ASCONF ACK chunks
2007-12-17 21:32 ` [PATCH 2.6.25 1/9] SCTP: Discard unauthenticated ASCONF and ASCONF ACK chunks Vlad Yasevich
@ 2007-12-20 22:08 ` David Miller
0 siblings, 0 replies; 22+ messages in thread
From: David Miller @ 2007-12-20 22:08 UTC (permalink / raw)
To: vladislav.yasevich; +Cc: netdev, lksctp-developers
From: Vlad Yasevich <vladislav.yasevich@hp.com>
Date: Mon, 17 Dec 2007 16:32:41 -0500
> Now that we support AUTH, discard unauthenticated ASCONF and ASCONF ACK
> chunks as mandated in the ADD-IP spec.
>
> Signed-off-by: Vlad Yasevich <vladislav.yasevich@hp.com>
Applied.
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH 2.6.25 2/9] SCTP: Handle the wildcard ADD-IP Address parameter
2007-12-17 21:32 ` [PATCH 2.6.25 2/9] SCTP: Handle the wildcard ADD-IP Address parameter Vlad Yasevich
@ 2007-12-20 22:09 ` David Miller
0 siblings, 0 replies; 22+ messages in thread
From: David Miller @ 2007-12-20 22:09 UTC (permalink / raw)
To: vladislav.yasevich; +Cc: netdev, lksctp-developers
From: Vlad Yasevich <vladislav.yasevich@hp.com>
Date: Mon, 17 Dec 2007 16:32:42 -0500
> The Address Parameter in the parameter list of the ASCONF chunk
> may be a wildcard address. In this case special processing
> is required. For the 'add' case, the source IP of the packet is
> added. In the 'del' case, all addresses except the source IP
> of packet are removed. In the "mark primary" case, the source
> address is marked as primary.
>
> Signed-off-by: Vlad Yasevich <vladislav.yasevich@hp.com>
Applied.
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH 2.6.25 3/9] SCTP: Add the handling of "Set Primary IP Address" parameter to INIT
2007-12-17 21:32 ` [PATCH 2.6.25 3/9] SCTP: Add the handling of "Set Primary IP Address" parameter to INIT Vlad Yasevich
@ 2007-12-20 22:10 ` David Miller
0 siblings, 0 replies; 22+ messages in thread
From: David Miller @ 2007-12-20 22:10 UTC (permalink / raw)
To: vladislav.yasevich; +Cc: netdev, lksctp-developers
From: Vlad Yasevich <vladislav.yasevich@hp.com>
Date: Mon, 17 Dec 2007 16:32:43 -0500
> The ADD-IP "Set Primary IP Address" parameter is allowed in the
> INIT/INIT-ACK exchange. Allow processing of this parameter during
> the INIT/INIT-ACK.
>
> Signed-off-by: Vlad Yasevich <vladislav.yasevich@hp.com>
Applied.
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH 2.6.25 4/9] SCTP: Update association lookup to look at ASCONF chunks as well
2007-12-17 21:32 ` [PATCH 2.6.25 4/9] SCTP: Update association lookup to look at ASCONF chunks as well Vlad Yasevich
@ 2007-12-20 22:10 ` David Miller
0 siblings, 0 replies; 22+ messages in thread
From: David Miller @ 2007-12-20 22:10 UTC (permalink / raw)
To: vladislav.yasevich; +Cc: netdev, lksctp-developers
From: Vlad Yasevich <vladislav.yasevich@hp.com>
Date: Mon, 17 Dec 2007 16:32:44 -0500
> ADD-IP draft section 5.2 specifies that if an association can not
> be found using the source and destination of the IP packet,
> then, if the packet contains ASCONF chunks, the Address Parameter
> TLV should be used to lookup an association.
>
> Signed-off-by: Vlad Yasevich <vladislav.yasevich@hp.com>
Applied.
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH 2.6.25 5/9] SCTP: ADD-IP updates the states where ASCONFs can be sent
2007-12-17 21:32 ` [PATCH 2.6.25 5/9] SCTP: ADD-IP updates the states where ASCONFs can be sent Vlad Yasevich
@ 2007-12-20 22:11 ` David Miller
0 siblings, 0 replies; 22+ messages in thread
From: David Miller @ 2007-12-20 22:11 UTC (permalink / raw)
To: vladislav.yasevich; +Cc: netdev, lksctp-developers
From: Vlad Yasevich <vladislav.yasevich@hp.com>
Date: Mon, 17 Dec 2007 16:32:45 -0500
> C4) Both ASCONF and ASCONF-ACK Chunks MUST NOT be sent in any SCTP
> state except ESTABLISHED, SHUTDOWN-PENDING, SHUTDOWN-RECEIVED,
> and SHUTDOWN-SENT.
>
> Signed-off-by: Vlad Yasevich <vladislav.yasevich@hp.com>
Applied.
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH 2.6.25 6/9] SCTP: Update ASCONF processing to conform to spec.
2007-12-17 21:32 ` [PATCH 2.6.25 6/9] SCTP: Update ASCONF processing to conform to spec Vlad Yasevich
@ 2007-12-20 22:11 ` David Miller
0 siblings, 0 replies; 22+ messages in thread
From: David Miller @ 2007-12-20 22:11 UTC (permalink / raw)
To: vladislav.yasevich; +Cc: netdev, lksctp-developers
From: Vlad Yasevich <vladislav.yasevich@hp.com>
Date: Mon, 17 Dec 2007 16:32:46 -0500
> The processing of the ASCONF chunks has changed a lot in the
> spec. New items are:
> 1. A list of ASCONF-ACK chunks is now cached
> 2. The source of the packet is used in response.
> 3. New handling for unexpect ASCONF chunks.
>
> Signed-off-by: Vlad Yasevich <vladislav.yasevich@hp.com>
Applied.
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH 2.6.25 8/9] SCTP: Implement ADD-IP special case processing for ABORT chunk
2007-12-17 21:32 ` [PATCH 2.6.25 8/9] SCTP: Implement ADD-IP special case processing for ABORT chunk Vlad Yasevich
@ 2007-12-20 22:13 ` David Miller
0 siblings, 0 replies; 22+ messages in thread
From: David Miller @ 2007-12-20 22:13 UTC (permalink / raw)
To: vladislav.yasevich; +Cc: netdev, lksctp-developers
From: Vlad Yasevich <vladislav.yasevich@hp.com>
Date: Mon, 17 Dec 2007 16:32:48 -0500
> ADD-IP spec has a special case for processing ABORTs:
> F4) ... One special consideration is that ABORT
> Chunks arriving destined to the IP address being deleted MUST be
> ignored (see Section 5.3.1 for further details).
>
> Check if the address we received on is in the DEL state, and if
> so, ignore the ABORT.
>
> Signed-off-by: Vlad Yasevich <vladislav.yasevich@hp.com>
Applied.
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH 2.6.25 9/9] SCTP: Follow Add-IP security consideratiosn wrt INIT/INIT-ACK
2007-12-17 21:32 ` [PATCH 2.6.25 9/9] SCTP: Follow Add-IP security consideratiosn wrt INIT/INIT-ACK Vlad Yasevich
@ 2007-12-20 22:13 ` David Miller
0 siblings, 0 replies; 22+ messages in thread
From: David Miller @ 2007-12-20 22:13 UTC (permalink / raw)
To: vladislav.yasevich; +Cc: netdev, lksctp-developers
From: Vlad Yasevich <vladislav.yasevich@hp.com>
Date: Mon, 17 Dec 2007 16:32:49 -0500
> The Security Considerations section of RFC 5061 has the following
> text:
>
> If an SCTP endpoint that supports this extension receives an INIT
> that indicates that the peer supports the ASCONF extension but does
> NOT support the [RFC4895] extension, the receiver of such an INIT
> MUST send an ABORT in response. Note that an implementation is
> allowed to silently discard such an INIT as an option as well, but
> under NO circumstance is an implementation allowed to proceed with
> the association setup by sending an INIT-ACK in response.
>
> An implementation that receives an INIT-ACK that indicates that the
> peer does not support the [RFC4895] extension MUST NOT send the
> COOKIE-ECHO to establish the association. Instead, the
> implementation MUST discard the INIT-ACK and report to the upper-
> layer user that an association cannot be established destroying the
> Transmission Control Block (TCB).
>
> Follow the recomendations.
>
> Signed-off-by: Vlad Yasevich <vladislav.yasevich@hp.com>
Applied, thanks.
^ permalink raw reply [flat|nested] 22+ messages in thread
end of thread, other threads:[~2007-12-20 22:13 UTC | newest]
Thread overview: 22+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-12-17 21:32 [PATCH 2.6.25 0/9]: SCTP: Update ADD-IP implementation to conform to spec Vlad Yasevich
2007-12-17 21:32 ` [PATCH 2.6.25 1/9] SCTP: Discard unauthenticated ASCONF and ASCONF ACK chunks Vlad Yasevich
2007-12-20 22:08 ` David Miller
2007-12-17 21:32 ` [PATCH 2.6.25 2/9] SCTP: Handle the wildcard ADD-IP Address parameter Vlad Yasevich
2007-12-20 22:09 ` David Miller
2007-12-17 21:32 ` [PATCH 2.6.25 3/9] SCTP: Add the handling of "Set Primary IP Address" parameter to INIT Vlad Yasevich
2007-12-20 22:10 ` David Miller
2007-12-17 21:32 ` [PATCH 2.6.25 4/9] SCTP: Update association lookup to look at ASCONF chunks as well Vlad Yasevich
2007-12-20 22:10 ` David Miller
2007-12-17 21:32 ` [PATCH 2.6.25 5/9] SCTP: ADD-IP updates the states where ASCONFs can be sent Vlad Yasevich
2007-12-20 22:11 ` David Miller
2007-12-17 21:32 ` [PATCH 2.6.25 6/9] SCTP: Update ASCONF processing to conform to spec Vlad Yasevich
2007-12-20 22:11 ` David Miller
2007-12-17 21:32 ` [PATCH 2.6.25 8/9] SCTP: Implement ADD-IP special case processing for ABORT chunk Vlad Yasevich
2007-12-20 22:13 ` David Miller
2007-12-17 21:32 ` [PATCH 2.6.25 9/9] SCTP: Follow Add-IP security consideratiosn wrt INIT/INIT-ACK Vlad Yasevich
2007-12-20 22:13 ` David Miller
2007-12-17 22:36 ` [PATCH 2.6.25 0/9]: SCTP: Update ADD-IP implementation to conform to spec David Miller
2007-12-17 22:40 ` Vlad Yasevich
2007-12-17 22:43 ` David Miller
2007-12-19 20:53 ` Vlad Yasevich
2007-12-20 7:58 ` 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).