Re: SCTP MSG_MORE code

2017-03-21 Thread Xin Long
On Tue, Mar 21, 2017 at 1:49 AM, David Laight wrote: > Something needs to be done with SCTP MSG_MORE before the end of the rc cycle. > The current code is definitely broken. agreed. > > I objected to the last 'fix' patch because it clears the flag is a place where > I

Re: [PATCHv2 net-next 2/7] sctp: implement receiver-side procedures for the SSN/TSN Reset Request Parameter

2017-03-20 Thread Xin Long
On Tue, Mar 21, 2017 at 2:04 AM, Marcelo Ricardo Leitner <marcelo.leit...@gmail.com> wrote: > On Fri, Mar 10, 2017 at 12:11:07PM +0800, Xin Long wrote: >> This patch is to implement Receiver-Side Procedures for the SSN/TSN >> Reset Request Parameter described in

Re: [PATCH net] sctp: declare struct sctp_stream before using it

2017-03-20 Thread Xin Long
On Mon, Mar 20, 2017 at 9:29 PM, Neil Horman <nhor...@tuxdriver.com> wrote: > On Mon, Mar 20, 2017 at 05:46:27PM +0800, Xin Long wrote: >> sctp_stream_free uses struct sctp_stream as a param, but struct sctp_stream >> is defined after it's declaration. >> >>

Re: [PATCH] net: veth: use new api ethtool_{get|set}_link_ksettings

2017-03-20 Thread Xin Long
On Sat, Mar 18, 2017 at 7:13 PM, Philippe Reynes wrote: > The ethtool api {get|set}_settings is deprecated. > We move this driver to new api {get|set}_link_ksettings. > > Signed-off-by: Philippe Reynes > --- > drivers/net/veth.c | 22

[PATCH net] sctp: remove useless err from sctp_association_init

2017-03-20 Thread Xin Long
This patch is to remove the unnecessary temporary variable 'err' from sctp_association_init. Signed-off-by: Xin Long <lucien@gmail.com> --- net/sctp/associola.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/net/sctp/associola.c b/net/sctp/associola.c index 2

[PATCH net] sctp: declare struct sctp_stream before using it

2017-03-20 Thread Xin Long
sctp_stream_free uses struct sctp_stream as a param, but struct sctp_stream is defined after it's declaration. This patch is to declare struct sctp_stream before sctp_stream_free. Fixes: a83863174a61 ("sctp: prepare asoc stream for stream reconf") Signed-off-by: Xin Long <lucien.

Re: [PATCH net] sctp: remove temporary variable confirm from sctp_packet_transmit

2017-03-18 Thread Xin Long
On Sat, Mar 18, 2017 at 7:48 PM, Julian Anastasov <j...@ssi.bg> wrote: > > Hello, > > On Sat, 18 Mar 2017, Xin Long wrote: > >> Commit c86a773c7802 ("sctp: add dst_pending_confirm flag") introduced >> a temporary variable "confirm"

[PATCH net] sctp: out_qlen should be updated when pruning unsent queue

2017-03-18 Thread Xin Long
This patch is to fix the issue that sctp_prsctp_prune_sent forgot to update q->out_qlen when removing a chunk from unsent queue. Fixes: 8dbdf1f5b09c ("sctp: implement prsctp PRIO policy") Signed-off-by: Xin Long <lucien@gmail.com> --- net/sctp/outqueue.c | 11 +--

[PATCH net] sctp: remove temporary variable confirm from sctp_packet_transmit

2017-03-18 Thread Xin Long
remove it and use tp->dst_pending_confirm directly. Fixes: c86a773c7802 ("sctp: add dst_pending_confirm flag") Signed-off-by: Xin Long <lucien@gmail.com> --- net/sctp/output.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/net/sctp/output.c b/net/sctp/output.c

[PATCH net] sctp: define dst_pending_confirm as a bit in sctp_transport

2017-03-18 Thread Xin Long
As tp->dst_pending_confirm's value can only be set 0 or 1, this patch is to change to define it as a bit instead of __u32. Signed-off-by: Xin Long <lucien@gmail.com> --- include/net/sctp/structs.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include

Re: [4.10+] sctp lockdep trace

2017-03-13 Thread Xin Long
>> > [ 245.549402] ? import_iovec+0x3a/0xe0 >> > [ 245.557679] inet_sendmsg+0x49/0x1e0 >> > [ 245.565887] ___sys_sendmsg+0x2d4/0x300 >> > [ 245.574092] ? debug_smp_processor_id+0x17/0x20 >> > [ 245.582342] ? debug_smp_processor_id+0x17/0x20 &g

Re: [PATCH net] ipv6: make ECMP route replacement less greedy

2017-03-13 Thread Xin Long
ev eth1 nexthop via fe80::6 dev eth2 > > echo "after replace, only 2 routes, metric 2048 is gone" > ip -net ns1 -6 r | grep -v '^fe80\|^ff00' > > Fixes: 27596472473a ("ipv6: fix ECMP route replacement") > Signed-off-by: Sabrina Dubroca <s...@queasysnail.net> Reviewed-by: Xin Long <lucien@gmail.com>

Re: [PATCHv2 net-next 0/7] sctp: add receiver-side procedures for stream reconf asoc reset and add streams and response

2017-03-09 Thread Xin Long
On Fri, Mar 10, 2017 at 12:11 PM, Xin Long <lucien@gmail.com> wrote: > Patch 2/7, 4/7, 5/7, 6/7 are to implement the process of asoc reset request, > add streams requests and all kinds of responses. > > Patch 1/7 and 3/7 are ahead of 2/7 and 4/7 to add two event notificatio

[PATCHv2 net-next 5/7] sctp: implement receiver-side procedures for the Add Incoming Streams Request Parameter

2017-03-09 Thread Xin Long
. Signed-off-by: Xin Long <lucien@gmail.com> --- include/net/sctp/sm.h | 4 +++ net/sctp/sm_statefuns.c | 3 ++ net/sctp/stream.c | 74 + 3 files changed, 69 insertions(+), 12 deletions(-) diff --git a/include/net/sctp/sm.h b/i

[PATCHv2 net-next 6/7] sctp: implement receiver-side procedures for the Reconf Response Parameter

2017-03-09 Thread Xin Long
-by: Xin Long <lucien@gmail.com> --- include/net/sctp/sm.h | 4 ++ net/sctp/sm_statefuns.c | 6 +- net/sctp/stream.c | 154 3 files changed, 161 insertions(+), 3 deletions(-) diff --git a/include/net/sctp/sm.h b/include/net/sct

[PATCHv2 net-next 4/7] sctp: implement receiver-side procedures for the Add Outgoing Streams Request Parameter

2017-03-09 Thread Xin Long
This patch is to add Receiver-Side Procedures for the Add Outgoing Streams Request Parameter described in section 5.2.5. It is also to improve sctp_chunk_lookup_strreset_param, so that it can be used for processing addstrm_out request. Signed-off-by: Xin Long <lucien@gmail.com> --- i

[PATCHv2 net-next 7/7] sctp: add get and set sockopt for reconf_enable

2017-03-09 Thread Xin Long
, stream reconf will work. Signed-off-by: Xin Long <lucien@gmail.com> --- include/uapi/linux/sctp.h | 1 + net/sctp/socket.c | 81 +++ net/sctp/sysctl.c | 7 3 files changed, 89 insertions(+) diff --git a/include/uapi

[PATCHv2 net-next 3/7] sctp: add support for generating add stream change event notification

2017-03-09 Thread Xin Long
This patch is to add Stream Change Event described in rfc6525 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 c

[PATCHv2 net-next 1/7] sctp: add support for generating assoc reset event notification

2017-03-09 Thread Xin Long
This patch is to add Association Reset Event described in rfc6525 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

[PATCHv2 net-next 2/7] sctp: implement receiver-side procedures for the SSN/TSN Reset Request Parameter

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

[PATCHv2 net-next 0/7] sctp: add receiver-side procedures for stream reconf asoc reset and add streams and response

2017-03-09 Thread Xin Long
5/7. - adjust the process of addstrm in resp to fit in the codes that only alloc streams through addstrm outreq in patch 6/7. Xin Long (7): sctp: add support for generating assoc reset event notification sctp: implement receiver-side procedures for the SSN/TSN Reset Request Parameter s

Re: [PATCH net] sctp: change to save MSG_MORE flag into assoc

2017-03-07 Thread Xin Long
On Sat, Mar 4, 2017 at 12:51 PM, Xin Long <lucien@gmail.com> wrote: > On Sat, Mar 4, 2017 at 1:57 AM, Xin Long <lucien@gmail.com> wrote: >> On Sat, Mar 4, 2017 at 12:31 AM, David Laight <david.lai...@aculab.com> >> wrote: >>> Fro

Re: [PATCH net] sctp: change to save MSG_MORE flag into assoc

2017-03-03 Thread Xin Long
On Sat, Mar 4, 2017 at 1:57 AM, Xin Long <lucien@gmail.com> wrote: > On Sat, Mar 4, 2017 at 12:31 AM, David Laight <david.lai...@aculab.com> wrote: >> From: Xin Long >>> Sent: 03 March 2017 15:43 >> ... >>> > It is much more important to get

Re: [PATCH net] sctp: change to save MSG_MORE flag into assoc

2017-03-03 Thread Xin Long
On Sat, Mar 4, 2017 at 12:31 AM, David Laight <david.lai...@aculab.com> wrote: > From: Xin Long >> Sent: 03 March 2017 15:43 > ... >> > It is much more important to get MSG_MORE working 'properly' for SCTP >> > than for TCP. For TCP an application can alw

Re: [PATCH net] sctp: change to save MSG_MORE flag into assoc

2017-03-03 Thread Xin Long
On Fri, Mar 3, 2017 at 8:49 PM, David Laight <david.lai...@aculab.com> wrote: > From: Xin Long >> Sent: 03 March 2017 06:24 >> David Laight noticed the support for MSG_MORE with datamsg->force_day >> didn't really work as we expected, as the first msg with MSG_

[PATCH net] sctp: change to save MSG_MORE flag into assoc

2017-03-02 Thread Xin Long
t would make sctp's MSG_MORE work as tcp's. Fixes: 4ea0c32f5f42 ("sctp: add support for MSG_MORE") Signed-off-by: Xin Long <lucien@gmail.com> --- include/net/sctp/structs.h | 2 +- net/sctp/output.c | 2 +- net/sctp/socket.c | 3 ++- 3 files changed, 4 inserti

Re: net/sctp: use-after-free in sctp_association_put

2017-03-02 Thread Xin Long
On Fri, Mar 3, 2017 at 3:21 AM, Dmitry Vyukov <dvyu...@google.com> wrote: > On Thu, Mar 2, 2017 at 9:06 AM, Xin Long <lucien@gmail.com> wrote: >> On Thu, Mar 2, 2017 at 3:18 AM, Dmitry Vyukov <dvyu...@google.com> wrote: >>> Hello, >>> >>>

Re: net/sctp: use-after-free in sctp_association_put

2017-03-02 Thread Xin Long
On Thu, Mar 2, 2017 at 3:18 AM, Dmitry Vyukov wrote: > Hello, > > I've got the following report while running syzkaller fuzzer on > linux-next/8813198236a044b76e251dcae937b180dd527999: > > BUG: KASAN: use-after-free in sctp_association_destroy > net/sctp/associola.c:416

Re: net/sctp: use-after-free in sctp_hash_transport

2017-02-28 Thread Xin Long
On Tue, Feb 28, 2017 at 11:35 PM, Dmitry Vyukov <dvyu...@google.com> wrote: > On Mon, Feb 27, 2017 at 5:27 PM, Xin Long <lucien@gmail.com> wrote: >> On Mon, Feb 27, 2017 at 11:45 PM, Andrey Konovalov >> <andreyk...@google.com> wrote: >>> Hi, >>

Re: [PATCH net] sctp: call rcu_read_lock before checking for duplicate transport nodes

2017-02-28 Thread Xin Long
On Tue, Feb 28, 2017 at 10:23 PM, Neil Horman <nhor...@tuxdriver.com> wrote: > On Tue, Feb 28, 2017 at 12:41:29PM +0800, Xin Long wrote: >> Commit cd2b70875058 ("sctp: check duplicate node before inserting a >> new transport") called rhltable_lookup() to check for

[PATCH net] sctp: call rcu_read_lock before checking for duplicate transport nodes

2017-02-27 Thread Xin Long
port") Reported-by: Andrey Konovalov <andreyk...@google.com> Signed-off-by: Xin Long <lucien@gmail.com> --- net/sctp/input.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/net/sctp/input.c b/net/sctp/input.c index fc45896..2a28ab2 100644 --- a/net/sctp/input.c +++ b/net/sctp/i

Re: net/sctp: use-after-free in sctp_hash_transport

2017-02-27 Thread Xin Long
On Mon, Feb 27, 2017 at 11:45 PM, Andrey Konovalov wrote: > Hi, > > I've got the following error report while fuzzing the kernel with syzkaller. > > On commit e5d56efc97f8240d0b5d66c03949382b6d7e5570 (Feb 26). > > A reproducer and .config are attached. > >

Re: [PATCH net-next 2/2] sctp: add support for MSG_MORE

2017-02-26 Thread Xin Long
On Sat, Feb 25, 2017 at 4:41 PM, Xin Long <lucien@gmail.com> wrote: > On Fri, Feb 24, 2017 at 6:14 PM, David Laight <david.lai...@aculab.com> wrote: >> >> From: Xin Long >> > Sent: 24 February 2017 06:44 >> ... >> > > IIRC sctp_p

Re: [PATCH net-next 2/2] sctp: add support for MSG_MORE

2017-02-25 Thread Xin Long
On Fri, Feb 24, 2017 at 6:14 PM, David Laight <david.lai...@aculab.com> wrote: > > From: Xin Long > > Sent: 24 February 2017 06:44 > ... > > > IIRC sctp_packet_can_append_data() is called for the first queued > > > data chunk in order to decide whether to

[PATCH net] ipv6: check sk sk_type and protocol early in ip_mroute_set/getsockopt

2017-02-24 Thread Xin Long
ix should be done for ipv6 ipmr as well. This patch can fix the panic caused by overwriting the same offset as ipmr_table as in raw_sk(sk) when accessing other type's socket by ip_mroute_setsockopt(). Signed-off-by: Xin Long <lucien@gmail.com> --- net/ipv6/ip6mr.c | 11 --- 1 file chan

[PATCH net] sctp: set sin_port for addr param when checking duplicate address

2017-02-23 Thread Xin Long
copying duplicate addrs to the assoc's bind address list") Reported-by: Wei Chen <weic...@redhat.com> Signed-off-by: Xin Long <lucien@gmail.com> --- net/sctp/protocol.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/net/sctp/protocol.c b/net/sctp/protocol.

Re: [PATCH net-next 2/2] sctp: add support for MSG_MORE

2017-02-23 Thread Xin Long
On Fri, Feb 24, 2017 at 12:04 AM, David Laight <david.lai...@aculab.com> wrote: > From: Xin Long >> Sent: 23 February 2017 03:46 >> On Tue, Feb 21, 2017 at 10:27 PM, David Laight <david.lai...@aculab.com> >> wrote: >> > From: Xin Long >> >> S

Re: [PATCH net-next 2/2] sctp: add support for MSG_MORE

2017-02-23 Thread Xin Long
On Fri, Feb 24, 2017 at 1:40 AM, Marcelo Ricardo Leitner <marcelo.leit...@gmail.com> wrote: > On Thu, Feb 23, 2017 at 04:04:10PM +, David Laight wrote: >> From: Xin Long >> > Sent: 23 February 2017 03:46 >> > On Tue, Feb 21, 2017 at 10:27 PM, David Laight <

Re: [PATCH net-next 2/2] sctp: add support for MSG_MORE

2017-02-22 Thread Xin Long
On Tue, Feb 21, 2017 at 10:27 PM, David Laight <david.lai...@aculab.com> wrote: > From: Xin Long >> Sent: 18 February 2017 17:53 >> This patch is to add support for MSG_MORE on sctp. >> >> It adds force_delay in sctp_datamsg to save MSG_MORE, and sets it af

[PATCH net-next 2/2] sctp: add support for MSG_MORE

2017-02-18 Thread Xin Long
into SHUTDOWN_PENDING, the close block problem mentioned in [1] has been solved as well. [1] https://patchwork.ozlabs.org/patch/372404/ Signed-off-by: Xin Long <lucien@gmail.com> --- include/net/sctp/structs.h | 1 + net/sctp/output.c | 9 +++-- net/sctp/socket.c | 1 + 3

[PATCH net-next 0/2] sctp: support MSG_MORE flag when sending msg

2017-02-18 Thread Xin Long
This patch is to add support for MSG_MORE on sctp. Patch 1/2 is an improvement ahead of patch 2/2 to solve the close block problem mentioned in https://patchwork.ozlabs.org/patch/372404/. Xin Long (2): sctp: flush out queue once assoc state falls into SHUTDOWN_PENDING sctp: add support

[PATCH net-next 1/2] sctp: flush out queue once assoc state falls into SHUTDOWN_PENDING

2017-02-18 Thread Xin Long
that the chunks with MSG_MORE flag may be stuck in queue when closing an assoc. Signed-off-by: Xin Long <lucien@gmail.com> --- net/sctp/sm_sideeffect.c | 4 1 file changed, 4 insertions(+) diff --git a/net/sctp/sm_sideeffect.c b/net/sctp/sm_sideeffect.c index 51abcc9..25384fa 100644 --- a/ne

Re: [PATCH net] sctp: check duplicate node before inserting a new transport

2017-02-18 Thread Xin Long
On Sat, Feb 18, 2017 at 4:19 AM, David Miller <da...@davemloft.net> wrote: > From: Xin Long <lucien@gmail.com> > Date: Fri, 17 Feb 2017 16:35:24 +0800 > > >> + list = rhltable_lookup(_transport_hashtable, , >> +

Re: [PATCH net] sctp: check duplicate node before inserting a new transport

2017-02-17 Thread Xin Long
On Fri, Feb 17, 2017 at 7:19 PM, Neil Horman <nhor...@tuxdriver.com> wrote: > On Fri, Feb 17, 2017 at 04:35:24PM +0800, Xin Long wrote: >> sctp has changed to use rhlist for transport rhashtable since commit >> 7fda702f9315 ("sctp: use new rhlist interface on sc

[PATCH net-next] sctp: sctp_transport_dst_check should check if transport pmtu is dst mtu

2017-02-17 Thread Xin Long
to update. This patch is to fix this by also checking if transport pmtu is dst mtu in sctp_transport_dst_check, so that transport->pmtu can be updated on time. Signed-off-by: Xin Long <lucien@gmail.com> --- include/net/sctp/sctp.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) di

[PATCH net] sctp: check duplicate node before inserting a new transport

2017-02-17 Thread Xin Long
") Reported-by: Fabio M. Di Nitto <fdini...@redhat.com> Signed-off-by: Xin Long <lucien@gmail.com> --- net/sctp/input.c | 13 + 1 file changed, 13 insertions(+) diff --git a/net/sctp/input.c b/net/sctp/input.c index 458e506..f65245b 100644 --- a/net/sctp/input.c +++

[PATCHv2 net-next 7/7] sctp: add reconf chunk event

2017-02-16 Thread Xin Long
This patch is to add reconf chunk event based on the sctp event frame in rx path, it will call sctp_sf_do_reconf to process the reconf chunk. Signed-off-by: Xin Long <lucien@gmail.com> --- include/net/sctp/constants.h | 3 +++ net/sctp/sm_statetable.c

[PATCHv2 net-next 3/7] sctp: implement receiver-side procedures for the Outgoing SSN Reset Request Parameter

2017-02-16 Thread Xin Long
This patch is to implement Receiver-Side Procedures for the Outgoing SSN Reset Request Parameter described in rfc6525 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

[PATCHv2 net-next 6/7] sctp: add reconf chunk process

2017-02-16 Thread Xin Long
This patch is to add a function to process the incoming reconf chunk, in which it verifies the chunk, and traverses the param and process it with the right function one by one. sctp_sf_do_reconf would be the process function of reconf chunk event. Signed-off-by: Xin Long <lucien@gmail.

[PATCHv2 net-next 4/7] sctp: implement receiver-side procedures for the Incoming SSN Reset Request Parameter

2017-02-16 Thread Xin Long
-off-by: Xin Long <lucien@gmail.com> --- include/net/sctp/sm.h| 4 +++ net/sctp/sm_make_chunk.c | 8 +- net/sctp/stream.c| 70 3 files changed, 75 insertions(+), 7 deletions(-) diff --git a/include/net/sctp/sm.h b/inclu

[PATCHv2 net-next 1/7] sctp: add support for generating stream reconf resp chunk

2017-02-16 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 2/7] sctp: add support for generating stream ssn reset event notification

2017-02-16 Thread Xin Long
This patch is to add Stream Reset Event described in rfc6525 section 6.1.1. Signed-off-by: Xin Long <lucien@gmail.com> --- include/net/sctp/ulpevent.h | 4 include/uapi/linux/sctp.h | 16 net/sctp/ulpevent.c | 29 + 3 files c

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

2017-02-16 Thread Xin Long
h network endian to lookup_strreset_param in 3/7. - move str_list endian conversion out of sctp_make_strreset_req, so that sctp_make_strreset_req can be used more conveniently to process inreq in patch 4/7. - remove sctp_merge_reconf_chunk and not support response with multiparam in patch 6/7. Xin Long

Re: [PATCH net-next] sctp: change to use uint_t in uapi sctp.h

2017-02-16 Thread Xin Long
On Wed, Feb 15, 2017 at 12:26 AM, David Miller <da...@davemloft.net> wrote: > From: Xin Long <lucien@gmail.com> > Date: Tue, 14 Feb 2017 16:23:48 +0800 > >> All structures in uapi sctp.h are exported for userspace, their members' >> types should use uint_t ins

[PATCH net-next] sctp: change to use uint_t in uapi sctp.h

2017-02-14 Thread Xin Long
All structures in uapi sctp.h are exported for userspace, their members' types should use uint_t instead of __u. Signed-off-by: Xin Long <lucien@gmail.com> --- include/uapi/linux/sctp.h | 398 +++--- 1 file changed, 199 insertions(+), 199 del

Re: net/sctp: null-ptr-deref in sctp_put_port/sctp_endpoint_destroy

2017-02-09 Thread Xin Long
On Thu, Feb 9, 2017 at 3:00 AM, Andrey Konovalov wrote: > Hi, > > I've got the following error report while fuzzing the kernel with syzkaller. > > On commit 926af6273fc683cd98cd0ce7bf0d04a02eed6742. > > A reproducer and .config are attached. > > general protection fault:

Re: [PATCHv6 net-next 4/6] sctp: implement sender-side procedures for SSN/TSN Reset Request Parameter

2017-02-08 Thread Xin Long
On Thu, Feb 9, 2017 at 5:50 AM, Marcelo Ricardo Leitner <marcelo.leit...@gmail.com> wrote: > On Wed, Feb 08, 2017 at 07:48:01PM -0200, Marcelo Ricardo Leitner wrote: >> Hi Xin, >> >> On Thu, Feb 09, 2017 at 01:18:18AM +0800, Xin Long wrote: >> > This patch is

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

2017-02-08 Thread Xin Long
On Thu, Feb 9, 2017 at 5:57 AM, Marcelo Ricardo Leitner <marcelo.leit...@gmail.com> wrote: > On Thu, Feb 09, 2017 at 01:18:17AM +0800, Xin Long wrote: >> This patch is to define SSN/TSN Reset Request Parameter described >> in rfc6525 section 4.3. >> >> It's also

[PATCHv6 net-next 4/6] sctp: implement sender-side procedures for SSN/TSN Reset Request Parameter

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

[PATCHv6 net-next 2/6] sctp: streams should be recovered when it fails to send request.

2017-02-08 Thread Xin Long
r SSN Reset Request Parameter") Signed-off-by: Xin Long <lucien@gmail.com> --- net/sctp/stream.c | 19 +-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/net/sctp/stream.c b/net/sctp/stream.c index 13d5e07..6a686e3 100644 --- a/net/sctp/stream.c +++ b/n

[PATCHv6 net-next 5/6] sctp: add support for generating stream reconf add incoming/outgoing streams request chunk

2017-02-08 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

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

2017-02-08 Thread Xin Long
This patch is to define SSN/TSN Reset Request Parameter described in rfc6525 section 4.3. It's also to drop some unnecessary __packed in include/linux/sctp.h. Signed-off-by: Xin Long <lucien@gmail.com> --- include/linux/sctp.h | 5 + include/net/sctp/sm.h| 2 ++ ne

[PATCHv6 net-next 6/6] sctp: implement sender-side procedures for Add Incoming/Outgoing Streams Request Parameter

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

[PATCHv6 net-next 1/6] sctp: drop unnecessary __packed from some stream reconf structures

2017-02-08 Thread Xin Long
commit 85c727b59483 ("sctp: drop __packed from almost all SCTP structures") has removed __packed from almost all SCTP structures. But there still are three structures where it should be dropped. This patch is to remove it from some stream reconf structures. Signed-off-by: Xin Lo

[PATCHv6 net-next 0/6] sctp: add sender-side procedures for stream reconf asoc reset and add streams

2017-02-08 Thread Xin Long
ove ksize check in patch 6/6, as ksize check is acutally used in krealloc already. Xin Long (6): sctp: drop unnecessary __packed from some stream reconf structures sctp: streams should be recovered when it fails to send request. sctp: add support for generating stream reconf ssn/tsn reset re

Re: [PATCH net] sctp: avoid BUG_ON on sctp_wait_for_sndbuf

2017-02-07 Thread Xin Long
place. > > Acked-by: Alexander Popov <alex.po...@linux.com> > Signed-off-by: Marcelo Ricardo Leitner <marcelo.leit...@gmail.com> > --- > Please consider this to -stable. Thanks > Reviewed-by: Xin Long <lucien@gmail.com> > net/sctp/socket.c | 3 ++- >

[PATCH net] sctp: check af before verify address in sctp_addr_id2transport

2017-02-07 Thread Xin Long
L and NULL pointer dereference will be caused by af->sockaddr_len. This patch is to fix it by returning NULL if af variable is NULL. Fixes: 6f29a1306131 ("sctp: sctp_addr_id2transport should verify the addr before looking up assoc") Signed-off-by: Xin Long <lucien@gmail.com&g

Re: net/sctp: GPF in sctp_addr_id2transport

2017-02-07 Thread Xin Long
On Tue, Feb 7, 2017 at 7:09 PM, Marcelo Ricardo Leitner wrote: > On Tue, Feb 07, 2017 at 10:42:38AM +0100, Dmitry Vyukov wrote: >> Hello, >> >> The following program triggers GPF in sctp_addr_id2transport: >> >> // autogenerated by syzkaller

[PATCH net-next] sctp: process fwd tsn chunk only when prsctp is enabled

2017-02-03 Thread Xin Long
This patch is to check if asoc->peer.prsctp_capable is set before processing fwd tsn chunk, if not, it will return an ERROR to the peer, just as rfc3758 section 3.3.1 demands. Reported-by: Julian Cordes <julian.cor...@gmail.com> Signed-off-by: Xin Long <lucien@gmail.com>

Re: [PATCH net] sctp: sctp_addr_id2transport should verify the addr before looking up assoc

2017-01-25 Thread Xin Long
On Wed, Jan 25, 2017 at 11:27 PM, Vladislav Yasevich <vyasev...@gmail.com> wrote: > On Tue, Jan 24, 2017 at 1:01 AM, Xin Long <lucien@gmail.com> wrote: >> >> sctp_addr_id2transport is a function for sockopt to look up assoc by >> address. As the address is from

Re: [PATCH][V3][net-next] net: sctp: fix array overrun read on sctp_timer_tbl

2017-01-24 Thread Xin Long
t; and suggesting the build time sanity check. > > Fixes CoverityScan CID#1397639 ("Out-of-bounds read") > > Fixes: 7b9438de0cd4 ("sctp: add stream reconf timer") > Signed-off-by: Colin Ian King <colin.k...@canonical.com> Reviewed-by: Xin Long <lucien@gmail.com>

[PATCH net] sctp: sctp gso should set feature with NETIF_F_SG when calling skb_segment

2017-01-23 Thread Xin Long
to fix it by setting features param with NETIF_F_SG when calling skb_segment so that it can go the right branch to process the skb's frag_list. Signed-off-by: Xin Long <lucien@gmail.com> --- net/sctp/offload.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/sctp/offl

[PATCH net] sctp: sctp_addr_id2transport should verify the addr before looking up assoc

2017-01-23 Thread Xin Long
assoc by address. This patch is to fix it by calling sctp_verify_addr in which it can do this conversion before calling sctp_endpoint_lookup_assoc, just like what sctp_sendmsg and __sctp_connect do for the address from users. Signed-off-by: Xin Long <lucien@gmail.com> --- net/sctp/so

[PATCHv5 net-next 1/5] sctp: streams should be recovered when it fails to send request.

2017-01-21 Thread Xin Long
r SSN Reset Request Parameter") Signed-off-by: Xin Long <lucien@gmail.com> --- net/sctp/stream.c | 19 +-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/net/sctp/stream.c b/net/sctp/stream.c index 13d5e07..6a686e3 100644 --- a/net/sctp/stream.c +++ b/n

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

2017-01-21 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

[PATCHv5 net-next 0/5] sctp: add sender-side procedures for stream reconf asoc reset and add streams

2017-01-21 Thread Xin Long
est issue. - doing actual work only when request is sent successfully. - reduce some indents in sctp_send_add_streams. v4->v5: - close streams before sending request and recover them when sending fails in patch 1/5 and patch 3/5 Xin Long (5): sctp: streams should be recovered w

[PATCHv5 net-next 3/5] sctp: implement sender-side procedures for SSN/TSN Reset Request Parameter

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

[PATCHv5 net-next 5/5] sctp: implement sender-side procedures for Add Incoming/Outgoing Streams Request Parameter

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

[PATCHv5 net-next 4/5] sctp: add support for generating stream reconf add incoming/outgoing streams request chunk

2017-01-21 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

[PATCHv4 net-next 5/5] sctp: implement sender-side procedures for Add Incoming/Outgoing Streams Request Parameter

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

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

2017-01-20 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

[PATCHv4 net-next 3/5] sctp: implement sender-side procedures for SSN/TSN Reset Request Parameter

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

[PATCHv4 net-next 4/5] sctp: add support for generating stream reconf add incoming/outgoing streams request chunk

2017-01-20 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

[PATCHv4 net-next 0/5] sctp: add sender-side procedures for stream reconf asoc reset and add streams

2017-01-20 Thread Xin Long
et stream request issue. - doing actual work only when request is sent successfully. - reduce some indents in sctp_send_add_streams. Xin Long (5): sctp: streams should be closed when stream reset request is sent successfully. sctp: add support for generating stream reconf ssn/tsn rese

[PATCHv4 net-next 1/5] sctp: streams should be closed when stream reset request is sent successfully.

2017-01-20 Thread Xin Long
, streams are closed and no packet was even queued. This patch is to fix it by closing streams only when request is sent successfully, it is also to fix a return value. Fixes: 7f9d68ac944e ("sctp: implement sender-side procedures for SSN Reset Request Parameter") Signed-off-by: Xin Lo

Re: [PATCHv3 net-next 4/4] sctp: implement sender-side procedures for Add Incoming/Outgoing Streams Request Parameter

2017-01-20 Thread Xin Long
On Fri, Jan 20, 2017 at 5:47 AM, Marcelo Ricardo Leitner <marcelo.leit...@gmail.com> wrote: > On Fri, Jan 20, 2017 at 01:19:14AM +0800, Xin Long wrote: >> This patch is to implement Sender-Side Procedures for the Add >> Outgoing and Incoming Streams Request Parameter de

Re: [PATCHv3 net-next 4/4] sctp: implement sender-side procedures for Add Incoming/Outgoing Streams Request Parameter

2017-01-20 Thread Xin Long
On Fri, Jan 20, 2017 at 6:15 AM, Marcelo Ricardo Leitner <marcelo.leit...@gmail.com> wrote: > On Fri, Jan 20, 2017 at 01:19:14AM +0800, Xin Long wrote: >> This patch is to implement Sender-Side Procedures for the Add >> Outgoing and Incoming Streams Request Parameter de

[PATCHv3 net-next 4/4] sctp: implement sender-side procedures for Add Incoming/Outgoing Streams Request Parameter

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

[PATCHv3 net-next 3/4] sctp: add support for generating stream reconf add incoming/outgoing streams request chunk

2017-01-19 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

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

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

[PATCHv3 net-next 1/4] sctp: add support for generating stream reconf ssn/tsn reset request chunk

2017-01-19 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

[PATCHv3 net-next 0/4] sctp: add sender-side procedures for stream reconf asoc reset and add streams

2017-01-19 Thread Xin Long
its and improve some changelogs. v2->v3: - re-split the patchset and make sure it has no dead codes for review. - move some codes into stream.c from socket.c. Xin Long (4): sctp: add support for generating stream reconf ssn/tsn reset request chunk sctp: implement sender-side procedures for S

[PATCHv4 net-next 2/6] sctp: add stream reconf timer

2017-01-17 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

[PATCHv4 net-next 1/6] sctp: add support for generating stream reconf ssn reset request chunk

2017-01-17 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 | 27 ++ include/net/sctp/sm.h | 5 +- include/net/sctp/structs.h | 3 ++ net/sctp/associola.c | 1 + net/sctp/sm_make_c

[PATCHv4 net-next 3/6] sctp: add stream reconf primitive

2017-01-17 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

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

2017-01-17 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

[PATCHv4 net-next 5/6] sctp: add sockopt SCTP_ENABLE_STREAM_RESET

2017-01-17 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

[PATCHv4 net-next 4/6] sctp: add reconf_enable in asoc ep and netns

2017-01-17 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 +-

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

2017-01-17 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. v3->v4: - move sctp_make_reconf() into patch 1/6 to avoid kbuild warning. - drop unused struct sctp_strreset_req. Xin Long (6): sctp: add

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

2017-01-16 Thread Xin Long
On Mon, Jan 16, 2017 at 11:56 AM, Xin Long <lucien@gmail.com> wrote: > 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 s

<    3   4   5   6   7   8   9   10   11   12   >