[PATCHv2 net-next 00/11] sctp: remove typedefs from structures part 2

2017-07-16 Thread Xin Long
, No any code's logic would be changed in these patches, only cleaning up. Note that v1->v2, nothing changed, just because net-next were closed when posting v1. Xin Long (11): sctp: remove the typedef sctp_ipv4addr_param_t sctp: remove the typedef sctp_ipv6addr_param_t sctp: remove the type

[PATCH net] sctp: fix an array overflow when all ext chunks are set

2017-07-14 Thread Xin Long
oc ep and netns") Signed-off-by: Xin Long <lucien@gmail.com> --- net/sctp/sm_make_chunk.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/net/sctp/sm_make_chunk.c b/net/sctp/sm_make_chunk.c index 4e16b02..6110447 100644 --- a/net/sctp/sm_make_chunk.c +++

[PATCH net-next 11/11] sctp: remove the typedef sctp_hmac_algo_param_t

2017-07-04 Thread Xin Long
This patch is to remove the typedef sctp_hmac_algo_param_t, and replace with struct sctp_hmac_algo_param 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 <lucien@gmail.com> --- include/linux/sctp.h

[PATCH net-next 05/11] sctp: remove the typedef sctp_supported_addrs_param_t

2017-07-04 Thread Xin Long
This patch is to remove the typedef sctp_supported_addrs_param_t, and replace with struct sctp_supported_addrs_param in the places where it's using this typedef. Signed-off-by: Xin Long <lucien@gmail.com> --- include/linux/sctp.h | 4 ++-- net/sctp/sm_make_chunk.c | 2 +- 2 files c

[PATCH net-next 09/11] sctp: remove the typedef sctp_random_param_t

2017-07-04 Thread Xin Long
This patch is to remove the typedef sctp_random_param_t, and replace with struct sctp_random_param in the places where it's using this typedef. Signed-off-by: Xin Long <lucien@gmail.com> --- include/linux/sctp.h | 4 ++-- include/net/sctp/structs.h | 2 +- net/sctp/

[PATCH net-next 08/11] sctp: remove the typedef sctp_supported_ext_param_t

2017-07-04 Thread Xin Long
This patch is to remove the typedef sctp_supported_ext_param_t, and replace with struct sctp_supported_ext_param 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 <lucien@gmail.com> --- include/linux/

[PATCH net-next 07/11] sctp: remove the typedef sctp_adaptation_ind_param_t

2017-07-04 Thread Xin Long
This patch is to remove the typedef sctp_adaptation_ind_param_t, and replace with struct sctp_adaptation_ind_param in the places where it's using this typedef. Signed-off-by: Xin Long <lucien@gmail.com> --- include/linux/sctp.h | 4 ++-- net/sctp/sm_make_chunk.c | 4 ++-- 2 files c

[PATCH net-next 10/11] sctp: remove the typedef sctp_chunks_param_t

2017-07-04 Thread Xin Long
This patch is to remove the typedef sctp_chunks_param_t, and replace with struct sctp_chunks_param 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 <lucien@gmail.com> --- include/linux/sctp.h

[PATCH net-next 06/11] sctp: remove struct sctp_ecn_capable_param

2017-07-04 Thread Xin Long
Remove it, there is even no places using it. Signed-off-by: Xin Long <lucien@gmail.com> --- include/linux/sctp.h | 5 - 1 file changed, 5 deletions(-) diff --git a/include/linux/sctp.h b/include/linux/sctp.h index 3ca3ab7..7552482 100644 --- a/include/linux/sctp.h +++ b/include

[PATCH net-next 04/11] sctp: remove the typedef sctp_hostname_param_t

2017-07-04 Thread Xin Long
Remove this typedef, there is even no places using it. Signed-off-by: Xin Long <lucien@gmail.com> --- include/linux/sctp.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/linux/sctp.h b/include/linux/sctp.h index d8f9d8f..c43e906 100644 --- a/include

[PATCH net-next 02/11] sctp: remove the typedef sctp_ipv6addr_param_t

2017-07-04 Thread Xin Long
This patch is to remove the typedef sctp_ipv6addr_param_t, and replace with struct sctp_ipv6addr_param in the places where it's using this typedef. Signed-off-by: Xin Long <lucien@gmail.com> --- include/linux/sctp.h | 4 ++-- net/sctp/ipv6.c | 2 +- net/sctp/sm_make_chunk

[PATCH net-next 03/11] sctp: remove the typedef sctp_cookie_preserve_param_t

2017-07-04 Thread Xin Long
This patch is to remove the typedef sctp_cookie_preserve_param_t, and replace with struct sctp_cookie_preserve_param in the places where it's using this typedef. It is also to fix some indents in sctp_sf_do_5_2_6_stale(). Signed-off-by: Xin Long <lucien@gmail.com> --- include/linux/

[PATCH net-next 01/11] sctp: remove the typedef sctp_ipv4addr_param_t

2017-07-04 Thread Xin Long
This patch is to remove the typedef sctp_ipv4addr_param_t, and replace with struct sctp_ipv4addr_param in the places where it's using this typedef. Signed-off-by: Xin Long <lucien@gmail.com> --- include/linux/sctp.h | 6 +++--- net/sctp/protocol.c | 2 +- net/sctp/sm_make_c

[PATCH net-next 00/11] sctp: remove typedefs from structures part 2

2017-07-04 Thread Xin Long
, No any code's logic would be changed in these patches, only cleaning up. Xin Long (11): sctp: remove the typedef sctp_ipv4addr_param_t sctp: remove the typedef sctp_ipv6addr_param_t sctp: remove the typedef sctp_cookie_preserve_param_t sctp: remove the typedef sctp_hostname_param_t sctp

[PATCH net-next 09/11] sctp: remove the typedef sctp_data_chunk_t

2017-06-29 Thread 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 <lucien@gmail.com> --- include/linux/sctp.h | 4 ++-- include/net/sctp/constants.h | 2 +- include/net/sct

[PATCH net-next 08/11] sctp: remove the typedef sctp_datahdr_t

2017-06-29 Thread 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 <lucien@gmail.com> --- include/linux/sctp.h| 6 +++--- ne

[PATCH net-next 11/11] sctp: remove the typedef sctp_init_chunk_t

2017-06-29 Thread Xin Long
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 <lucien@gmail.com> --- include/linux/sctp.h | 6 +++--- include/net/sctp/command.h | 4 ++-- include/net/sctp/str

[PATCH net-next 10/11] sctp: remove the typedef sctp_inithdr_t

2017-06-29 Thread 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 <lucien@gmail.com> --- include/linux/sctp.h| 6 +++--- net/netfilter/nf_conntrack_proto_sctp.c | 4 ++-

[PATCH net-next 06/11] sctp: remove the typedef sctp_param_t

2017-06-29 Thread Xin Long
This patch is to remove the typedef sctp_param_t, and replace with struct sctp_paramhdr in the places where it's using this typedef. It is also to remove the useless declaration sctp_addip_addr_config and fix the lack of params for some other functions' declaration. Signed-off-by: Xin Long

[PATCH net-next 05/11] sctp: remove the typedef sctp_paramhdr_t

2017-06-29 Thread 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 <lucien@gmail.com> --- include/linux/

[PATCH net-next 07/11] sctp: remove the typedef sctp_param_action_t

2017-06-29 Thread Xin Long
Remove this typedef, there is even no places using it. Signed-off-by: Xin Long <lucien@gmail.com> --- include/linux/sctp.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/linux/sctp.h b/include/linux/sctp.h index 5eecc0f..d5c0dda 100644 --- a/include

[PATCH net-next 01/11] sctp: remove the typedef sctp_sctphdr_t

2017-06-29 Thread Xin Long
This patch is to remove the typedef sctp_sctphdr_t, and replace with struct sctphdr 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 <lucien@gmail.com> --- include/linux/

[PATCH net-next 04/11] sctp: remove the typedef sctp_cid_action_t

2017-06-29 Thread Xin Long
Remove this typedef, there is even no places using it. Signed-off-by: Xin Long <lucien@gmail.com> --- include/linux/sctp.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/linux/sctp.h b/include/linux/sctp.h index 6d7b884..ffdccb4 100644 --- a/include

[PATCH net-next 03/11] sctp: remove the typedef sctp_cid_t

2017-06-29 Thread Xin Long
This patch is to remove the typedef sctp_cid_t, and replace with struct sctp_cid in the places where it's using this typedef. Signed-off-by: Xin Long <lucien@gmail.com> --- include/linux/sctp.h | 4 ++-- include/net/sctp/auth.h | 6 -- include/net/sctp/constants

[PATCH net-next 02/11] sctp: remove the typedef sctp_chunkhdr_t

2017-06-29 Thread 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 <lucien@gmail.

[PATCH net-next 00/11] sctp: remove typedefs from structures part 1

2017-06-29 Thread Xin Long
to fix some indents. No any code's logic is changed in these patches, only cleaning up. Xin Long (11): sctp: remove the typedef sctp_sctphdr_t sctp: remove the typedef sctp_chunkhdr_t sctp: remove the typedef sctp_cid_t sctp: remove the typedef sctp_cid_action_t sctp: remove the typedef

[PATCH net-next] sctp: remove an unnecessary check from sctp_endpoint_destroy

2017-06-29 Thread Xin Long
ep->base.sk gets it's value since sctp_endpoint_new, nowhere will change it. So there's no need to check if it's null, as it can never be null. Signed-off-by: Xin Long <lucien@gmail.com> --- net/sctp/endpointola.c | 14 ++ 1 file changed, 6 insertions(+), 8 deletions

[PATCH net-next] sctp: handle errors when updating asoc

2017-06-20 Thread Xin Long
-by: Xin Long <lucien@gmail.com> --- include/net/sctp/structs.h | 4 ++-- net/sctp/associola.c | 25 ++--- net/sctp/sm_sideeffect.c | 24 +++- 3 files changed, 39 insertions(+), 14 deletions(-) diff --git a/include/net/sctp/structs.h b/i

[PATCH net-next] sctp: uncork the old asoc before changing to the new one

2017-06-20 Thread Xin Long
gmail.com> 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 25384fa..7623566 100644 --- a/net/sctp/sm_sideeffect.c +++ b/net/sctp/sm_sideeffect.c @@

[PATCH net] dccp: call inet_add_protocol after register_pernet_subsys in dccp_v6_init

2017-06-20 Thread Xin Long
Patch "call inet_add_protocol after register_pernet_subsys in dccp_v4_init" fixed a null pointer dereference issue for dccp_ipv4 module. The same fix is needed for dccp_ipv6 module. Signed-off-by: Xin Long <lucien@gmail.com> --- net/dccp/ipv6.c | 20 ++-- 1

[PATCH net] dccp: call inet_add_protocol after register_pernet_subsys in dccp_v4_init

2017-06-20 Thread Xin Long
[ 171.986956] [] call_softirq+0x1c/0x30 This patch is to move inet_add_protocol after register_pernet_subsys in dccp_v4_init, so that v4_ctl_sk is initialized before any incoming dccp packets are processed. Reported-by: Jianlin Shi <ji...@redhat.com> Signed-off-by: Xin Long <lucien@

[PATCH net] sctp: ensure ep is not destroyed before doing the dump

2017-06-17 Thread Xin Long
his ep. Suggested-by: Marcelo Ricardo Leitner <marcelo.leit...@gmail.com> Signed-off-by: Xin Long <lucien@gmail.com> --- net/sctp/endpointola.c | 1 + net/sctp/sctp_diag.c | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/net/sctp/endpointola.c b/net/sctp/e

[PATCH net] sctp: return next obj by passing pos + 1 into sctp_transport_get_idx

2017-06-15 Thread Xin Long
the next obj directly, even if pos > objs nums, it would return NULL and stop hti. Fixes: 626d16f50f39 ("sctp: export some apis or variables for sctp_diag and reuse some for proc") Signed-off-by: Xin Long <lucien@gmail.com> --- net/sctp/socket.c | 5 ++--- 1 file changed,

[PATCH net] ipv6: fix calling in6_ifa_hold incorrectly for dad work

2017-06-15 Thread Xin Long
; Acked-by: Hannes Frederic Sowa <han...@stressinduktion.org> Signed-off-by: Xin Long <lucien@gmail.com> --- net/ipv6/addrconf.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c index 6a4fb1e..686c923 100644 --- a/net/ip

Re: [Patch net] igmp: acquire pmc lock for ip_mc_clear_src()

2017-06-13 Thread Xin Long
On Tue, Jun 13, 2017 at 2:35 AM, Cong Wang <xiyou.wangc...@gmail.com> wrote: > On Mon, Jun 12, 2017 at 11:30 AM, Xin Long <lucien@gmail.com> wrote: >> Hi, Cong. >> >> how about in ip_check_mc_rcu(): >> for (psf = im->sources; psf; psf =

Re: [Patch net] igmp: acquire pmc lock for ip_mc_clear_src()

2017-06-12 Thread Xin Long
r pmc itself, this > spinlock could actually ensure we don't access them in parallel. > > Thanks to Eric and Long for discussion on this bug. > > Reported-by: Andrey Konovalov <andreyk...@google.com> > Cc: Eric Dumazet <eduma...@google.com> > Cc: Xin Long &

Re: [PATCHv3 net] xfrm: move xfrm_garbage_collect out of xfrm_policy_flush

2017-06-11 Thread Xin Long
- xfrm_garbage_collect() > - flow_cache_flush() > - flow_cache_percpu_empty() > - fcp = per_cpu_ptr(fc->percpu, cpu) > > To reproduce, just add ipsec in netns and then remove the netns. > > v2: > As Xin Long suggested, since only two other places need to cal

Re: [PATCHv2 net] net/flow: fix fc->percpu NULL pointer dereference

2017-06-10 Thread Xin Long
- xfrm_garbage_collect() > - flow_cache_flush() > - flow_cache_percpu_empty() > - fcp = per_cpu_ptr(fc->percpu, cpu) > > To reproduce, just add ipsec in netns and then remove the netns. > > v2: > As Xin Long suggested, since only two other places need to

[PATCHv2 net-next] sctp: no need to check assoc id before calling sctp_assoc_set_id

2017-06-10 Thread Xin Long
sctp_assoc_set_id does the assoc id check in the beginning when processing dupcookie, no need to do the same check before calling it. v1->v2: fix some typo errs Marcelo pointed in changelog. Signed-off-by: Xin Long <lucien@gmail.com> --- net/sctp/associola.c | 8 ++-- 1 fil

[PATCH net-next] sctp: use read_lock_bh in sctp_eps_seq_show

2017-06-10 Thread Xin Long
This patch is to use read_lock_bh instead of local_bh_disable and read_lock in sctp_eps_seq_show. Signed-off-by: Xin Long <lucien@gmail.com> --- net/sctp/proc.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/net/sctp/proc.c b/net/sctp/proc.c index 5a27d0f..8

[PATCH net-next] sctp: fix recursive locking warning in sctp_do_peeloff

2017-06-10 Thread Xin Long
and Marcelo's suggestion. Reported-by: Dmitry Vyukov <dvyu...@google.com> Suggested-by: Marcelo Ricardo Leitner <marcelo.leit...@gmail.com> Suggested-by: Cong Wang <xiyou.wangc...@gmail.com> Signed-off-by: Xin Long <lucien@gmail.com> --- net/sctp/socket.c | 4 ++-- 1 file cha

[PATCH net] sctp: disable BH in sctp_for_each_endpoint

2017-06-10 Thread Xin Long
reuse some for proc") Reported-by: Xiumei Mu <x...@redhat.com> Signed-off-by: Xin Long <lucien@gmail.com> --- net/sctp/socket.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/net/sctp/socket.c b/net/sctp/socket.c index f16c8d9..30aa0a5 100644 --- a/net/s

Re: [PATCH net] ipv4: igmp: fix a use after free

2017-06-09 Thread Xin Long
On Sat, Jun 10, 2017 at 1:01 AM, Cong Wang <xiyou.wangc...@gmail.com> wrote: > On Fri, Jun 9, 2017 at 8:56 AM, Eric Dumazet <eric.duma...@gmail.com> wrote: >> On Fri, 2017-06-09 at 14:24 +0800, Xin Long wrote: >>> On Fri, Jun 9, 2017 at 8:59 AM, Cong Wang &l

Re: [PATCH net] net/flow: fix fc->percpu NULL pointer dereference

2017-06-09 Thread Xin Long
On Fri, Jun 9, 2017 at 5:06 PM, Hangbin Liu <liuhang...@gmail.com> wrote: > 2017-06-09 16:43 GMT+08:00 Xin Long <lucien@gmail.com>: >> On Fri, Jun 9, 2017 at 4:32 PM, Steffen Klassert >> <steffen.klass...@secunet.com> wrote: >>> On Fri, Jun 09, 2

Re: [PATCH net] net/flow: fix fc->percpu NULL pointer dereference

2017-06-09 Thread Xin Long
On Fri, Jun 9, 2017 at 4:32 PM, Steffen Klassert wrote: > On Fri, Jun 09, 2017 at 04:23:01PM +0800, Hangbin Liu wrote: >> Hi Steffen, >> >> BTW, If we put the check in xfrm_policy_flush(), we can prevent it earlier. >> But If we put the check in

Re: [PATCH net] ipv4: igmp: fix a use after free

2017-06-09 Thread Xin Long
On Fri, Jun 9, 2017 at 2:05 PM, Cong Wang wrote: > On Thu, Jun 8, 2017 at 6:37 PM, Eric Dumazet wrote: >> On Thu, 2017-06-08 at 17:59 -0700, Cong Wang wrote: >>> On Thu, Jun 8, 2017 at 1:33 PM, Eric Dumazet wrote: >>> > I

Re: [PATCH net] ipv4: igmp: fix a use after free

2017-06-09 Thread Xin Long
On Fri, Jun 9, 2017 at 8:59 AM, Cong Wang wrote: > On Thu, Jun 8, 2017 at 1:33 PM, Eric Dumazet wrote: >> I mentioned (in https://lkml.org/lkml/2017/5/31/619 ) that we might need >> to defer freeing after rcu grace period but for some reason

Re: [PATCH net] ipv4: igmp: fix a use after free

2017-06-08 Thread Xin Long
On Thu, Jun 8, 2017 at 9:43 PM, Eric Dumazet wrote: > From: Eric Dumazet > > Andrey reported a use-after-free in add_grec(), courtesy of syzkaller. > > Problem here is that igmp_stop_timer() uses a del_timer(), so we can not > guarantee that another

Re: Oops with commit 6d18c73 bridge: start hello_timer when enabling KERNEL_STP in br_stp_start

2017-06-01 Thread Xin Long
On Thu, Jun 1, 2017 at 12:32 AM, Sebastian Ott wrote: [...] > > A system running v4.12-rc3-11-gf511c0b on s390 hangs after boot with no > messages on the console. The message buffer obtained via a system dump > looked like this: > > [...] > [ 17.870712] virbr0: port

[PATCH net-next 2/2] sctp: merge sctp_stream_new and sctp_stream_init

2017-05-31 Thread Xin Long
cnt parameters into it, instead of the whole asoc. Signed-off-by: Xin Long <lucien@gmail.com> --- include/net/sctp/structs.h | 4 ++-- net/sctp/associola.c | 3 ++- net/sctp/sm_make_chunk.c | 3 ++- net/sctp/stream.c | 33 +++-- 4 files ch

[PATCH net-next 1/2] sctp: define the member stream as an object instead of pointer in asoc

2017-05-31 Thread Xin Long
the stream info from one stream to another. Signed-off-by: Xin Long <lucien@gmail.com> --- include/net/sctp/structs.h | 3 +- net/sctp/associola.c | 13 - net/sctp/chunk.c | 4 +-- net/sctp/outqueue.c| 10 +++ net/sctp/proc.c| 4 +-- ne

[PATCH net-next 0/2] sctp: improve asoc streams management

2017-05-31 Thread Xin Long
This patchset changes to define asoc->stream as an object, and also improve some codes to make it more clearly. Xin Long (2): sctp: define the member stream as an object instead of pointer in asoc sctp: merge sctp_stream_new and sctp_stream_init include/net/sctp/structs.h | 7 ++--

Re: [PATCH net v2] sctp: fix ICMP processing if skb is non-linear

2017-05-26 Thread Xin Long
> - change commit message to make specific reference to INIT chunks. > > Signed-off-by: Davide Caratti <dcara...@redhat.com> Thanks. Reviewed-by: Xin Long <lucien@gmail.com> > --- > net/sctp/input.c | 16 +--- > 1 file changed, 9 insertions(+), 7 de

[PATCHv2 net] netfilter: do not hold dev in ipt_CLUSTERIP

2017-05-24 Thread Xin Long
tch doesn't remove the codes checking if the dev exists before creating a config. v1->v2: - As Pablo Neira Ayuso's suggestion, register a netdevice notifier to manage c->ifindex and dev's mc. Reported-by: Jianlin Shi <ji...@redhat.com> Signed-off-by: Xin Long <lucien@g

Re: [PATCH net] netfilter: do not hold dev in ipt_CLUSTERIP

2017-05-24 Thread Xin Long
On Wed, May 24, 2017 at 5:26 AM, Pablo Neira Ayuso <pa...@netfilter.org> wrote: > On Sat, May 20, 2017 at 05:08:06PM +0800, Xin Long wrote: >> It's a terrible thing to hold dev in iptables target. When the dev is >> being removed, unregister_netdevice has to wait for the

Re: [PATCH net-next] sctp: no need to check asoc_id before calling sctp_assoc_set_id

2017-05-23 Thread Xin Long
On Wed, May 24, 2017 at 2:04 AM, Marcelo Ricardo Leitner <marcelo.leit...@gmail.com> wrote: [...] > > On Tue, May 23, 2017 at 02:30:32PM +0800, Xin Long wrote: >> sctp_assoc_set_id has already done the asoc_id check in the beginning > s//d

Re: [PATCH 0/5] net-SCTP: Adjustments for three function implementations

2017-05-23 Thread Xin Long
ogether with a variable assignment > > net/sctp/protocol.c | 12 ++-- > 1 file changed, 6 insertions(+), 6 deletions(-) I guess these patches are for net-next.git Series Reviewed-by: Xin Long <lucien@gmail.com> > > -- > 2.13.0 > > -- > To unsubscribe

[PATCH net-next] sctp: no need to check asoc_id before calling sctp_assoc_set_id

2017-05-23 Thread Xin Long
sctp_assoc_set_id has already done the asoc_id check in the beginning when processing dupcook, no need to do the same check before calling it. Signed-off-by: Xin Long <lucien@gmail.com> --- net/sctp/associola.c | 8 ++-- 1 file changed, 2 insertions(+), 6 deletions(-) diff --git

[PATCH net 1/2] sctp: fix stream update when processing dupcookie

2017-05-22 Thread Xin Long
state instead. Fixes: 3dbcc105d556 ("sctp: alloc stream info when initializing asoc") Signed-off-by: Xin Long <lucien@gmail.com> --- net/sctp/associola.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/net/sctp/associola.c b/net/sctp/associola.c index a970

[PATCH net 2/2] sctp: set new_asoc temp when processing dupcookie

2017-05-22 Thread Xin Long
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 <j...@redhat.com> Signed-off-by: Xin Long <lucien@gmail.com> --- net/sctp/sm_make_chunk.c | 13 ---

[PATCH net 0/2] sctp: a bunch of fixes for processing dupcookie

2017-05-22 Thread Xin Long
After introducing transport hashtable and per stream info into sctp, some regressions were caused when processing dupcookie, this patchset is to fix them. Xin Long (2): sctp: fix stream update when processing dupcookie sctp: set new_asoc temp when processing dupcookie net/sctp/associola.c

[PATCH net] netfilter: do not hold dev in ipt_CLUSTERIP

2017-05-20 Thread Xin Long
Jianlin Shi <ji...@redhat.com> Signed-off-by: Xin Long <lucien@gmail.com> --- net/ipv4/netfilter/ipt_CLUSTERIP.c | 31 ++- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/net/ipv4/netfilter/ipt_CLUSTERIP.c b/net/ipv4/netfilter/ipt_CLUSTER

Re: [PATCH net] sctp: fix ICMP processing if skb is non-linear

2017-05-19 Thread Xin Long
On Fri, May 19, 2017 at 11:34 PM, Davide Caratti wrote: > when the ICMP packet is carried by a paged skb, sctp_err_lookup() may fail > validation even if the payload contents match an open socket: as a > consequence, sometimes ICMPs are wrongly ignored. Use

Re: [PATCH net-next v2] bridge: fix hello and hold timers starting/stopping

2017-05-19 Thread Xin Long
.net > Cc: sas...@cumulusnetworks.com > Cc: step...@networkplumber.org > Cc: bri...@lists.linux-foundation.org > Cc: lucien@gmail.com > Cc: niko...@cumulusnetworks.com > Signed-off-by: Ivan Vecera <c...@cera.cz> Reviewed-by: Xin Long <lucien@gmail.com> > --- >

Re: [PATCH net] bridge: fix hello and hold timers starting/stopping

2017-05-19 Thread Xin Long
On Sat, May 20, 2017 at 12:25 AM, Ivan Vecera wrote: [...] > @@ -197,13 +191,14 @@ static void br_stp_stop(struct net_bridge *br) > br_err(br, "failed to stop userspace STP (%d)\n", > err); > > /* To start timers on any ports left in blocking

Re: [PATCH net] bridge: fix hello and hold timers starting/stopping

2017-05-19 Thread Xin Long
KERNEL_STP->NO_STP >transition. They should be stopped as they are running in KERNEL_STP >state and should not run in NO_STP case. > > The patch is a follow-up for "bridge: start hello_timer when enabling > KERNEL_STP in br_stp_start" patch from Xin L

[PATCH net] bridge: start hello_timer when enabling KERNEL_STP in br_stp_start

2017-05-19 Thread Xin Long
ed is KERNEL_STP in br_hello_timer_expired, there is no reason to start the timer again when it's NO_STP. Fixes: 76b91c32dd86 ("bridge: stp: when using userspace stp stop kernel hello and hold timers") Reported-by: Haidong Li <ha...@redhat.com> Signed-off-by: Xin Long <lucien@gmail.com&

[PATCH net] sctp: fix src address selection if using secondary addresses for ipv6

2017-05-12 Thread Xin Long
en no optimal is found. Reported-by: Patrick Talbert <ptalb...@redhat.com> Signed-off-by: Xin Long <lucien@gmail.com> --- net/sctp/ipv6.c | 46 +- 1 file changed, 29 insertions(+), 17 deletions(-) diff --git a/net/sctp/ipv6.c b/net/

Re: [PATCH net v3] driver: veth: Fix one possbile memleak when fail to register_netdevice

2017-05-03 Thread Xin Long
On Wed, May 3, 2017 at 2:37 PM, Gao Feng <gfree.w...@foxmail.com> wrote: >> From: Xin Long [mailto:lucien@gmail.com] >> Sent: Wednesday, May 3, 2017 1:38 PM >> On Wed, May 3, 2017 at 10:07 AM, Gao Feng <gfree.w...@foxmail.com> >> wrote: >

Re: [PATCH net v3] driver: veth: Fix one possbile memleak when fail to register_netdevice

2017-05-02 Thread Xin Long
On Wed, May 3, 2017 at 10:07 AM, Gao Feng <gfree.w...@foxmail.com> wrote: >> From: netdev-ow...@vger.kernel.org [mailto:netdev-ow...@vger.kernel.org] >> On Behalf Of Xin Long >> Sent: Wednesday, May 3, 2017 12:59 AM >> On Tue, May 2, 2017 at 7:03 PM, Gao Feng

Re: [PATCH net v3] driver: veth: Fix one possbile memleak when fail to register_netdevice

2017-05-02 Thread Xin Long
On Tue, May 2, 2017 at 7:03 PM, Gao Feng <gfree.w...@vip.163.com> wrote: >> From: Xin Long [mailto:lucien@gmail.com] >> Sent: Tuesday, May 2, 2017 3:56 PM >> On Sat, Apr 29, 2017 at 11:51 AM, <gfree.w...@foxmail.com> wrote: >> > From: Gao Feng <gf

Re: [PATCH net v3] driver: veth: Fix one possbile memleak when fail to register_netdevice

2017-05-02 Thread Xin Long
On Sat, Apr 29, 2017 at 11:51 AM, wrote: > From: Gao Feng > > The veth driver allocates some resources in its ndo_init func, and > free them in its destructor func. Then there is one memleak that some > errors happen after register_netdevice

[PATCHv2 net] bridge: move bridge multicast cleanup to ndo_uninit

2017-04-25 Thread Xin Long
o ndo_uninit, instead of calling dev_close in br_dev_delete. Reported-by: Jianwen Ji <j...@redhat.com> Signed-off-by: Xin Long <lucien@gmail.com> --- net/bridge/br_device.c | 1 + net/bridge/br_if.c | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/net/

Re: [PATCH net] bridge: shutdown bridge device before removing it

2017-04-24 Thread Xin Long
On Mon, Apr 24, 2017 at 10:53 PM, Nikolay Aleksandrov <niko...@cumulusnetworks.com> wrote: > On 24/04/17 17:41, Xin Long wrote: >> On Mon, Apr 24, 2017 at 8:07 PM, Nikolay Aleksandrov >> <niko...@cumulusnetworks.com> wrote: >>> On 24/04/17 14:01, Nikolay Aleks

Re: [PATCH net] bridge: shutdown bridge device before removing it

2017-04-24 Thread Xin Long
On Mon, Apr 24, 2017 at 8:07 PM, Nikolay Aleksandrov <niko...@cumulusnetworks.com> wrote: > On 24/04/17 14:01, Nikolay Aleksandrov wrote: >> On 24/04/17 10:25, Xin Long wrote: >>> During removing a bridge device, if the bridge is still up, a new mdb entr

[PATCH net] xfrm: do the garbage collection after flushing policy

2017-04-24 Thread Xin Long
there. The worse thing is that xdst->route/orig_dst is also hold and can not be released even if the orig_dst is already expired. This patch is to do the garbage collection if there is any policy removed in xfrm_policy_flush. Signed-off-by: Xin Long <lucien@gmail.com> --- net/xfrm/xfrm_pol

[PATCH net] bridge: shutdown bridge device before removing it

2017-04-24 Thread Xin Long
for brctl. Reported-by: Jianwen Ji <j...@redhat.com> Signed-off-by: Xin Long <lucien@gmail.com> --- net/bridge/br_if.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/net/bridge/br_if.c b/net/bridge/br_if.c index 56a2a72..8175f13 100644 --- a/net/bridge/br_if.c +++ b/net/bri

[PATCH net-next 3/3] sctp: process duplicated strreset asoc request correctly

2017-04-15 Thread Xin Long
pted by peer. Signed-off-by: Xin Long <lucien@gmail.com> --- net/sctp/stream.c | 19 +++ 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/net/sctp/stream.c b/net/sctp/stream.c index c91d97e..dda53a2 100644 --- a/net/sctp/stream.c +++ b/net/sctp/stream.c @@ -529,12

[PATCH net-next 1/3] sctp: process duplicated strreset out and addstrm out requests correctly

2017-04-15 Thread Xin Long
e sent together in one chunk. And note that when receiving a duplicated request, the receiver side will still reply it even if the peer has received the response. It's safe, As the response will be dropped by the peer. Signed-off-by: Xin Long <lucien@gmail.com> --- include/net/sctp/

[PATCH net-next 2/3] sctp: process duplicated strreset in and addstrm in requests correctly

2017-04-15 Thread Xin Long
ted strreset in or addstrm in request and it's result was performed, it shouldn't reply this request, but drop it instead. Signed-off-by: Xin Long <lucien@gmail.com> --- net/sctp/stream.c | 38 +- 1 file changed, 29 insertions(+), 9 deletions(-) diff --git a/n

[PATCH net-next 0/3] sctp: add proper process for duplicated stream reconf requests

2017-04-15 Thread Xin Long
Now sctp stream reconf will process a request again even if it's seqno is less than asoc->strreset_inseq. It may cause a replay attack. This patchset is to avoid it by add proper process for all duplicated stream reconf requests. Xin Long (3): sctp: process duplicated strreset out and adds

[PATCH net-next] sctp: get list_of_streams of strreset outreq earlier

2017-04-15 Thread Xin Long
treams earlier, and also to improve some codes for the strreset inreq process. Signed-off-by: Xin Long <lucien@gmail.com> --- net/sctp/stream.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/net/sctp/stream.c b/net/sctp/stream.c index eff6008..4ec3679 1006

[PATCH net] team: call netdev_change_features out of team lock

2017-04-05 Thread Xin Long
d and team_port_del. It may cause a dead lock when the slave port with LRO enabled is added. This patch is to fix this dead lock by moving netdev_change_features out of team_port_add and team_port_del, and call it after unlocking the team lock. Reported-by: Patrick Talbert <ptalb...@redhat.com>

[PATCH net] sctp: listen on the sock only when it's state is listening or closed

2017-04-05 Thread Xin Long
-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 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/net/sctp/socket.c b/net/sctp/socket.c index c1401f4..d9d4c92 100

Re: net/sctp: list double add warning in sctp_endpoint_add_asoc

2017-04-05 Thread Xin Long
On Wed, Apr 5, 2017 at 5:14 AM, Marcelo Ricardo Leitner <marcelo.leit...@gmail.com> wrote: > On Wed, Apr 05, 2017 at 01:29:19AM +0800, Xin Long wrote: >> On Tue, Apr 4, 2017 at 9:28 PM, Andrey Konovalov <andreyk...@google.com> >> wrote: >> > Hi, >> > &

Re: net/sctp: list double add warning in sctp_endpoint_add_asoc

2017-04-04 Thread Xin Long
On Tue, Apr 4, 2017 at 9:28 PM, Andrey Konovalov wrote: > Hi, > > I've got the following error report while fuzzing the kernel with syzkaller. > > On commit a71c9a1c779f2499fb2afc0553e543f18aff6edf (4.11-rc5). > > A reproducer and .config are attached. The script is pretty

[PATCH net] sctp: get sock from transport in sctp_transport_update_pmtu

2017-04-03 Thread Xin Long
ed codes from that function. Signed-off-by: Xin Long <lucien@gmail.com> --- include/net/sctp/sctp.h| 5 ++--- include/net/sctp/structs.h | 6 +++--- net/sctp/associola.c | 6 +++--- net/sctp/input.c | 4 ++-- net/sctp/output.c | 4 ++-- net/sctp/socket.c

[PATCH net] sctp: check for dst and pathmtu update in sctp_packet_config

2017-04-01 Thread Xin Long
once for one flush schedule. It's also safe, since asoc is NULL only when the packet is created by sctp_ootb_pkt_new in which it just gets the new dst, no need to do more things for it other than set packet with transport's pathmtu. Signed-off-by: Xin Long <lucien@gmail.com> --- inclu

[PATCHv2 net-next] sctp: add SCTP_PR_STREAM_STATUS sockopt for prsctp

2017-04-01 Thread Xin Long
the prsctp per stream statistics into sctp_stream_out. v1->v2: fix an indent issue. Signed-off-by: Xin Long <lucien@gmail.com> --- include/net/sctp/structs.h | 2 ++ include/uapi/linux/sctp.h | 1 + net/sctp/chunk.c | 14 +-- net/sctp/outqueue.c| 10

Re: [PATCH net-next] sctp: add SCTP_PR_STREAM_STATUS sockopt for prsctp

2017-04-01 Thread Xin Long
On Sat, Apr 1, 2017 at 2:08 AM, Marcelo Ricardo Leitner <marcelo.leit...@gmail.com> wrote: > On Fri, Mar 31, 2017 at 06:14:09PM +0800, Xin Long wrote: >> Before when implementing sctp prsctp, SCTP_PR_STREAM_STATUS wasn't >> added, as it needs to save abandoned_(un)

[PATCH net-next] sctp: add SCTP_PR_STREAM_STATUS sockopt for prsctp

2017-03-31 Thread Xin Long
the prsctp per stream statistics into sctp_stream_out. Signed-off-by: Xin Long <lucien@gmail.com> --- include/net/sctp/structs.h | 2 ++ include/uapi/linux/sctp.h | 1 + net/sctp/chunk.c | 14 +-- net/sctp/outqueue.c| 10 net/sctp/socket.c

[PATCH net] sctp: use right in and out stream cnt

2017-03-31 Thread Xin Long
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 <lucien@gmail.com> --- net/sctp/outqueue.c | 3 +-- net/sc

[PATCH net] sctp: alloc stream info when initializing asoc

2017-03-29 Thread Xin Long
stream info when initializing an asoc, allocing in stream and re-allocing out stream when processing init. Signed-off-by: Xin Long <lucien@gmail.com> --- include/net/sctp/structs.h | 3 ++- net/sctp/associola.c | 7 ++- net/sctp/sm_make_chunk.c | 9 ++--- net/sctp/st

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

2017-03-29 Thread Xin Long
2: > - avoid useless initiazation to zero (thanks Xin Long) > Reviewed-by: Xin Long <lucien@gmail.com> > drivers/net/veth.c | 19 +++ > 1 files changed, 7 insertions(+), 12 deletions(-) > > diff --git a/drivers/net/veth.c b/drivers/net/veth.c > inde

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

2017-03-27 Thread Xin Long
On Tue, Mar 28, 2017 at 6:43 AM, Marcelo Ricardo Leitner <marcelo.leit...@gmail.com> wrote: > On Mon, Mar 27, 2017 at 12:21:15AM +0800, Xin Long wrote: >> David Laight noticed the support for MSG_MORE with datamsg->force_delay >> didn't really work as we expected, as the

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

2017-03-27 Thread Xin Long
On Mon, Mar 27, 2017 at 10:16 PM, Marcelo Ricardo Leitner <marcelo.leit...@gmail.com> wrote: > On Mon, Mar 27, 2017 at 12:48:31PM +0800, Xin Long wrote: >> On Sat, Mar 25, 2017 at 7:52 AM, Marcelo Ricardo Leitner >> <marcelo.leit...@gmail.com> wrote: >> > On T

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

2017-03-26 Thread Xin Long
On Sat, Mar 25, 2017 at 7:52 AM, Marcelo Ricardo Leitner <marcelo.leit...@gmail.com> wrote: > On Tue, Mar 21, 2017 at 01:44:32PM +0800, Xin Long wrote: >> On Tue, Mar 21, 2017 at 2:04 AM, Marcelo Ricardo Leitner >> <marcelo.leit...@gmail.com> wrote: >> > On F

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

2017-03-26 Thread Xin Long
ted by other triggers, like asoc->state != ESTABLISHED, queue size > pmtu etc. v1->v2: Not clear asoc->force_delay after sending the msg with MSG_MORE flag. Fixes: 4ea0c32f5f42 ("sctp: add support for MSG_MORE") Signed-off-by: Xin Long <lucien@gmail.com> --- inc

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

2017-03-24 Thread Xin Long
On Fri, Mar 24, 2017 at 12:42 AM, Marcelo Ricardo Leitner <marcelo.leit...@gmail.com> wrote: > On Thu, Mar 23, 2017 at 12:35:46PM +0800, Xin Long wrote: >> On Thu, Mar 23, 2017 at 1:33 AM, Marcelo Ricardo Leitner >> <marcelo.leit...@gmail.com> wrote: >> > On W

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

2017-03-22 Thread Xin Long
On Thu, Mar 23, 2017 at 1:33 AM, Marcelo Ricardo Leitner wrote: > On Wed, Mar 22, 2017 at 02:07:37PM +, David Laight wrote: >> From: Marcelo Ricardo Leitner [mailto:marcelo.leit...@gmail.com] >> > Sent: 21 March 2017 22:04 >> > Hi, >> ... >> > > > 2. send 1 more

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