Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=3c77f961b55b6060858c68a213d7f4470d7f3eb2
Commit:     3c77f961b55b6060858c68a213d7f4470d7f3eb2
Parent:     ece25dfa0991f65c4e1d26beb1c3c45bda4239b8
Author:     Vlad Yasevich <[EMAIL PROTECTED]>
AuthorDate: Mon Sep 17 15:14:28 2007 -0400
Committer:  David S. Miller <[EMAIL PROTECTED]>
CommitDate: Tue Sep 25 22:55:48 2007 -0700

    SCTP: Discard OOTB packetes with bundled INIT early.
    
    RFC 4460 and future RFC 4960 (2960-bis) specify that packets
    with bundled INIT chunks need to be dropped.  We currenlty do
    that only after processing any leading chunks.  For OOTB chunks,
    since we already walk the entire packet, we should discard packets
    with bundled INITs.
    
    There are other chunks chunks that MUST NOT be bundled, but the spec
    is silent on theire treatment.  Thus, we'll leave their teatment
    alone for the moment.
    
    Signed-off-by: Vlad Yasevich <[EMAIL PROTECTED]>
    Acked-by: Wei Yongjun <[EMAIL PROTECTED]>
---
 net/sctp/input.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/net/sctp/input.c b/net/sctp/input.c
index 47e5601..f9a0c92 100644
--- a/net/sctp/input.c
+++ b/net/sctp/input.c
@@ -622,6 +622,14 @@ static int sctp_rcv_ootb(struct sk_buff *skb)
                if (SCTP_CID_SHUTDOWN_COMPLETE == ch->type)
                        goto discard;
 
+               /* RFC 4460, 2.11.2
+                * This will discard packets with INIT chunk bundled as
+                * subsequent chunks in the packet.  When INIT is first,
+                * the normal INIT processing will discard the chunk.
+                */
+               if (SCTP_CID_INIT == ch->type && (void *)ch != skb->data)
+                       goto discard;
+
                /* RFC 8.4, 7) If the packet contains a "Stale cookie" ERROR
                 * or a COOKIE ACK the SCTP Packet should be silently
                 * discarded.
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to