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

2017-01-13 Thread Marcelo Ricardo Leitner
Assigned but not used. Signed-off-by: Marcelo Ricardo Leitner <marcelo.leit...@gmail.com> --- net/sctp/sm_make_chunk.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/net/sctp/sm_make_chunk.c b/net/sctp/sm_make_chunk.c index a15d824a313d310ed03ba77055d22b1c7c

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

2017-01-13 Thread Marcelo Ricardo Leitner
, and then once for each transport this asoc has, meaning that the frag_point will be recomputed when updating the transports and calling it when updating the asoc is not necessary. IOW, no action is needed here and we can remove this call. Signed-off-by: Marcelo Ricardo Leitner <marcelo.leit...@gmail.

Re: [PATCH net-next 3/4] net: switchdev: Add switchdev_port_bridge_getlink_deferred

2017-01-09 Thread Marcelo Ricardo Leitner
On Mon, Jan 09, 2017 at 12:13:19PM -0800, Florian Fainelli wrote: > On 01/09/2017 12:11 PM, Marcelo Ricardo Leitner wrote: > > On Mon, Jan 09, 2017 at 11:45:02AM -0800, Florian Fainelli wrote: > >> Add switchdev_port_bridge_getlink_deferred() which does a deferred > >

Re: [PATCH net-next 3/4] net: switchdev: Add switchdev_port_bridge_getlink_deferred

2017-01-09 Thread Marcelo Ricardo Leitner
On Mon, Jan 09, 2017 at 11:45:02AM -0800, Florian Fainelli wrote: > Add switchdev_port_bridge_getlink_deferred() which does a deferred > object dump operation, this is required for e.g: DSA switches which > typically have sleeping I/O operations which is incompatible with being > in atomic context

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

2017-01-09 Thread Marcelo Ricardo Leitner
On Tue, Jan 10, 2017 at 02:27:09AM +0800, Xin Long wrote: > 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,

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

2017-01-06 Thread Marcelo Ricardo Leitner
tream has the same name > with before. > > Signed-off-by: Xin Long <lucien@gmail.com> Looks good to me but I cannot build-test it now, thus Reviewed-by: Marcelo Ricardo Leitner <marcelo.leit...@gmail.com> > --- > include/net/sctp/sctp.h| 1 - > include/ne

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

2017-01-06 Thread Marcelo Ricardo Leitner
On Fri, Jan 06, 2017 at 03:50:36PM +, David Laight wrote: > From: Xin Long > > Sent: 06 January 2017 14:19 > > sctp stream reconf, described in RFC 6525, needs a structure to > > save per stream information in assoc, like stream state. > > > > In the future, sctp stream scheduler also needs

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

2017-01-04 Thread Marcelo Ricardo Leitner
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 sctp_association_free. > > Stream arrays are used to replace ssnmap to save more stream things in > the next patch. > >

[PATCH net-next] sctp: refactor sctp_datamsg_from_user

2016-12-29 Thread Marcelo Ricardo Leitner
Ricardo Leitner <marcelo.leit...@gmail.com> --- net/sctp/chunk.c | 107 +-- 1 file changed, 32 insertions(+), 75 deletions(-) diff --git a/net/sctp/chunk.c b/net/sctp/chunk.c index 615f0ddd41dfb1ff46a9d4e564716de8e7

[PATCH net-next] sctp: add pr_debug for tracking asocs not found

2016-12-28 Thread Marcelo Ricardo Leitner
This pr_debug may help identify why the system is generating some Aborts. It's not something a sysadmin would be expected to use. Signed-off-by: Marcelo Ricardo Leitner <marcelo.leit...@gmail.com> --- net/sctp/input.c | 17 +++-- 1 file changed, 15 insertions(+), 2 deletions(-)

[PATCH RESEND net-next 4/5] sctp: remove return value from sctp_packet_init/config

2016-12-28 Thread Marcelo Ricardo Leitner
There is no reason to use this cascading. It doesn't add anything. Let's remove it and simplify. Signed-off-by: Marcelo Ricardo Leitner <marcelo.leit...@gmail.com> --- include/net/sctp/structs.h | 7 +++ net/sctp/output.c | 14 +- net/sctp/sm_statefuns.c

[PATCH RESEND net-next 3/5] sctp: simplify addr copy

2016-12-28 Thread Marcelo Ricardo Leitner
Make it a bit easier to read. Signed-off-by: Marcelo Ricardo Leitner <marcelo.leit...@gmail.com> --- net/sctp/ipv6.c | 16 +++- net/sctp/protocol.c | 18 +++--- 2 files changed, 14 insertions(+), 20 deletions(-) diff --git a/net/sctp/ipv6.c b/net/sctp/ipv6.c

[PATCH RESEND net-next 1/5] sctp: reduce indent level at sctp_sf_tabort_8_4_8

2016-12-28 Thread Marcelo Ricardo Leitner
Signed-off-by: Marcelo Ricardo Leitner <marcelo.leit...@gmail.com> --- net/sctp/sm_statefuns.c | 44 +--- 1 file changed, 21 insertions(+), 23 deletions(-) diff --git a/net/sctp/sm_statefuns.c b/net/sctp/sm_statefuns.c

[PATCH RESEND net-next 2/5] sctp: reduce indent level in sctp_sf_shut_8_4_5

2016-12-28 Thread Marcelo Ricardo Leitner
Signed-off-by: Marcelo Ricardo Leitner <marcelo.leit...@gmail.com> --- net/sctp/sm_statefuns.c | 58 - 1 file changed, 28 insertions(+), 30 deletions(-) diff --git a/net/sctp/sm_statefuns.c b/net/sctp/sm_statefuns.c

[PATCH RESEND net-next 5/5] sctp: sctp_chunk_length_valid should return bool

2016-12-28 Thread Marcelo Ricardo Leitner
Signed-off-by: Marcelo Ricardo Leitner <marcelo.leit...@gmail.com> --- net/sctp/sm_statefuns.c | 15 +++ 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/net/sctp/sm_statefuns.c b/net/sctp/sm_statefuns.c index 9a223d5b2314ff166be0446462c33219b7

[PATCH RESEND net-next 0/5] SCTP cleanups

2016-12-28 Thread Marcelo Ricardo Leitner
Some cleanups/simplifications I've been collecting. Resending now with net-next open. Marcelo Ricardo Leitner (5): sctp: reduce indent level at sctp_sf_tabort_8_4_8 sctp: reduce indent level in sctp_sf_shut_8_4_5 sctp: simplify addr copy sctp: remove return value from sctp_packet_init

[PATCH net-next 4/5] sctp: remove return value from sctp_packet_init/config

2016-12-27 Thread Marcelo Ricardo Leitner
There is no reason to use this cascading. It doesn't add anything. Let's remove it and simplify. Signed-off-by: Marcelo Ricardo Leitner <marcelo.leit...@gmail.com> --- include/net/sctp/structs.h | 7 +++ net/sctp/output.c | 14 +- net/sctp/sm_statefuns.c

[PATCH net-next 5/5] sctp: sctp_chunk_length_valid should return bool

2016-12-27 Thread Marcelo Ricardo Leitner
Signed-off-by: Marcelo Ricardo Leitner <marcelo.leit...@gmail.com> --- net/sctp/sm_statefuns.c | 15 +++ 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/net/sctp/sm_statefuns.c b/net/sctp/sm_statefuns.c index 9a223d5b2314ff166be0446462c33219b7

[PATCH net-next 3/5] sctp: simplify addr copy

2016-12-27 Thread Marcelo Ricardo Leitner
Make it a bit easier to read. Signed-off-by: Marcelo Ricardo Leitner <marcelo.leit...@gmail.com> --- net/sctp/ipv6.c | 16 +++- net/sctp/protocol.c | 18 +++--- 2 files changed, 14 insertions(+), 20 deletions(-) diff --git a/net/sctp/ipv6.c b/net/sctp/ipv6.c

[PATCH net-next 0/5] SCTP cleanups

2016-12-27 Thread Marcelo Ricardo Leitner
Some cleanups/simplifications I've been collecting. Marcelo Ricardo Leitner (5): sctp: reduce indent level at sctp_sf_tabort_8_4_8 sctp: reduce indent level in sctp_sf_shut_8_4_5 sctp: simplify addr copy sctp: remove return value from sctp_packet_init/config sctp

[PATCH net-next 1/5] sctp: reduce indent level at sctp_sf_tabort_8_4_8

2016-12-27 Thread Marcelo Ricardo Leitner
Signed-off-by: Marcelo Ricardo Leitner <marcelo.leit...@gmail.com> --- net/sctp/sm_statefuns.c | 44 +--- 1 file changed, 21 insertions(+), 23 deletions(-) diff --git a/net/sctp/sm_statefuns.c b/net/sctp/sm_statefuns.c

[PATCH net-next 2/5] sctp: reduce indent level in sctp_sf_shut_8_4_5

2016-12-27 Thread Marcelo Ricardo Leitner
Signed-off-by: Marcelo Ricardo Leitner <marcelo.leit...@gmail.com> --- net/sctp/sm_statefuns.c | 58 - 1 file changed, 28 insertions(+), 30 deletions(-) diff --git a/net/sctp/sm_statefuns.c b/net/sctp/sm_statefuns.c

Re: [PATCH] net: dev_weight: TX/RX orthogonality

2016-12-27 Thread Marcelo Ricardo Leitner
On Tue, Dec 27, 2016 at 09:25:47AM +0100, Matthias Tafelmeier wrote: > Oftenly, introducing side effects on packet processing on the other half > of the stack by adjusting one of TX/RX via sysctl is not desirable. > There are cases of demand for asymmetric, orthogonal configurability. > > This

[PATCH net] sctp: fix recovering from 0 win with small data chunks

2016-12-23 Thread Marcelo Ricardo Leitner
gt; B.50536: sctp (1) [DATA] (B)(E) [TSN: 2490098961] [SID: 0] [S 03.866450 IP A.55173 > B.50536: sctp (1) [DATA] (B)(E) [TSN: 2490099011] [SID: 0] [S Signed-off-by: Marcelo Ricardo Leitner <marcelo.leit...@gmail.com> --- net/sctp/associola.c | 2 +- 1 file changed,

[PATCH net] sctp: do not loose window information if in rwnd_over

2016-12-23 Thread Marcelo Ricardo Leitner
146.209232] sctp: sctp_assoc_rwnd_decrease: association:88013928e000 has asoc->rwnd:0, asoc->rwnd_over:1! [ 146.209232] sctp: sctp_assoc_rwnd_decrease: asoc:88013928e000 rwnd decreased by 1 to (0, 1, 114221) Signed-off-by: Marcelo Ricardo Leitner <marcelo.leit...@gmail.com> -

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

2016-12-20 Thread Marcelo Ricardo Leitner
s to asoc's bind addr list. > > Note that we can't filter the duplicate addrs when global address list > gets updated, As NETDEV_DOWN event may remove an addr that still exists > in another NIC. > > Signed-off-by: Xin Long <lucien@gmail.com> Acked-by: Marcelo Ricardo L

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

2016-12-20 Thread Marcelo Ricardo Leitner
On Tue, Dec 20, 2016 at 01:49:49PM +0800, Xin Long wrote: > 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> Acked-by: Marcelo Ricardo Lei

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

2016-12-18 Thread Marcelo Ricardo Leitner
gt; lock. clusterip_config_find_get returns NULL if c->pde is null to make sure > it can't be used until the proc file node creation is done. > > Suggested-by: Marcelo Ricardo Leitner <marcelo.leit...@gmail.com> > Signed-off-by: Xin Long <lucien@gmail.com> Reviewed

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

2016-12-15 Thread Marcelo Ricardo Leitner
> transport and also to remove the out path. > > Fixes: 1cceda784980 ("sctp: fix the issue sctp_diag uses lock_sock in > rcu_read_lock") > Signed-off-by: Xin Long <lucien....@gmail.com> Acked-by: Marcelo Ricardo Leitner <marcelo.leit...@gmail.com> > --- &

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

2016-12-15 Thread Marcelo Ricardo Leitner
rcu_read_lock in sctp_endpoint_lookup_assoc > before calling sctp_epaddr_lookup_transport. > > Fixes: 7fda702f9315 ("sctp: use new rhlist interface on sctp transport > rhashtable") > Reported-by: Dmitry Vyukov <dvyu...@google.com> > Signed-off-by: Xin Long <lucien

Re: sctp: suspicious rcu_dereference_check() usage in sctp_epaddr_lookup_transport

2016-12-13 Thread Marcelo Ricardo Leitner
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 tainted > --- > ./include/linux/rhashtable.h:572 suspicious

[PATCH net v4] tcp: warn on bogus MSS and try to amend it

2016-12-05 Thread Marcelo Ricardo Leitner
suggestion Cc: Jonathan Maxwell <jmaxwel...@gmail.com> Signed-off-by: Marcelo Ricardo Leitner <marcelo.leit...@gmail.com> --- Thanks net/ipv4/tcp_input.c | 22 +- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_i

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

2016-12-03 Thread Marcelo Ricardo Leitner
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 enables it after dev_open in > team_port_add. > > But even if the port_dev has no carrier, like it's cable was unpluged, >

[PATCH net v3] tcp: warn on bogus MSS and try to amend it

2016-12-02 Thread Marcelo Ricardo Leitner
skb_iif to find the interface and also log its name, per Eric Dumazet suggestion. As the skb may be backlogged and the interface gone by then, we need to check if the number still has a meaning. Cc: Jonathan Maxwell <jmaxwel...@gmail.com> Signed-off-by: Marcelo Ricardo Leitner <mar

Re: [PATCH net v2] tcp: warn on bogus MSS and try to amend it

2016-12-02 Thread Marcelo Ricardo Leitner
On Fri, Dec 02, 2016 at 06:45:24AM -0800, Eric Dumazet wrote: > On Fri, 2016-12-02 at 08:55 -0200, Marcelo Ricardo Leitner wrote: > > There have been some reports lately about TCP connection stalls caused > > by NIC drivers that aren't setting gso_size on aggregated packets

[PATCH net v2] tcp: warn on bogus MSS and try to amend it

2016-12-02 Thread Marcelo Ricardo Leitner
com> Signed-off-by: Marcelo Ricardo Leitner <marcelo.leit...@gmail.com> --- v2: Updated msg as suggested by David. net/ipv4/tcp_input.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c index a27b9c0e27c08b4e4aeaff3d0bfd

[PATCH v2] netfilter: avoid warn and OOM killer on vmalloc call

2016-12-02 Thread Marcelo Ricardo Leitner
; Signed-off-by: Marcelo Ricardo Leitner <marcelo.leit...@gmail.com> --- net/netfilter/x_tables.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/net/netfilter/x_tables.c b/net/netfilter/x_tables.c index fc4977456c30e098197b4f987b758072c9cf60d9..dece525bf83a0098dad607fce665cd

Re: [PATCH] netfilter: avoid warn and OOM on vmalloc call

2016-12-01 Thread Marcelo Ricardo Leitner
On Thu, Dec 01, 2016 at 10:42:22AM +0100, Andrey Konovalov wrote: > On Wed, Nov 30, 2016 at 8:42 PM, Marcelo Ricardo Leitner > <marcelo.leit...@gmail.com> wrote: > > Hi Andrey, > > > > Please let me know how this works for you. It seems good here, though > > yo

[PATCH] netfilter: avoid warn and OOM on vmalloc call

2016-11-30 Thread Marcelo Ricardo Leitner
ver, that under such stress situation, other places may trigger OOM invocation. Reported-by: Andrey Konovalov <andreyk...@google.com> Cc: Florian Westphal <f...@strlen.de> Signed-off-by: Marcelo Ricardo Leitner <marcelo.leit...@gmail.com> --- net/netfilter/x_tables.c | 4 +++- 1 file

Re: net/sctp: vmalloc allocation failure in sctp_setsockopt/xt_alloc_table_info

2016-11-30 Thread Marcelo Ricardo Leitner
On Mon, Nov 28, 2016 at 04:18:03PM -0200, Marcelo Ricardo Leitner wrote: > On Mon, Nov 28, 2016 at 07:09:25PM +0100, Florian Westphal wrote: > > Neil Horman <nhor...@tuxdriver.com> wrote: > > > > [ trimming CCs ] > > > > > On Mon, Nov 28, 2016 a

[PATCH net] tcp: warn on bogus MSS and try to amend it

2016-11-30 Thread Marcelo Ricardo Leitner
com> Signed-off-by: Marcelo Ricardo Leitner <marcelo.leit...@gmail.com> --- net/ipv4/tcp_input.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c index a27b9c0e27c08b4e4aeaff3d0bfdf3ae561ba4d8..ecc86105eb479de9b80db71af6a1

Re: Receive offloads, small RCVBUF and zero TCP window

2016-11-28 Thread Marcelo Ricardo Leitner
On Mon, Nov 28, 2016 at 03:54:59PM -0500, David Miller wrote: > From: Alex Sidorenko > Date: Mon, 28 Nov 2016 15:49:26 -0500 > > > Now the question is whether is is OK to have icsk->icsk_ack.rcv_mss > > larger than MTU. > > It absolutely is not OK. > Would it make

Re: net/sctp: vmalloc allocation failure in sctp_setsockopt/xt_alloc_table_info

2016-11-28 Thread Marcelo Ricardo Leitner
On Mon, Nov 28, 2016 at 07:09:25PM +0100, Florian Westphal wrote: > Neil Horman wrote: > > [ trimming CCs ] > > > On Mon, Nov 28, 2016 at 06:47:10PM +0100, Florian Westphal wrote: > > > Neil Horman wrote: > > > > I'm not sure I agree with that.

Re: net/sctp: vmalloc allocation failure in sctp_setsockopt/xt_alloc_table_info

2016-11-28 Thread Marcelo Ricardo Leitner
On Mon, Nov 28, 2016 at 09:39:31AM -0500, Neil Horman wrote: > On Mon, Nov 28, 2016 at 03:33:40PM +0100, Andrey Konovalov wrote: > > On Mon, Nov 28, 2016 at 3:13 PM, Neil Horman wrote: > > > On Mon, Nov 28, 2016 at 02:00:19PM +0100, Andrey Konovalov wrote: > > >> Hi! > > >>

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

2016-11-16 Thread Marcelo Ricardo Leitner
g 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 <lucien@gmail.com> Acked-by: Marcelo Ricardo Leitner <marcelo.leit...@gmail.com> > --- > include/net/sctp/sctp.h| 2

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

2016-11-14 Thread Marcelo Ricardo Leitner
ditions and reduce > indent level. > > Fixes: d46e416c11c8 ("sctp: sctp should change socket state when shutdown is > received") > Reported-by: Andrey Konovalov <andreyk...@google.com> > Tested-by: Andrey Konovalov <andreyk...@google.com> > Signed-off-by: Xin

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

2016-11-04 Thread Marcelo Ricardo Leitner
On Fri, Nov 04, 2016 at 08:59:58AM -0400, Neil Horman wrote: > On Thu, Nov 03, 2016 at 04:35:33PM -0200, Marcelo Ricardo Leitner wrote: > > On Thu, Nov 03, 2016 at 07:02:47PM +0100, Andrey Konovalov wrote: > > > On Thu, Nov 3, 2016 at 6:52 PM, Marcelo Ricardo Leitner &

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

2016-11-04 Thread Marcelo Ricardo Leitner
Em 04-11-2016 08:55, David Laight escreveu: From: Of Marcelo Ricardo Leitner Sent: 03 November 2016 19:04 sctp_wait_for_connect() currently already holds the asoc to keep it alive during the sleep, in case another thread release it. But Andrey Konovalov and Dmitry Vyukov reported an use-after

[PATCH net] sctp: assign assoc_id earlier in __sctp_connect

2016-11-03 Thread Marcelo Ricardo Leitner
Andrey Konovalov <andreyk...@google.com> Tested-by: Andrey Konovalov <andreyk...@google.com> Signed-off-by: Marcelo Ricardo Leitner <marcelo.leit...@gmail.com> --- net/sctp/socket.c | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/net/sctp/socket.c b

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

2016-11-03 Thread Marcelo Ricardo Leitner
On Thu, Nov 03, 2016 at 07:02:47PM +0100, Andrey Konovalov wrote: > On Thu, Nov 3, 2016 at 6:52 PM, Marcelo Ricardo Leitner > <marcelo.leit...@gmail.com> wrote: > > On Thu, Nov 03, 2016 at 06:11:01PM +0100, Andrey Konovalov wrote: > >> On Wed, Nov 2, 2016 at 11:42 PM

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

2016-11-03 Thread Marcelo Ricardo Leitner
On Thu, Nov 03, 2016 at 06:11:01PM +0100, Andrey Konovalov wrote: > On Wed, Nov 2, 2016 at 11:42 PM, Andrey Konovalov <andreyk...@google.com> > wrote: > > On Wed, Oct 19, 2016 at 6:57 PM, Marcelo Ricardo Leitner > > <marcelo.leit...@gmail.com> wrote: > >> O

Re: [PATCH net-next] sctp: clean up sctp_packet_transmit

2016-11-01 Thread Marcelo Ricardo Leitner
by you also purge lots of comments from there too, but I don't miss them. > freeing auth chunk when freeing packet chunk_list in out path and freeing > head skb early if it fails to pack packet. > > Signed-off-by: Xin Long <lucien@gmail.com> Acked-by: Marcelo Ricardo Leit

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

2016-10-31 Thread Marcelo Ricardo Leitner
o hold > transport here makes more sense. > > Note that the function will be renamed later on on another patch. > > Signed-off-by: Xin Long <lucien@gmail.com> Acked-by: Marcelo Ricardo Leitner <marcelo.leit...@gmail.com> Thanks > --- > include/net/sctp/sctp.h | 2 +-

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

2016-10-31 Thread Marcelo Ricardo Leitner
this, > even if it found the transport, it was still initializing chunk->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.

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

2016-10-31 Thread Marcelo Ricardo Leitner
; that cb() still uses transport. It may cause a use-after-free issue. > > This patch 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.

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

2016-10-31 Thread Marcelo Ricardo Leitner
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(), and didn't return it back. But in > sctp_rcv, it is used to initialize chunk->transport. So when hitting this, > even

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

2016-10-28 Thread Marcelo Ricardo Leitner
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 a local variable to save the transport that is > > looked up by __sctp_lookup_association(), and didn't

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

2016-10-28 Thread Marcelo Ricardo Leitner
o hold > transport here makes more sense. > > Note that the function will be renamed later on on another patch. > > Signed-off-by: Xin Long <lucien@gmail.com> Acked-by: Marcelo Ricardo Leitner <marcelo.leit...@gmail.com> > --- > include/net/sctp/sctp.h | 2 +- > net/sc

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

2016-10-28 Thread Marcelo Ricardo Leitner
this > code, it was initializing chunk->transport with some random stack 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> Acked

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

2016-10-28 Thread Marcelo Ricardo Leitner
; that cb() still uses transport. It may cause a use-after-free issue. > > This patch 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.

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

2016-10-25 Thread Marcelo Ricardo Leitner
and subsequent ones. The fix is to just move the check upwards so it's also validated for the 1st chunk. Reported-by: Andrey Konovalov <andreyk...@google.com> Tested-by: Andrey Konovalov <andreyk...@google.com> Signed-off-by: Marcelo Ricardo Leitner <marcelo.leit...@gmail.com> --- H

Re: net/sctp: slab-out-of-bounds in sctp_sf_ootb

2016-10-25 Thread Marcelo Ricardo Leitner
4, 2016 at 9:44 PM, Marcelo Ricardo Leitner > <marcelo.leit...@gmail.com> wrote: > > Hi Andrey, > > > > On Mon, Oct 24, 2016 at 05:30:04PM +0200, Andrey Konovalov wrote: > >> The problem is that sctp_walk_errors walks the chunk before its length > >&

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 Marcelo Ricardo Leitner
On Tue, Oct 25, 2016 at 05:05:41PM +0800, Xin Long wrote: > >> 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 > >

Re: [PATCH net-next] ibmveth: calculate correct gso_size and set gso_type

2016-10-25 Thread Marcelo Ricardo Leitner
On Tue, Oct 25, 2016 at 04:13:41PM +1100, Jon Maxwell wrote: > We recently encountered a bug where a few customers using ibmveth on the > same LPAR hit an issue where a TCP session hung when large receive was > enabled. Closer analysis revealed that the session was stuck because the > one side

Re: net/sctp: slab-out-of-bounds in sctp_sf_ootb

2016-10-24 Thread Marcelo Ricardo Leitner
Hi Andrey, On Mon, Oct 24, 2016 at 05:30:04PM +0200, Andrey Konovalov wrote: > The problem is that sctp_walk_errors walks the chunk before its length > is checked for overflow. Exactly. The check is done too late, for the 2nd and subsequent chunks only. Please try the following patch, thanks.

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 Marcelo Ricardo Leitner
On Mon, Oct 24, 2016 at 02:30:07PM +0800, Xin Long wrote: > [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

Re: [Patch net v2] ipv6: fix a potential deadlock in do_ipv6_setsockopt()

2016-10-20 Thread Marcelo Ricardo Leitner
_mc_close(), > where we acquire sk_lock before rtnl_lock. Close this deadlock > with the similar solution, that is always acquire rtnl lock first. > > Fixes: baf606d9c9b1 ("ipv4,ipv6: grab rtnl before locking the socket") > Reported-by: Baozeng Ding <splovi...@gmail.com>

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

2016-10-19 Thread Marcelo Ricardo Leitner
On Wed, Oct 19, 2016 at 02:25:24PM +0200, Andrey Konovalov wrote: > Hi, > > I've got the following error report while running the syzkaller fuzzer: > > == > BUG: KASAN: use-after-free in __sctp_connect+0xabe/0xbf0 at addr >

Re: [PATCH net-next] sctp: remove the old ttl expires policy

2016-10-10 Thread Marcelo Ricardo Leitner
ace. > > Signed-off-by: Xin Long <lucien....@gmail.com> Acked-by: Marcelo Ricardo Leitner <marcelo.leit...@gmail.com> > --- > include/net/sctp/structs.h | 1 - > net/sctp/chunk.c | 32 > net/sctp/output.c | 3 ---

Re: [PATCH net-next] sctp: reuse sent_count to avoid retransmitted chunks for RTT measurements

2016-10-10 Thread Marcelo Ricardo Leitner
On Mon, Oct 10, 2016 at 02:48:25PM -0300, Marcelo Ricardo Leitner wrote: > On Sat, Oct 08, 2016 at 11:36:05AM +0800, Xin Long wrote: > > Now sctp uses chunk->resent to record if a chunk is retransmitted, for > > RTT measurements with retransmitted DATA chunks. chunk->sent_cou

Re: [PATCH net-next] sctp: reuse sent_count to avoid retransmitted chunks for RTT measurements

2016-10-10 Thread Marcelo Ricardo Leitner
t;lucien....@gmail.com> Acked-by: Marcelo Ricardo Leitner <marcelo.leit...@gmail.com> > --- > include/net/sctp/structs.h | 2 +- > net/sctp/output.c | 3 ++- > net/sctp/outqueue.c| 4 +--- > 3 files changed, 4 insertions(+), 5 deletions(-) > > diff

Re: [PATCHv2 net 0/5] sctp: some fixes of prsctp polices

2016-09-28 Thread Marcelo Ricardo Leitner
.c | 15 --- > 5 files changed, 23 insertions(+), 61 deletions(-) > Acked-by: Marcelo Ricardo Leitner <marcelo.leit...@gmail.com> Thanks

Re: [PATCH net-next] tcp: add tcp_add_backlog()

2016-09-23 Thread Marcelo Ricardo Leitner
On Fri, Sep 23, 2016 at 07:36:32AM -0700, Eric Dumazet wrote: > On Fri, 2016-09-23 at 11:09 -0300, Marcelo Ricardo Leitner wrote: > > On Fri, Sep 23, 2016 at 06:42:51AM -0700, Eric Dumazet wrote: > > > On Fri, 2016-09-23 at 09:45 -0300, Marcelo Ricardo Leitner wrote:

Re: [PATCH net-next] tcp: add tcp_add_backlog()

2016-09-23 Thread Marcelo Ricardo Leitner
On Fri, Sep 23, 2016 at 06:42:51AM -0700, Eric Dumazet wrote: > On Fri, 2016-09-23 at 09:45 -0300, Marcelo Ricardo Leitner wrote: > > > Aye. In that case, what about using tail instead of end? > > > What do you mean exactly ? Something like: -skb->truesize = SKB_TRU

Re: [PATCH net-next] tcp: add tcp_add_backlog()

2016-09-23 Thread Marcelo Ricardo Leitner
On Thu, Sep 22, 2016 at 04:21:30PM -0700, Eric Dumazet wrote: > On Thu, 2016-09-22 at 19:34 -0300, Marcelo Ricardo Leitner wrote: > > On Sat, Aug 27, 2016 at 07:37:54AM -0700, Eric Dumazet wrote: > > > +bool tcp_add_backlog(struct sock *sk, struct sk_buff *skb) > > >

Re: [PATCH net-next] tcp: add tcp_add_backlog()

2016-09-22 Thread Marcelo Ricardo Leitner
On Sat, Aug 27, 2016 at 07:37:54AM -0700, Eric Dumazet wrote: > +bool tcp_add_backlog(struct sock *sk, struct sk_buff *skb) > +{ > + u32 limit = sk->sk_rcvbuf + sk->sk_sndbuf; ^^^ ... > + if (!skb->data_len) > + skb->truesize =

[PATCH next v3 2/2] sctp: make use of SCTP_TRUNC4 macro

2016-09-21 Thread Marcelo Ricardo Leitner
And avoid the usage of '&~3'. This is the last place still not using the macro. Also break the line to make it easier to read. Signed-off-by: Marcelo Ricardo Leitner <marcelo.leit...@gmail.com> --- When I checked it the other day I thought I had this patch applied by the moment but I h

[PATCH next v3 1/2] sctp: rename WORD_TRUNC/ROUND macros

2016-09-21 Thread Marcelo Ricardo Leitner
com> Reported-by: David Miller <da...@davemloft.net> Signed-off-by: Marcelo Ricardo Leitner <marcelo.leit...@gmail.com> --- v3: - Name it SCTP_PAD4 instead of SCTP_ALIGN4, as suggested by David Laight include/net/sctp/sctp.h | 10 +- net/netfilter/xt_sctp.c | 2 +- net/sctp/as

[PATCH next v3 0/2] Rename WORD_TRUNC/ROUND macros and use them

2016-09-21 Thread Marcelo Ricardo Leitner
patch summary Details on the specific changelogs. Thanks! Marcelo Ricardo Leitner (2): sctp: rename WORD_TRUNC/ROUND macros sctp: make use of WORD_TRUNC macro include/net/sctp/sctp.h | 10 +- net/netfilter/xt_sctp.c | 2 +- net/sctp/associola.c | 2 +- net/sctp/chunk.c

Re: [PATCH next 1/2] sctp: rename WORD_TRUNC/ROUND macros

2016-09-21 Thread Marcelo Ricardo Leitner
Em 21-09-2016 07:18, David Laight escreveu: From: Marcelo Ricardo Leitner Sent: 20 September 2016 21:24 To something more meaningful these days, specially because this is working on packet headers or lengths and which are not tied to any CPU arch but to the protocol itself. So, WORD_TRUNC

Re: [PATCH next 1/2] sctp: fix the handling of SACK Gap Ack blocks

2016-09-21 Thread 'Marcelo Ricardo Leitner'
On Wed, Sep 21, 2016 at 10:21:43AM +, David Laight wrote: > From: Marcelo Ricardo Leitner > > Sent: 20 September 2016 22:19 > > sctp_acked() is using 32bit arithmetics on 16bits vars, via TSN_lte() > > macros, which is weird and confusing. > > > > Once the

[PATCH next 0/2] Rename WORD_TRUNC/ROUND macros and use them

2016-09-20 Thread Marcelo Ricardo Leitner
This patchset aims to rename these macros to a non-confusing name, as reported by David Laight and David Miller, and to update all remaining places to make use of it, which was 1 last remaining spot. v2: - fixed 2nd patch summary Details on the specific changelogs. Thanks! Marcelo Ricardo

[PATCH next v2 1/2] sctp: rename WORD_TRUNC/ROUND macros

2016-09-20 Thread Marcelo Ricardo Leitner
com> Reported-by: David Miller <da...@davemloft.net> Signed-off-by: Marcelo Ricardo Leitner <marcelo.leit...@gmail.com> --- include/net/sctp/sctp.h | 10 +- net/netfilter/xt_sctp.c | 2 +- net/sctp/associola.c | 2 +- net/sctp/chunk.c | 6 +++--- net/sctp/in

[PATCH next v2 2/2] sctp: make use of SCTP_TRUNC4 macro

2016-09-20 Thread Marcelo Ricardo Leitner
And avoid the usage of '&~3'. This is the last place still not using the macro. Also break the line to make it easier to read. Signed-off-by: Marcelo Ricardo Leitner <marcelo.leit...@gmail.com> --- When I checked it the other day I thought I had this patch applied by the moment but I h

Re: [PATCH next 2/2] sctp: make use of WORD_TRUNC macro

2016-09-20 Thread Marcelo Ricardo Leitner
On Tue, Sep 20, 2016 at 05:24:20PM -0300, Marcelo Ricardo Leitner wrote: > + max_data = SCTP_TRUNC4(max_data); Will post a v2 to fix the subject.

[PATCH next 1/2] sctp: fix the handling of SACK Gap Ack blocks

2016-09-20 Thread Marcelo Ricardo Leitner
-by: David Laight <david.lai...@aculab.com> Reported-by: David Laight <david.lai...@aculab.com> Signed-off-by: Marcelo Ricardo Leitner <marcelo.leit...@gmail.com> --- net/sctp/outqueue.c | 11 ++- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/net/sctp/out

[PATCH next 0/2] improvements to SSN and TSN handling

2016-09-20 Thread Marcelo Ricardo Leitner
First patch fixes a potential issue made visible by the second one noticed by David Laight and is a preparation for the next one. The second patch changes how SSN, TSN and ASCONF serials are compared so they can use typecheck() and are more like time_before() macro. Marcelo Ricardo Leitner (2

[PATCH next 2/2] sctp: improve how SSN, TSN and ASCONF serial are compared

2016-09-20 Thread Marcelo Ricardo Leitner
test %eax,%eax 1efb: 7e 26 jle1f23 <sctp_outq_sack+0xb3> primary->cacc.changeover_active = 0; *_lt() generated pretty much the same code. Tested with gcc (GCC) 6.1.1 20160621. This patch also removes SSN_lte as it is not used and

[PATCH next 0/2] Rename WORD_TRUNC/ROUND macros and use them

2016-09-20 Thread Marcelo Ricardo Leitner
This patchset aims to rename these macros to a non-confusing name, as reported by David Laight and David Miller, and to update all remaining places to make use of it, which was 1 last remaining spot. Details on the specific changelogs. Thanks! Marcelo Ricardo Leitner (2): sctp: rename

[PATCH next 2/2] sctp: make use of WORD_TRUNC macro

2016-09-20 Thread Marcelo Ricardo Leitner
And avoid the usage of '&~3'. This is the last place still not using the macro. Also break the line to make it easier to read. Signed-off-by: Marcelo Ricardo Leitner <marcelo.leit...@gmail.com> --- When I checked it the other day I thought I had this patch applied by the moment bu

[PATCH next 1/2] sctp: rename WORD_TRUNC/ROUND macros

2016-09-20 Thread Marcelo Ricardo Leitner
com> Reported-by: David Miller <da...@davemloft.net> Signed-off-by: Marcelo Ricardo Leitner <marcelo.leit...@gmail.com> --- include/net/sctp/sctp.h | 10 +- net/netfilter/xt_sctp.c | 2 +- net/sctp/associola.c | 2 +- net/sctp/chunk.c | 6 +++--- net/sctp/in

Re: [PATCH next] sctp: make use of WORD_TRUNC macro

2016-09-18 Thread Marcelo Ricardo Leitner
Em 18-09-2016 23:06, David Miller escreveu: From: Marcelo Ricardo Leitner <marcelo.leit...@gmail.com> Date: Thu, 15 Sep 2016 15:12:30 -0300 No functional change. Just to avoid the usage of '&~3'. Also break the line to make it easier to read. You're reply later in t

Re: [PATCH next] sctp: make use of WORD_TRUNC macro

2016-09-16 Thread 'Marcelo Ricardo Leitner'
On Fri, Sep 16, 2016 at 09:51:56AM +, David Laight wrote: > From: Marcelo Ricardo Leitner > > Sent: 15 September 2016 19:13 > > No functional change. Just to avoid the usage of '&~3'. > ... > > - max_data = (asoc->pathmtu - > > - sctp_sk(a

[PATCH next] sctp: make use of WORD_TRUNC macro

2016-09-15 Thread Marcelo Ricardo Leitner
No functional change. Just to avoid the usage of '&~3'. Also break the line to make it easier to read. Signed-off-by: Marcelo Ricardo Leitner <marcelo.leit...@gmail.com> --- net/sctp/chunk.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/net/sctp/chunk.c

[PATCH net] sctp: fix SSN comparision

2016-09-15 Thread Marcelo Ricardo Leitner
This function actually operates on u32 yet its paramteres were declared as u16, causing integer truncation upon calling. Note in patch context that ADDIP_SERIAL_SIGN_BIT is already 32 bits. Signed-off-by: Marcelo Ricardo Leitner <marcelo.leit...@gmail.com> --- This issue exists since befo

Re: [PATCHv2 net 0/6] sctp: fix the transmit err process

2016-09-14 Thread Marcelo Ricardo Leitner
nomem, > no err retruns back to users any more. Instead, they are taken care > of by retransmit. > > v1->v2: > - add more details to the changelog in patch 1/6 > - add Fixes: tag in patch 2/6, 3/6 > - also revert 69b5777f2e57 in patch 3/6 Looks good to me, th

Re: [PATCH net 1/6] sctp: remove the unnecessary state check in sctp_outq_tail

2016-09-12 Thread Marcelo Ricardo Leitner
On Sat, Sep 10, 2016 at 12:03:53AM +0800, Xin Long wrote: > > That said, have you considered the retransmit case? That is to say, if you > > queue and flush the outq, and some packets fail delivery, and in the time > > between the intial send and the expiration of the RTX timer (during which > >

Re: [PATCH net 3/6] sctp: free msg->chunks when sctp_primitive_SEND return err

2016-09-12 Thread Marcelo Ricardo Leitner
On Thu, Sep 08, 2016 at 05:31:47PM +0800, Xin Long wrote: > Last patch "sctp: do not return the transmit err back to sctp_sendmsg" > made sctp_primitive_SEND return err only when asoc state is unavailable. > In this case, chunks are not enqueued, they have no chance to be freed if > we don't take

Re: [PATCHv2 net] sctp: hold the transport before using it in sctp_hash_cmp

2016-09-12 Thread Marcelo Ricardo Leitner
") > Signed-off-by: Xin Long <lucien@gmail.com> Note that we cannot defer the free of the asoc too because that cause issues with port re-use (issue already hit and fixed in the past), as the port would be still in use during the RCU grace period. A

Re: [RFC PATCH v2 0/6] Reduce cache miss for snmp_fold_field

2016-09-06 Thread Marcelo Ricardo Leitner
On Tue, Sep 06, 2016 at 10:30:03AM +0800, Jia He wrote: ... > v2: > - 1/6 fix bug in udplite statistics. > - 1/6 snmp_seq_show is split into 2 parts > > Jia He (6): > proc: Reduce cache miss in {snmp,netstat}_seq_show > proc: Reduce cache miss in snmp6_seq_show > proc: Reduce cache miss in

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