19 May, 2018

2 commits

  • [ Upstream commit 46e16d4b956867013e0bbd7f2bad206f4aa55752 ]

    When processing a duplicate cookie-echo chunk, for case 'D', sctp will
    not process the param from this chunk. It means old asoc has nothing
    to be updated, and the new temp asoc doesn't have the complete info.

    So there's no reason to use the new asoc when creating the cookie-ack
    chunk. Otherwise, like when auth is enabled for cookie-ack, the chunk
    can not be set with auth, and it will definitely be dropped by peer.

    This issue is there since very beginning, and we fix it by using the
    old asoc instead.

    Signed-off-by: Xin Long
    Acked-by: Neil Horman
    Acked-by: Marcelo Ricardo Leitner
    Signed-off-by: David S. Miller
    Signed-off-by: Greg Kroah-Hartman

    Xin Long
     
  • [ Upstream commit 59d8d4434f429b4fa8a346fd889058bda427a837 ]

    Now sctp only delays the authentication for the normal cookie-echo
    chunk by setting chunk->auth_chunk in sctp_endpoint_bh_rcv(). But
    for the duplicated one with auth, in sctp_assoc_bh_rcv(), it does
    authentication first based on the old asoc, which will definitely
    fail due to the different auth info in the old asoc.

    The duplicated cookie-echo chunk will create a new asoc with the
    auth info from this chunk, and the authentication should also be
    done with the new asoc's auth info for all of the collision 'A',
    'B' and 'D'. Otherwise, the duplicated cookie-echo chunk with auth
    will never pass the authentication and create the new connection.

    This issue exists since very beginning, and this fix is to make
    sctp_assoc_bh_rcv() follow the way sctp_endpoint_bh_rcv() does
    for the normal cookie-echo chunk to delay the authentication.

    While at it, remove the unused params from sctp_sf_authenticate()
    and define sctp_auth_chunk_verify() used for all the places that
    do the delayed authentication.

    v1->v2:
    fix the typo in changelog as Marcelo noticed.

    Acked-by: Marcelo Ricardo Leitner
    Signed-off-by: Xin Long
    Acked-by: Neil Horman
    Signed-off-by: David S. Miller
    Signed-off-by: Greg Kroah-Hartman

    Xin Long
     

12 Aug, 2017

5 commits

  • This patch is to remove the typedef sctp_disposition_t, and
    replace with enum sctp_disposition in the places where it's
    using this typedef.

    It's also to fix the indent for many functions' defination.

    Signed-off-by: Xin Long
    Signed-off-by: David S. Miller

    Xin Long
     
  • This patch is to remove the typedef sctp_verb_t, and
    replace with enum sctp_verb in the places where it's
    using this typedef.

    Signed-off-by: Xin Long
    Signed-off-by: David S. Miller

    Xin Long
     
  • This patch is to remove the typedef sctp_arg_t, and
    replace with union sctp_arg in the places where it's
    using this typedef.

    Signed-off-by: Xin Long
    Signed-off-by: David S. Miller

    Xin Long
     
  • This patch is to remove the typedef sctp_cmd_seq_t, and
    replace with struct sctp_cmd_seq in the places where it's
    using this typedef.

    Note that it doesn't fix many indents although it should,
    as sctp_disposition_t's removal would mess them up again.
    So better to fix them when removing sctp_disposition_t in
    the later patch.

    Signed-off-by: Xin Long
    Signed-off-by: David S. Miller

    Xin Long
     
  • This patch is to remove the typedef sctp_sender_hb_info_t, and
    replace with struct sctp_sender_hb_info in the places where it's
    using this typedef.

    It is also to use sizeof(variable) instead of sizeof(type).

    Signed-off-by: Xin Long
    Signed-off-by: David S. Miller

    Xin Long
     

07 Aug, 2017

2 commits

  • This patch is to remove the typedef sctp_subtype_t, and
    replace with union sctp_subtype in the places where it's
    using this typedef.

    Note that it doesn't fix many indents although it should,
    as sctp_disposition_t's removal would mess them up again.
    So better to fix them when removing sctp_disposition_t in
    later patch.

    Signed-off-by: Xin Long
    Signed-off-by: David S. Miller

    Xin Long
     
  • This patch is to remove the typedef sctp_ierror_t, and
    replace with enum sctp_ierror in the places where it's
    using this typedef.

    Signed-off-by: Xin Long
    Signed-off-by: David S. Miller

    Xin Long
     

04 Aug, 2017

11 commits


25 Jul, 2017

7 commits


17 Jul, 2017

1 commit


02 Jul, 2017

6 commits

  • This patch is to remove the typedef sctp_init_chunk_t, and replace
    with struct sctp_init_chunk in the places where it's using this
    typedef.

    Signed-off-by: Xin Long
    Signed-off-by: David S. Miller

    Xin Long
     
  • This patch is to remove the typedef sctp_inithdr_t, and replace
    with struct sctp_inithdr in the places where it's using this
    typedef.

    Signed-off-by: Xin Long
    Signed-off-by: David S. Miller

    Xin Long
     
  • This patch is to remove the typedef sctp_data_chunk_t, and replace
    with struct sctp_data_chunk in the places where it's using this
    typedef.

    Signed-off-by: Xin Long
    Signed-off-by: David S. Miller

    Xin Long
     
  • This patch is to remove the typedef sctp_datahdr_t, and replace with
    struct sctp_datahdr in the places where it's using this typedef.

    It is also to use izeof(variable) instead of sizeof(type).

    Signed-off-by: Xin Long
    Signed-off-by: David S. Miller

    Xin Long
     
  • This patch is to remove the typedef sctp_paramhdr_t, and replace
    with struct sctp_paramhdr in the places where it's using this
    typedef.

    It is also to fix some indents and use sizeof(variable) instead
    of sizeof(type).

    Signed-off-by: Xin Long
    Signed-off-by: David S. Miller

    Xin Long
     
  • This patch is to remove the typedef sctp_chunkhdr_t, and replace
    with struct sctp_chunkhdr in the places where it's using this
    typedef.

    It is also to fix some indents and use sizeof(variable) instead
    of sizeof(type)., especially in sctp_new.

    Signed-off-by: Xin Long
    Signed-off-by: David S. Miller

    Xin Long
     

16 Jun, 2017

1 commit

  • It seems like a historic accident that these return unsigned char *,
    and in many places that means casts are required, more often than not.

    Make these functions return void * and remove all the casts across
    the tree, adding a (u8 *) cast only where the unsigned char pointer
    was used directly, all done with the following spatch:

    @@
    expression SKB, LEN;
    typedef u8;
    identifier fn = { skb_push, __skb_push, skb_push_rcsum };
    @@
    - *(fn(SKB, LEN))
    + *(u8 *)fn(SKB, LEN)

    @@
    expression E, SKB, LEN;
    identifier fn = { skb_push, __skb_push, skb_push_rcsum };
    type T;
    @@
    - E = ((T *)(fn(SKB, LEN)))
    + E = fn(SKB, LEN)

    @@
    expression SKB, LEN;
    identifier fn = { skb_push, __skb_push, skb_push_rcsum };
    @@
    - fn(SKB, LEN)[0]
    + *(u8 *)fn(SKB, LEN)

    Note that the last part there converts from push(...)[0] to the
    more idiomatic *(u8 *)push(...).

    Signed-off-by: Johannes Berg
    Signed-off-by: David S. Miller

    Johannes Berg
     

03 Jun, 2017

1 commit

  • As Marcelo's suggestion, stream is a fixed size member of asoc and would
    not grow with more streams. To avoid an allocation for it, this patch is
    to define it as an object instead of pointer and update the places using
    it, also create sctp_stream_update() called in sctp_assoc_update() to
    migrate the stream info from one stream to another.

    Signed-off-by: Xin Long
    Signed-off-by: David S. Miller

    Xin Long
     

25 May, 2017

1 commit

  • After sctp changed to use transport hashtable, a transport would be
    added into global hashtable when adding the peer to an asoc, then
    the asoc can be got by searching the transport in the hashtbale.

    The problem is when processing dupcookie in sctp_sf_do_5_2_4_dupcook,
    a new asoc would be created. A peer with the same addr and port as
    the one in the old asoc might be added into the new asoc, but fail
    to be added into the hashtable, as they also belong to the same sk.

    It causes that sctp's dupcookie processing can not really work.

    Since the new asoc will be freed after copying it's information to
    the old asoc, it's more like a temp asoc. So this patch is to fix
    it by setting it as a temp asoc to avoid adding it's any transport
    into the hashtable and also avoid allocing assoc_id.

    An extra thing it has to do is to also alloc stream info for any
    temp asoc, as sctp dupcookie process needs it to update old asoc.
    But I don't think it would hurt something, as a temp asoc would
    always be freed after finishing processing cookie echo packet.

    Reported-by: Jianwen Ji
    Signed-off-by: Xin Long
    Acked-by: Neil Horman
    Acked-by: Vlad Yasevich
    Signed-off-by: David S. Miller

    Xin Long
     

06 Apr, 2017

1 commit


02 Apr, 2017

1 commit

  • Since sctp reconf was added in sctp, the real cnt of in/out stream
    have not been c.sinit_max_instreams and c.sinit_num_ostreams any
    more.

    This patch is to replace them with stream->in/outcnt.

    Signed-off-by: Xin Long
    Acked-by: Marcelo Ricardo Leitner
    Signed-off-by: David S. Miller

    Xin Long
     

13 Mar, 2017

1 commit