Re: [PATCHv3 net-next 1/7] sctp: add a common helper function to generate stream reconf chunk

2017-01-16 Thread Xin Long
On Tue, Jan 17, 2017 at 2:50 AM, David Miller <da...@davemloft.net> wrote: > From: Xin Long <lucien@gmail.com> > Date: Sat, 14 Jan 2017 03:15:35 +0800 > >> diff --git a/net/sctp/sm_make_chunk.c b/net/sctp/sm_make_chunk.c >> index a15d824..fd58097 100644

Re: [PATCH net-next] sctp: remove useless code from sctp_apply_peer_addr_params

2017-01-16 Thread Xin Long
s not necessary. > IOW, no action is needed here and we can remove this call. > > Signed-off-by: Marcelo Ricardo Leitner <marcelo.leit...@gmail.com> Reviewed-by: Xin Long <lucien@gmail.com> > --- > net/sctp/socket.c | 1 - > 1 file changed, 1 deletion(-)

Re: [PATCH net-next] sctp: remove unused var from sctp_process_asconf

2017-01-16 Thread Xin Long
On Sat, Jan 14, 2017 at 4:27 AM, Marcelo Ricardo Leitner <marcelo.leit...@gmail.com> wrote: > Assigned but not used. > > Signed-off-by: Marcelo Ricardo Leitner <marcelo.leit...@gmail.com> Reviewed-by: Xin Long <lucien@gmail.com> > --- > net/sctp/sm_make_ch

Re: [PATCHv3 net-next 2/7] sctp: add support for generating stream reconf ssn reset request chunk

2017-01-15 Thread Xin Long
On Sun, Jan 15, 2017 at 11:51 PM, Marcelo Ricardo Leitner <marcelo.leit...@gmail.com> wrote: > On Sat, Jan 14, 2017 at 03:15:36AM +0800, Xin Long wrote: >> This patch is to add asoc strreset_outseq and strreset_inseq for >> saving the reconf request sequence, initialize them

[PATCHv3 net-next 7/7] sctp: implement sender-side procedures for SSN Reset Request Parameter

2017-01-13 Thread Xin Long
sure only one reconf request chunk on the fly as rfc6525 section 5.1.1 demands. Signed-off-by: Xin Long <lucien@gmail.com> --- include/net/sctp/sctp.h| 6 include/net/sctp/structs.h | 1 + include/uapi/linux/sctp.h | 11 +++ net/sctp/outqueue.c

[PATCHv3 net-next 6/7] sctp: add sockopt SCTP_ENABLE_STREAM_RESET

2017-01-13 Thread Xin Long
This patch is to add sockopt SCTP_ENABLE_STREAM_RESET to get/set strreset_enable to indicate which reconf request type it supports, which is described in rfc6525 section 6.3.1. Signed-off-by: Xin Long <lucien@gmail.com> --- include/net/sctp/structs.h | 4 +++ include/uapi/linux/sctp.h

[PATCHv3 net-next 4/7] sctp: add stream reconf primitive

2017-01-13 Thread Xin Long
This patch is to add a primitive based on sctp primitive frame for sending stream reconf request. It works as the other primitives, and create a SCTP_CMD_REPLY command to send the request chunk out. sctp_primitive_RECONF would be the api to send a reconf request chunk. Signed-off-by: Xin Long

[PATCHv3 net-next 5/7] sctp: add reconf_enable in asoc ep and netns

2017-01-13 Thread Xin Long
to know if peer supports reconf_enable, the value is set if ext params have reconf chunk support when processing init chunk, just as rfc6525 section 5.1.1 demands. Signed-off-by: Xin Long <lucien@gmail.com> --- include/net/netns/sctp.h | 3 +++ include/net/sctp/structs.h | 7 +-

[PATCHv3 net-next 2/7] sctp: add support for generating stream reconf ssn reset request chunk

2017-01-13 Thread Xin Long
as section rfc6525 3.1-3 describes, it makes them in one function. Signed-off-by: Xin Long <lucien@gmail.com> --- include/linux/sctp.h | 26 ++ include/net/sctp/sm.h | 5 ++- include/net/sctp/structs.h | 3 ++ net/sctp/associola.c | 1 + net/sctp/sm_make_c

[PATCHv3 net-next 3/7] sctp: add stream reconf timer

2017-01-13 Thread Xin Long
the reconf request chunk, so that it can be retransmitted, and to check if the response is really for this request by comparing the information inside with the response chunk as well. Signed-off-by: Xin Long <lucien@gmail.com> --- include/net/sctp/constants.h | 1 + include/net/sctp/sm.h

[PATCHv3 net-next 1/7] sctp: add a common helper function to generate stream reconf chunk

2017-01-13 Thread Xin Long
This patch is to define a common api used to alloc memory and initialize reconf chunk header that described in rfc6525 section 3.1. All reconf chunks will be generated by calling this helper function. Signed-off-by: Xin Long <lucien@gmail.com> --- include/linux/sctp.h | 6 +

[PATCHv3 net-next 0/7] sctp: add sender-side procedures for stream reconf ssn reset request chunk

2017-01-13 Thread Xin Long
odes. - rename the titles of the commits and improve some changelogs. v2->v3: - re-split the patchset and make sure it has no dead codes for review. Xin Long (7): sctp: add a common helper function to generate stream reconf chunk sctp: add support for generating stream reconf ssn reset reques

Re: [PATCHv2 net-next 0/5] sctp: add support for generating stream reconf chunks

2017-01-09 Thread Xin Long
On Mon, Jan 9, 2017 at 11:53 PM, David Miller wrote: > From: Neil Horman > Date: Mon, 9 Jan 2017 07:43:25 -0500 > >> These all look reasonably good, but it seems before we accept them, >> there should be an additional patch that actually makes use of

[PATCHv2 net-next 4/5] sctp: add support for generating stream reconf response chunk

2017-01-07 Thread Xin Long
This patch is to define Re-configuration Response Parameter described in rfc6525 section 4.4. As optional fields are only for SSN/TSN Reset Request Parameter, it uses another function to make that. Signed-off-by: Xin Long <lucien@gmail.com> --- include/linux/sctp.h

[PATCHv2 net-next 3/5] sctp: add support for generating stream reconf ssn/tsn reset request chunk

2017-01-07 Thread Xin Long
This patch is to define SSN/TSN Reset Request Parameter described in rfc6525 section 4.3. Signed-off-by: Xin Long <lucien@gmail.com> --- include/linux/sctp.h | 5 + include/net/sctp/sm.h| 2 ++ net/sctp/sm_make_chunk.c | 29 + 3 files chang

[PATCHv2 net-next 5/5] sctp: add support for generating stream reconf add streams request chunk

2017-01-07 Thread Xin Long
This patch is to define Add Incoming/Outgoing Streams Request Parameter described in rfc6525 section 4.5 and 4.6. They can be in one same chunk trunk as rfc6525 section 3.1-7 describes, so make them in one function. Signed-off-by: Xin Long <lucien@gmail.com> --- include/linux/sctp.h

[PATCHv2 net-next 2/5] sctp: add support for generating stream reconf ssn reset request chunk

2017-01-07 Thread Xin Long
as section rfc6525 3.1-3 describes, it makes them in one function. Signed-off-by: Xin Long <lucien@gmail.com> --- include/linux/sctp.h | 26 ++ include/net/sctp/sm.h | 5 ++- include/net/sctp/structs.h | 3 ++ net/sctp/associola.c | 1 + net/sctp/sm_make_c

[PATCHv2 net-next 0/5] sctp: add support for generating stream reconf chunks

2017-01-07 Thread Xin Long
This patchset is to add some functions to generate stream reconf chunks, described in RFC6525 Section 3 and Section 4. v1->v2: - put these into a smaller group. - rename some temporary variables in the codes. - rename the titles of the commits and improve some changelogs. Xin Long

[PATCHv2 net-next 1/5] sctp: add a common helper function to generate stream reconf chunk

2017-01-07 Thread Xin Long
This patch is to define a common api used to alloc memory and initialize reconf chunk header that described in rfc6525 section 3.1. All reconf chunks will be generated by calling this helper function. Signed-off-by: Xin Long <lucien@gmail.com> --- include/linux/sctp.h | 6 +

[PATCHv3 net-next] sctp: prepare asoc stream for stream reconf

2017-01-06 Thread Xin Long
define sctp_stream to contain stream arrays, and create stream.c to put stream-related functions. - merge 3 patches into 1, as new sctp_stream has the same name with before. Signed-off-by: Xin Long <lucien@gmail.com> --- include/net/sctp/sctp.h| 1 - include/net/sctp/str

Re: [PATCHv2 net-next 1/3] sctp: add stream arrays in asoc

2017-01-06 Thread Xin Long
On Wed, Jan 4, 2017 at 9:39 PM, Marcelo Ricardo Leitner <marcelo.leit...@gmail.com> wrote: > On Tue, Jan 03, 2017 at 01:59:46PM +0800, Xin Long wrote: >> This patch is to add streamout and streamin arrays in asoc, initialize >> them in sctp_process_init and free them in

[PATCHv2 net-next 3/3] sctp: remove asoc ssnmap and ssnmap.c

2017-01-02 Thread Xin Long
Since asoc stream arrays has replaced ssnmap, ssnmap is not used any more, this patch is to remove asoc ssnmap and ssnmap.c. Signed-off-by: Xin Long <lucien@gmail.com> --- include/net/sctp/sctp.h| 1 - include/net/sctp/structs.h | 33 net/sctp/Makefile

[PATCHv2 net-next 1/3] sctp: add stream arrays in asoc

2017-01-02 Thread Xin Long
This patch is to add streamout and streamin arrays in asoc, initialize them in sctp_process_init and free them in sctp_association_free. Stream arrays are used to replace ssnmap to save more stream things in the next patch. Signed-off-by: Xin Long <lucien@gmail.com> --- include/ne

[PATCHv2 net-next 2/3] sctp: replace ssnmap with asoc stream arrays

2017-01-02 Thread Xin Long
Stream arrays are used to save per stream information, which includes ssn for each stream already. This patch is to replace ssnmap with asoc stream arrays. Signed-off-by: Xin Long <lucien@gmail.com> --- include/net/sctp/structs.h | 19 ++- net/sctp/associola.c

[PATCHv2 net-next 0/3] sctp: prepare asoc stream for stream reconf

2017-01-02 Thread Xin Long
. v1->v2: put these patches into a smaller group. Xin Long (3): sctp: add stream arrays in asoc sctp: replace ssnmap with asoc stream arrays sctp: remove asoc ssnmap and ssnmap.c include/net/sctp/sctp.h| 1 - include/net/sctp/structs.h | 70 + net/sctp/Makef

Re: [PATCH net-next 22/27] sctp: add rfc6525 section 5.2.4

2017-01-02 Thread Xin Long
On Mon, Jan 2, 2017 at 12:32 AM, David Miller <da...@davemloft.net> wrote: > From: Xin Long <lucien@gmail.com> > Date: Sun, 1 Jan 2017 21:26:47 +0800 > >> As only when the result is not performed, initial_tsn variables is >> uninitialized, peer side would i

Re: [PATCH net-next 00/27] sctp: implement rfc6525 sctp stream reconf

2017-01-02 Thread Xin Long
On Mon, Jan 2, 2017 at 12:30 AM, David Miller wrote: > > I'm sorry but this is way too many patches to submit at one time. > > Split your series into smaller, more reasonably sized, groups > of changes. okay, will split and repost

Re: [PATCH net-next 22/27] sctp: add rfc6525 section 5.2.4

2017-01-01 Thread Xin Long
On Sun, Jan 1, 2017 at 8:14 PM, kbuild test robot <l...@intel.com> wrote: > Hi Xin, > > [auto build test WARNING on net-next/master] > > url: > https://github.com/0day-ci/linux/commits/Xin-Long/sctp-implement-rfc6525-sctp-stream-reconf/20170101-192844 > config: x8

Re: [PATCH net-next 20/27] sctp: add rfc6525 section 5.2.2

2017-01-01 Thread Xin Long
On Sun, Jan 1, 2017 at 8:02 PM, kbuild test robot <l...@intel.com> wrote: > Hi Xin, > > [auto build test WARNING on net-next/master] > > url: > https://github.com/0day-ci/linux/commits/Xin-Long/sctp-implement-rfc6525-sctp-stream-reconf/20170101-192844 > config: x8

Re: [PATCH net-next 00/27] sctp: implement rfc6525 sctp stream reconf

2017-01-01 Thread Xin Long
On Sun, Jan 1, 2017 at 7:20 PM, Xin Long <lucien@gmail.com> wrote: > This patchset is to implement sctp stream reconf described in rfc6525. > > Patch 1-3 add per stream information in sctp asoc. > Patch 4-8 make the chunk with different reconf params. (Section 3-4) > P

[PATCH net-next 20/27] sctp: add rfc6525 section 5.2.2

2017-01-01 Thread Xin Long
This patch is to implement Receiver-Side Procedures for the Outgoing SSN Reset Request Parameter described in section 5.2.2. Note that some checks must be after request_seq check, as even those checks fail, strreset_inseq still has to be increase by 1. Signed-off-by: Xin Long <luc

[PATCH net-next 21/27] sctp: add rfc6525 section 5.2.3

2017-01-01 Thread Xin Long
This patch is to implement Receiver-Side Procedures for the Incoming SSN Reset Request Parameter described in section 5.2.3. Signed-off-by: Xin Long <lucien@gmail.com> --- include/net/sctp/sm.h | 4 net/sctp/stream.c | 63 +++ 2

[PATCH net-next 26/27] sctp: add sctp reconf chunk process

2017-01-01 Thread Xin Long
chunk, it also adds a function sctp_merge_reconf_chunk to merge two reconf chunk into one. Signed-off-by: Xin Long <lucien@gmail.com> --- include/net/sctp/sm.h| 8 + net/sctp/sm_make_chunk.c | 94 net/sctp/sm_statefuns.c

[PATCH net-next 23/27] sctp: add rfc6525 section 5.2.5

2017-01-01 Thread Xin Long
This patch is to add Receiver-Side Procedures for the Add Outgoing Streams Request Parameter described in section 5.2.5. Signed-off-by: Xin Long <lucien@gmail.com> --- include/net/sctp/sm.h | 4 net/sctp/stream.c | 56 +++ 2

[PATCH net-next 24/27] sctp: add rfc6525 section 5.2.6

2017-01-01 Thread Xin Long
This patch is to implement Receiver-Side Procedures for the Add Incoming Streams Request Parameter described in section 5.2.6. Signed-off-by: Xin Long <lucien@gmail.com> --- include/net/sctp/sm.h | 4 net/sctp/stream.c | 59

[PATCH net-next 19/27] sctp: add rfc6525 section 6.1.3

2017-01-01 Thread Xin Long
This patch is to add Stream Change Event described in section 6.1.3. Signed-off-by: Xin Long <lucien@gmail.com> --- include/net/sctp/ulpevent.h | 4 include/uapi/linux/sctp.h | 15 +++ net/sctp/ulpevent.c | 28 3 files chang

[PATCH net-next 25/27] sctp: add rfc6525 section 5.2.7

2017-01-01 Thread Xin Long
This patch is to implement Receiver-Side Procedures for the Re-configuration Response Parameter in section 5.2.7. sctp_process_strreset_resp would process the response for any kind of reconf request, and the stream reconf is applied only when the response result is success. Signed-off-by: Xin

[PATCH net-next 27/27] sctp: add reconf chunk event

2017-01-01 Thread Xin Long
This patch is to add reconf chunk event based on the sctp event frame, after which, the reconf chunk process would be activated. Signed-off-by: Xin Long <lucien@gmail.com> --- include/net/sctp/constants.h | 3 +++ net/sctp/sm_statetable.c | 30 ++ 2

[PATCH net-next 22/27] sctp: add rfc6525 section 5.2.4

2017-01-01 Thread Xin Long
This patch is to implement Receiver-Side Procedures for the SSN/TSN Reset Request Parameter described in section 6.2.4. The process is kinda complicate, it's wonth having comments from section 6.2.4 in the codes. Signed-off-by: Xin Long <lucien@gmail.com> --- include/net/sctp/sm.

[PATCH net-next 13/27] sctp: add rfc6525 section 6.3.1

2017-01-01 Thread Xin Long
This patch is to add sockopt SCTP_ENABLE_STREAM_RESET to set strreset_enable to indicate which reconf request type it supports, which is described in section 6.3.1. Signed-off-by: Xin Long <lucien@gmail.com> --- include/net/sctp/structs.h | 4 +++ include/uapi/linux/sctp.h | 7 +++

[PATCH net-next 18/27] sctp: add rfc6525 section 6.1.2

2017-01-01 Thread Xin Long
This patch is to add Association Reset Event described in section 6.1.2. Signed-off-by: Xin Long <lucien@gmail.com> --- include/net/sctp/ulpevent.h | 4 include/uapi/linux/sctp.h | 15 +++ net/sctp/ulpevent.c | 28 3 files chang

[PATCH net-next 16/27] sctp: add rfc6525 section 5.1.5-5.1.6 and 6.3.4

2017-01-01 Thread Xin Long
This patch is to implement Sender-Side Procedures for the Add Outgoing and Incoming Streams Request Parameter described in 5.1.5-5.1.6. It is also to add sockopt SCTP_ADD_STREAMS in section 6.3.4 for users. Signed-off-by: Xin Long <lucien@gmail.com> --- include/uapi/linux/sctp.h

[PATCH net-next 10/27] sctp: add stream reconf primitive

2017-01-01 Thread Xin Long
This patch is to add a primitive based on sctp primitive frame for sending stream reconf request. It works as the other primitives, and create a SCTP_CMD_REPLY command to send the request chunk out. sctp_primitive_RECONF would be the api to send a reconf request chunk. Signed-off-by: Xin Long

[PATCH net-next 09/27] sctp: add stream reconf timer

2017-01-01 Thread Xin Long
the reconf request chunk, so that it can be retransmitted, and to check if the response is really for this request by comparing the information inside with the response chunk as well. Signed-off-by: Xin Long <lucien@gmail.com> --- include/net/sctp/constants.h | 1 + include/net/sctp/sm.h

[PATCH net-next 07/27] sctp: add rfc6525 section 4.4

2017-01-01 Thread Xin Long
This patch is to define Re-configuration Response Parameter described in section 4.4. As optional fields are only for SSN/TSN Reset Request Parameter, it uses another function to make that. Signed-off-by: Xin Long <lucien@gmail.com> --- include/linux/sctp.h | 24 i

[PATCH net-next 08/27] sctp: add rfc6525 section 4.5-4.6

2017-01-01 Thread Xin Long
This patch is to define Add Incoming/Outgoing Streams Request Parameter described in section 4.5 and 4.6. They can be in one same chunk trunk as section 3.1-7 describes, so make them in one function. Signed-off-by: Xin Long <lucien@gmail.com> --- include/linux/sctp.h

[PATCH net-next 11/27] sctp: add reconf_enable in asoc ep and netns

2017-01-01 Thread Xin Long
to know if peer supports reconf_enable, the value is set if ext params have reconf chunk support when processing init chunk, just as rfc6525 section 5.1.1 demands. Signed-off-by: Xin Long <lucien@gmail.com> --- include/net/netns/sctp.h | 3 +++ include/net/sctp/structs.h | 7 +-

[PATCH net-next 15/27] sctp: add rfc6525 section 5.1.4 and 6.3.3

2017-01-01 Thread Xin Long
This patch is to implement Sender-Side Procedures for the SSN/TSN Reset Request Parameter descibed in section 5.1.4. It is also to add sockopt SCTP_RESET_ASSOC in section 6.3.3 for users. Signed-off-by: Xin Long <lucien@gmail.com> --- include/uapi/linux/sctp.h | 1 + net/sctp/so

[PATCH net-next 14/27] sctp: add rfc6525 section 5.1.2-5.1.3 and 6.3.2

2017-01-01 Thread Xin Long
reconf request chunk on the fly as section 5.1.1 demands. Signed-off-by: Xin Long <lucien@gmail.com> --- include/net/sctp/structs.h | 1 + include/uapi/linux/sctp.h | 11 ++ net/sctp/outqueue.c| 33 +++- net/sctp/socket.c

[PATCH net-next 17/27] sctp: add rfc6525 section 6.1.1

2017-01-01 Thread Xin Long
This patch is to add Stream Reset Event described in section 6.1.1. It's added earlier here so that the codes for other sections could invoked them. Signed-off-by: Xin Long <lucien@gmail.com> --- include/net/sctp/ulpevent.h | 4 include/uapi/linux/sctp.h

[PATCH net-next 12/27] sctp: add get and set sockopt for reconf_enable

2017-01-01 Thread Xin Long
This patchset is to add SCTP_RECONFIG_SUPPORTED sockopt, it would set and get asoc reconf_enable value when asoc_id is set, or it would set and get ep reconf_enalbe value if asoc_id is 0. Signed-off-by: Xin Long <lucien@gmail.com> --- include/uapi/linux/sctp.h | 1 + net/sctp/so

[PATCH net-next 05/27] sctp: add rfc6525 section 4.1-4.2

2017-01-01 Thread Xin Long
as section 3.1-3 describes, it makes them in one function. Signed-off-by: Xin Long <lucien@gmail.com> --- include/linux/sctp.h | 26 ++ include/net/sctp/sm.h | 5 ++- include/net/sctp/structs.h | 3 ++ net/sctp/associola.c | 1 + net/sctp/sm_make_chunk.c

[PATCH net-next 06/27] sctp: add rfc6525 section 4.3

2017-01-01 Thread Xin Long
This patch is to define SSN/TSN Reset Request Parameter described in section 4.3. Signed-off-by: Xin Long <lucien@gmail.com> --- include/linux/sctp.h | 5 + include/net/sctp/sm.h| 2 ++ net/sctp/sm_make_chunk.c | 29 + 3 files changed, 36 inse

[PATCH net-next 03/27] sctp: remove asoc ssnmap and ssnmap.c

2017-01-01 Thread Xin Long
Since asoc stream arrays has replaced ssnmap, ssnmap is not used any more, this patch is to remove asoc ssnmap and ssnmap.c. Signed-off-by: Xin Long <lucien@gmail.com> --- include/net/sctp/sctp.h| 1 - include/net/sctp/structs.h | 33 net/sctp/Makefile

[PATCH net-next 04/27] sctp: add rfc6525 section 3.1

2017-01-01 Thread Xin Long
This patch is to define the reconf chunk as the section 3.1 descibes. Signed-off-by: Xin Long <lucien@gmail.com> --- include/linux/sctp.h | 6 ++ net/sctp/sm_make_chunk.c | 33 + 2 files changed, 39 insertions(+) diff --git a/include/linux/sc

[PATCH net-next 01/27] sctp: add stream arrays in asoc

2017-01-01 Thread Xin Long
This patch is to add streamout and streamin arrays in asoc, initialize them in sctp_process_init and free them in sctp_association_free. Stream arrays are used to replace ssnmap to save more stream things in the next patch. Signed-off-by: Xin Long <lucien@gmail.com> --- include/ne

[PATCH net-next 02/27] sctp: replace ssnmap with asoc stream arrays

2017-01-01 Thread Xin Long
Stream arrays are used to save per stream information, which includes ssn for each stream already. This patch is to replace ssnmap with asoc stream arrays. Signed-off-by: Xin Long <lucien@gmail.com> --- include/net/sctp/structs.h | 19 ++- net/sctp/associola.c

[PATCH net-next 00/27] sctp: implement rfc6525 sctp stream reconf

2017-01-01 Thread Xin Long
on both sender and receiver sides (Section 5) add sockopts and event for users (Section 6) Patch 26-27 add reconf event, activate the sctp stream reconf process. Xin Long (27): sctp: add stream arrays in asoc sctp: replace ssnmap with asoc stream arrays sctp: remove asoc ssnmap

[PATCHv2 net] netfilter: check duplicate config when initializing in ipt_CLUSTERIP

2016-12-20 Thread Xin Long
roc file node creation is done. v1->v2: correct the err clusterip_config_init returns. Suggested-by: Marcelo Ricardo Leitner <marcelo.leit...@gmail.com> Signed-off-by: Xin Long <lucien@gmail.com> --- net/ipv4/netfilter/ipt_CLUSTERIP.c | 34 +++---

Re: [PATCH net] netfilter: check duplicate config when initializing in ipt_CLUSTERIP

2016-12-20 Thread Xin Long
On Tue, Dec 20, 2016 at 8:48 AM, Pablo Neira Ayuso <pa...@netfilter.org> wrote: > On Thu, Dec 15, 2016 at 12:31:40PM +0800, Xin Long wrote: >> @@ -185,6 +186,17 @@ clusterip_config_init(const struct >> ipt_clusterip_tgt_info *i, __be32 ip, >> atomic_set(>ref

[PATCHv2 net 2/2] sctp: not copying duplicate addrs to the assoc's bind address list

2016-12-19 Thread Xin Long
may remove an addr that still exists in another NIC. Signed-off-by: Xin Long <lucien@gmail.com> --- net/sctp/bind_addr.c | 3 +++ net/sctp/protocol.c | 3 +++ 2 files changed, 6 insertions(+) diff --git a/net/sctp/bind_addr.c b/net/sctp/bind_addr.c index 401c607..1ebc184 100644 ---

[PATCHv2 net 0/2] fix the issue that may copy duplicate addrs into assoc's bind address list

2016-12-19 Thread Xin Long
Patch 1/2 is to fix some indent level. Given that we have kernels out there with this issue, patch 2/2 also fix sctp_raw_to_bind_addrs. v1 -> v2: Explain why we didn't filter the duplicate addresses when global address list gets updated in patch 2/2 changelog. Xin Long (2): sctp: red

[PATCHv2 net 1/2] sctp: reduce indent level in sctp_copy_local_addr_list

2016-12-19 Thread Xin Long
This patch is to reduce indent level by using continue when the addr is not allowed, and also drop end_copy by using break. Signed-off-by: Xin Long <lucien@gmail.com> --- net/sctp/protocol.c | 37 +++-- 1 file changed, 19 insertions(+), 18 deletions(-)

Re: [PATCH net 2/2] sctp: not copying duplicate addrs to the assoc's bind address list

2016-12-17 Thread Xin Long
On Wed, Aug 24, 2016 at 6:38 PM, Neil Horman <nhor...@tuxdriver.com> wrote: > On Wed, Aug 24, 2016 at 01:14:27PM +0800, Xin Long wrote: >> >> > Ah, I see what you're doing. Ok, this makes some sense, at least on >> >> > the receive >> >>

[PATCH net] sctp: sctp_transport_lookup_process should rcu_read_unlock when transport is null

2016-12-15 Thread Xin Long
: fix the issue sctp_diag uses lock_sock in rcu_read_lock") Signed-off-by: Xin Long <lucien@gmail.com> --- net/sctp/socket.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/net/sctp/socket.c b/net/sctp/socket.c index d5f4b4a..318c678 100644 --- a/net/sctp/so

[PATCH net] sctp: sctp_epaddr_lookup_transport should be protected by rcu_read_lock

2016-12-15 Thread Xin Long
st interface on sctp transport rhashtable") Reported-by: Dmitry Vyukov <dvyu...@google.com> Signed-off-by: Xin Long <lucien@gmail.com> --- net/sctp/endpointola.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/net/sctp/endpointola.c b/net/sctp/endpoi

[PATCH net] netfilter: check duplicate config when initializing in ipt_CLUSTERIP

2016-12-14 Thread Xin Long
one. Suggested-by: Marcelo Ricardo Leitner <marcelo.leit...@gmail.com> Signed-off-by: Xin Long <lucien@gmail.com> --- net/ipv4/netfilter/ipt_CLUSTERIP.c | 26 +++--- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/net/ipv4/netfilter/ipt_CLUSTERI

Re: sctp: suspicious rcu_dereference_check() usage in sctp_epaddr_lookup_transport

2016-12-14 Thread Xin Long
On Wed, Dec 14, 2016 at 5:37 AM, Marcelo Ricardo Leitner wrote: > On Tue, Dec 13, 2016 at 07:07:01PM +0100, Dmitry Vyukov wrote: >> Hello, >> >> I am getting the following reports while running syzkaller fuzzer: >> >> [ INFO: suspicious RCU usage. ] >> 4.9.0+ #85 Not

Re: [PATCHv2 net] team: team_port_add should check link_up before enable port

2016-12-06 Thread Xin Long
k_watch is ethtool. >> >>This patch is to enable the port only when the port_dev has carrier in >>team_port_add. >> >>v1 -> v2: >> use netif_carrier_ok() instead of !!netif_carrier_ok(), as it returns >> bool now. >> >>Signed-off-by: X

[PATCHv2 net] team: team_port_add should check link_up before enable port

2016-12-05 Thread Xin Long
ned-off-by: Xin Long <lucien@gmail.com> --- drivers/net/team/team.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/net/team/team.c b/drivers/net/team/team.c index a380649..4bc0103 100644 --- a/drivers/net/team/team.c +++ b/drivers/net/team/team.c @

Re: [PATCH net] team: team_port_add should check link_up before enable port

2016-12-05 Thread Xin Long
On Sat, Dec 3, 2016 at 10:57 PM, Marcelo Ricardo Leitner <marcelo.leit...@gmail.com> wrote: > On Sat, Dec 03, 2016 at 09:42:11PM +0800, Xin Long wrote: >> Now when users add a nic to team dev, the option 'enable' of the port >> is true by default, as team_port_enable enab

[PATCH net] team: team_port_add should check link_up before enable port

2016-12-03 Thread Xin Long
if this port was chosen to connect, and has no chance to change to use other ports if link_watch is ethtool. This patch is to enable the port only when the port_dev has carrier in team_port_add. Signed-off-by: Xin Long <lucien@gmail.com> --- drivers/net/team/team.c | 8 ++--

Re: net/sctp: BUG: KASAN: stack-out-of-bounds in memcmp

2016-11-20 Thread Xin Long
On Sat, Nov 12, 2016 at 6:12 PM, Baozeng Ding <splovi...@gmail.com> wrote: > > > On 2016/11/10 13:48, Xin Long wrote: >> On Sat, Oct 15, 2016 at 4:28 PM, Baozeng Ding <splovi...@gmail.com> wrote: >>> Hello Xin Long, >>> >>> On 2016/10/14 19:13

Re: [PATCH net] sctp: use new rhlist interface on sctp transport rhashtable

2016-11-16 Thread Xin Long
On Wed, Nov 16, 2016 at 2:04 AM, Neil Horman <nhor...@tuxdriver.com> wrote: > On Tue, Nov 15, 2016 at 11:23:11PM +0800, Xin Long wrote: >> Now sctp transport rhashtable uses hash(lport, dport, daddr) as the key >> to hash a node to one chain. If in one host thousands of ass

[PATCH net] sctp: use new rhlist interface on sctp transport rhashtable

2016-11-15 Thread Xin Long
into a list then makes this list be as a node of the chain. This patch is to replace rhashtable_ interface with rhltable_ interface. Since a chain would not be too long and it would not return -EBUSY with this fix when inserting a node, the reinsert loop is also removed here. Signed-off-by: Xin Long <luc

[PATCH net] sctp: change sk state only when it has assocs in sctp_shutdown

2016-11-13 Thread Xin Long
shutdown is received") Reported-by: Andrey Konovalov <andreyk...@google.com> Tested-by: Andrey Konovalov <andreyk...@google.com> Signed-off-by: Xin Long <lucien@gmail.com> --- net/sctp/socket.c | 15 +++ 1 file changed, 7 insertions(+), 8 deletions(-) diff --git

Re: net/sctp: null-ptr-deref in sctp_inet_listen

2016-11-08 Thread Xin Long
On Wed, Nov 9, 2016 at 2:46 AM, Andrey Konovalov <andreyk...@google.com> wrote: > Hi Xin, > > Your patch seems to be fixing the issue. > > Tested-by: Andrey Konovalov <andreyk...@google.com> > > Thanks! > > On Tue, Nov 8, 2016 at 11:06 AM, Xin Long <luc

Re: net/sctp: null-ptr-deref in sctp_inet_listen

2016-11-08 Thread Xin Long
On Tue, Nov 8, 2016 at 5:44 AM, Andrey Konovalov wrote: > Hi, > > I've got the following error report while running the syzkaller fuzzer: > > kasan: CONFIG_KASAN_INLINE enabled > kasan: GPF could be caused by NULL-ptr deref or user memory access > general protection fault:

Re: rhashtable: how to use insecure_elasticity of rhashtable_params

2016-11-08 Thread Xin Long
On Mon, Nov 7, 2016 at 3:55 PM, Herbert Xu <herb...@gondor.apana.org.au> wrote: > On Sun, Nov 06, 2016 at 09:15:07PM +0800, Xin Long wrote: >> Now when I don't set insecure_elasticity, ht->elasticity would be >> set 16, it would be checked in the loop of

rhashtable: how to use insecure_elasticity of rhashtable_params

2016-11-06 Thread Xin Long
Now when I don't set insecure_elasticity, ht->elasticity would be set 16, it would be checked in the loop of __rhashtable_insert_fast and rhashtable_lookup_one. But if I set insecure_elasticity = true, ht->elasticity wouldn't be set (and the default is 0). when it is checked in that loop.

Re: [PATCH net] sctp: assign assoc_id earlier in __sctp_connect

2016-11-04 Thread Xin Long
trust on that number in such situations > anyway. > > This issue doesn't exist in sctp_sendmsg() path. > > Reported-by: Dmitry Vyukov <dvyu...@google.com> > Reported-by: Andrey Konovalov <andreyk...@google.com> > Tested-by: Andrey Konovalov <andreyk...@google.com> >

[PATCH net-next] sctp: clean up sctp_packet_transmit

2016-10-31 Thread Xin Long
head skb early if it fails to pack packet. Signed-off-by: Xin Long <lucien@gmail.com> --- net/sctp/output.c | 435 -- 1 file changed, 158 insertions(+), 277 deletions(-) diff --git a/net/sctp/output.c b/net/sctp/output.c index 7

[PATCHv2 net 3/3] sctp: hold transport instead of assoc when lookup assoc in rx path

2016-10-31 Thread Xin Long
nsport instead of assoc. As holding transport can make sure to access assoc is also safe, and actually it looks up assoc by searching transport rhashtable, to hold transport here makes more sense. Note that the function will be renamed later on on another patch. Signed-off-by: Xin Long <lucien@

[PATCHv2 net 1/3] sctp: hold transport instead of assoc in sctp_diag

2016-10-31 Thread Xin Long
is to hold transport instead of assoc there. Fixes: 1cceda784980 ("sctp: fix the issue sctp_diag uses lock_sock in rcu_read_lock") Signed-off-by: Xin Long <lucien@gmail.com> --- net/sctp/socket.c | 5 + 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/ne

[PATCHv2 net 2/3] sctp: return back transport in __sctp_rcv_init_lookup

2016-10-31 Thread Xin Long
unk->transport with null instead. This patch is to return the transport back through transport pointer that is from __sctp_rcv_lookup_harder(). Signed-off-by: Xin Long <lucien@gmail.com> --- net/sctp/input.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/net/sctp/i

[PATCHv2 net 0/3] sctp: a bunch of fixes by holding transport

2016-10-31 Thread Xin Long
There are several places where it holds assoc after getting transport by searching from transport rhashtable, it may cause use-after-free issue. This patchset is to fix them by holding transport instead. v1->v2: Fix the changelog of patch 2/3 Xin Long (3): sctp: hold transport inst

Re: [PATCHv2 net] sctp: return back transport in __sctp_rcv_init_lookup

2016-10-31 Thread Xin Long
On Mon, Oct 31, 2016 at 6:51 PM, Marcelo Ricardo Leitner <marcelo.leit...@gmail.com> wrote: > On Mon, Oct 31, 2016 at 12:42:35AM +0800, Xin Long wrote: >> Prior to this patch, it used a local variable to save the transport that is >> looked up by __sctp_lookup_association

[PATCHv2 net] sctp: return back transport in __sctp_rcv_init_lookup

2016-10-30 Thread Xin Long
unk->transport with null instead. This patch is to return the transport back through transport pointer that is from __sctp_rcv_lookup_harder(). Signed-off-by: Xin Long <lucien@gmail.com> --- net/sctp/input.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/net/sctp/i

Re: [PATCH net 2/3] sctp: return back transport in __sctp_rcv_init_lookup

2016-10-29 Thread Xin Long
On Sat, Oct 29, 2016 at 5:39 AM, Marcelo Ricardo Leitner <marcelo.leit...@gmail.com> wrote: > On Fri, Oct 28, 2016 at 05:42:21PM -0200, Marcelo Ricardo Leitner wrote: >> On Fri, Oct 28, 2016 at 06:10:53PM +0800, Xin Long wrote: >> > Prior to this patch, it used

[PATCH net] ipv6: add mtu lock check in __ip6_rt_update_pmtu

2016-10-28 Thread Xin Long
<han...@stressinduktion.org> Signed-off-by: Xin Long <lucien@gmail.com> --- net/ipv6/route.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/net/ipv6/route.c b/net/ipv6/route.c index 947ed1d..7403d90 100644 --- a/net/ipv6/route.c +++ b/net/ipv6/route.c @@ -1364,6 +1364,9 @@

[PATCH net 3/3] sctp: hold transport instead of assoc when lookup assoc in rx path

2016-10-28 Thread Xin Long
nsport instead of assoc. As holding transport can make sure to access assoc is also safe, and actually it looks up assoc by searching transport rhashtable, to hold transport here makes more sense. Note that the function will be renamed later on on another patch. Signed-off-by: Xin Long <lucien@

[PATCH net 2/3] sctp: return back transport in __sctp_rcv_init_lookup

2016-10-28 Thread Xin Long
value instead. This patch is to return the transport back through transport pointer that is from __sctp_rcv_lookup_harder(). Signed-off-by: Xin Long <lucien@gmail.com> --- net/sctp/input.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/net/sctp/input.c b/net/

[PATCH net 1/3] sctp: hold transport instead of assoc in sctp_diag

2016-10-28 Thread Xin Long
is to hold transport instead of assoc there. Fixes: 1cceda784980 ("sctp: fix the issue sctp_diag uses lock_sock in rcu_read_lock") Signed-off-by: Xin Long <lucien@gmail.com> --- net/sctp/socket.c | 5 + 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/ne

[PATCH net 0/3] sctp: a bunch of fixes by holding transport

2016-10-28 Thread Xin Long
There are several places where it holds assoc after getting transport by searching from transport rhashtable, it may cause use-after- free issue. This patchset is to fix them by holding transport instead. Xin Long (3): sctp: hold transport instead of assoc in sctp_diag sctp: return back

Re: [PATCH net] sctp: validate chunk len before actually using it

2016-10-25 Thread Xin Long
gt; > Tested-by: Andrey Konovalov <andreyk...@google.com> > Signed-off-by: Marcelo Ricardo Leitner <marcelo.leit...@gmail.com> Reviewed-by: Xin Long <lucien@gmail.com>

Re: send/sendmsg ENOMEM errors WAS(Re: [PATCH net 6/6] sctp: not return ENOMEM err back in sctp_packet_transmit

2016-10-25 Thread Xin Long
>> in case [1], user can't see the ENOMEM, ENOMEM is more like >> a internal err. >> > > Still not clear. Are you saying, say an old kernel like 3.11 would > not return the user ENOMEN for the use case[1] you fixed? I am not > talking post your fix. Sorry for confusing you. 3.11 would return the

Re: send/sendmsg ENOMEM errors WAS(Re: [PATCH net 6/6] sctp: not return ENOMEM err back in sctp_packet_transmit

2016-10-24 Thread Xin Long
[1] >> This patch doesn't ignore all the ENOMEN cases, only after msg is >> enqueued in out queue/send queue, in the lower layer, when alloc >> new skb and copy data from old skb, if it fails to alloc new skb, sctp >> will ignore this ENOMEM, as this msg will be taken care by retransmit >>

Re: send/sendmsg ENOMEM errors WAS(Re: [PATCH net 6/6] sctp: not return ENOMEM err back in sctp_packet_transmit

2016-10-23 Thread Xin Long
> I think the specific use case this patch addresses > seems to have bitten us in an older kernel sctp (3.11?). > A send() on a loaded network box caused the skb to > alloc in what appears to be this code path and fail (problem > is intermittent, so not 100% sure). errno seen was ENOMEM. >

[PATCH net] sctp: fix the panic caused by route update

2016-10-23 Thread Xin Long
be updated and dropping this packet if it's size exceed PMTU. Fixes: 90017accff61 ("sctp: Add GSO support") Signed-off-by: Xin Long <lucien@gmail.com> --- net/sctp/output.c | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/net/sctp/output.c b/net/sctp/outpu

Re: net/sctp: BUG: KASAN: stack-out-of-bounds in memcmp

2016-10-14 Thread Xin Long
On Sat, Aug 20, 2016 at 3:51 PM, Baozeng Ding wrote: > Hello all, > The following program triggers stack-out-of-bounds in memcmp. The kernel > version is 4.8.0-rc1+ (on Aug 13 commit > 118253a593bd1c57de2d1193df1ccffe1abe745b). Thanks. ... > > #define _GNU_SOURCE >

<    4   5   6   7   8   9   10   11   12   >