Re: [PATCH net-next] net/smc: fix error return code in smc_setsockopt()

2018-06-01 Thread Ursula Braun
On 05/31/2018 04:31 AM, Wei Yongjun wrote: > Fix to return error code -EINVAL instead of 0 if optlen is invalid. > > Fixes: 01d2f7e2cdd3 ("net/smc: sockopts TCP_NODELAY and TCP_CORK") > Signed-off-by: Wei Yongjun > --- > net/smc/af_smc.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-)

Re: [PATCH bpf-next] bpf: prevent non-IPv4 socket to be added into sock hash

2018-06-01 Thread John Fastabend
On 05/31/2018 06:00 PM, Eric Dumazet wrote: > On Thu, May 31, 2018 at 7:32 PM John Fastabend > wrote: >> >> >> Hi Wei, >> >> Thanks for the report and fix. It would be better to fix the >> root cause so that IPv6 works as intended. >> >> I'm testing the following now, >> >> Author: John Fastabend

[PATCH net-next] rtnetlink: Fix null-ptr-deref in rtnl_newlink

2018-06-01 Thread Prashant Bhole
In rtnl_newlink(), NULL check is performed on m_ops however member of ops is accessed. Fixed by accessing member of m_ops instead of ops. [ 345.432629] BUG: KASAN: null-ptr-deref in rtnl_newlink+0x400/0x1110 [ 345.432629] Read of size 4 at addr 0088 by task ip/986 [ 345.432629] [ 3

[PATCH iproute2] devlink: don't enforce NETLINK_{CAP,EXT}_ACK sock opts

2018-06-01 Thread Ivan Vecera
Since commit 049c58539f5d ("devlink: mnlg: Add support for extended ack") devlink requires NETLINK_{CAP,EXT}_ACK. This prevents devlink from working with older kernels that don't support these features. host # ./devlink/devlink Failed to connect to devlink Netlink Fixes: 049c58539f5d ("devlink: m

[bpf PATCH] bpf: sockmap, fix crash when ipv6 sock is added

2018-06-01 Thread John Fastabend
This fixes a crash where we assign tcp_prot to IPv6 sockets instead of tcpv6_prot. Previously we overwrote the sk->prot field with tcp_prot even in the AF_INET6 case. This patch ensures the correct tcp_prot and tcpv6_prot are used. Fixes: 174a79ff9515 ("bpf: sockmap with sk redirect support") Rep

Re: [PATCH net-next] rtnetlink: Fix null-ptr-deref in rtnl_newlink

2018-06-01 Thread Eric Dumazet
On Fri, Jun 1, 2018 at 4:18 AM Prashant Bhole wrote: > > In rtnl_newlink(), NULL check is performed on m_ops however member of > ops is accessed. Fixed by accessing member of m_ops instead of ops. > > [ 345.432629] BUG: KASAN: null-ptr-deref in rtnl_newlink+0x400/0x1110 > [ 345.432629] Read of s

Re: [PATCH] net: core: improve the tx_hash calculating

2018-06-01 Thread Sergei Shtylyov
Hello! On 5/31/2018 1:14 PM, Tonghao Zhang wrote: Use the % instead of while, and it may simple code and improve the calculating. The real_num_tx_queues has been checked when allocating and setting it. Signed-off-by: Tonghao Zhang --- net/core/dev.c | 8 +++- 1 file changed, 3 insertio

Re: [PATCH net-next 1/5] net: aquantia: Ethtool based ring size configuration

2018-06-01 Thread Igor Russkikh
>> + >> +spin_lock(&aq_nic->aq_spinlock); >> + >> +if (netif_running(ndev)) >> +dev_close(ndev); > > I don't think you can hold a spinlock around dev_close()/dev_open() > calls. Thanks Jakub, think you are right, will consider changing this lock to mutex. >> +if (!netif

[RFC PATCH 00/16] bpf, bounded loop support work in progress

2018-06-01 Thread John Fastabend
This series is an early preview of ongoing work to support loops inside BPF verifier. The code is rough in spots (more rough the further you get into the series) but we have some signs of life! The following code runs and is verified, SEC("classifier_tc_loop1") int _tc_loop(struct __sk_buff *ct

[RFC PATCH 01/16] bpf: cfg: partition basic blocks for each subprog

2018-06-01 Thread John Fastabend
From: Jiong Wang "check_subprogs" has partitioned subprogs and is doing insn scan for each subprog already, this patch extends it to also partition basic blocks (BB) for each subprog. - The first insn for each subprog start a BB. - Branch (both cond and absolute) target start a BB. - Insn

[RFC PATCH 03/16] bpf: cfg: build domination tree using Tarjan algorithm

2018-06-01 Thread John Fastabend
From: Jiong Wang - When building domination information, we need to some array data structure, and need to index into them using basic block index. Calculate the basic block index during adding edges. - The Step-1 in Tarjan algorithm is to assign dfs order number for each bb in t

[RFC PATCH 05/16] bpf: cfg: detect unreachable basic blocks

2018-06-01 Thread John Fastabend
From: Jiong Wang Do unreachable basic blocks detection as a side-product of the dfs walk when building domination information. Signed-off-by: Jiong Wang Signed-off-by: John Fastabend --- kernel/bpf/cfg.c | 19 ++- kernel/bpf/cfg.h |3 ++- kernel/bpf/verifier.c

[RFC PATCH 04/16] bpf: cfg: detect loop use domination information

2018-06-01 Thread John Fastabend
From: Jiong Wang If one bb is dominating its predecessor, then there is loop. Signed-off-by: Jiong Wang Signed-off-by: John Fastabend --- kernel/bpf/cfg.c | 22 ++ kernel/bpf/cfg.h |1 + kernel/bpf/verifier.c |8 3 files changed, 31 insertions(

[RFC PATCH 02/16] bpf: cfg: add edges between basic blocks to form CFG

2018-06-01 Thread John Fastabend
From: Jiong Wang This patch add edges between basic blocks. Both edges for predecessors and successors are added. Signed-off-by: Jiong Wang Signed-off-by: John Fastabend --- kernel/bpf/cfg.c | 129 - kernel/bpf/cfg.h |1 kernel/b

[RFC PATCH 08/16] bpf: cfg: remove push_insn and check_cfg

2018-06-01 Thread John Fastabend
From: Jiong Wang As we have detected loop and unreachable insns based on domination information and call graph, there is no need of check_cfg. This patch removes check_cfg and it's associated push_insn. state prune heuristic marking as moved to check_subprog. Signed-off-by: Jiong Wang --- ke

[RFC PATCH 07/16] bpf: cfg: build call graph and detect unreachable/recursive call

2018-06-01 Thread John Fastabend
From: Jiong Wang This patch build call graph during insn scan inside check_subprogs. Then do recursive and unreachable subprog detection using call graph. Signed-off-by: Jiong Wang Signed-off-by: John Fastabend --- include/linux/bpf_verifier.h |1 kernel/bpf/cfg.c | 133

[RFC PATCH 09/16] bpf: cfg: reduce k*alloc/free call by using memory pool for allocating nodes

2018-06-01 Thread John Fastabend
From: Jiong Wang During building control flow graph, we need to build basic block nodes and edge nodes etc. These nodes needs to allocated dynamically as we don't have pre-scan pass to know how many nodes we need accurately. It is better to manage their allocation using memory pool which could re

[RFC PATCH 06/16] bpf: cfg: move find_subprog/add_subprog to cfg.c

2018-06-01 Thread John Fastabend
From: Jiong Wang This patch centre find_subprog and add_subprog to cfg.c. Signed-off-by: Jiong Wang Signed-off-by: John Fastabend --- kernel/bpf/cfg.c | 41 + kernel/bpf/cfg.h |2 ++ kernel/bpf/verifier.c | 42 -

[RFC PATCH 10/16] bpf: cfg: reduce memory usage by using singly list + compat pointer

2018-06-01 Thread John Fastabend
From: Jiong Wang Because there are going to be quite a few nodes (bb, edge etc) for a reasonable sized program, the size of cfg nodes matters. The cfg traversal used at the moment are mostly via edge which contains pointers to both src and dst basic block. The traversal is not via links between

[RFC PATCH 13/16] bpf: verifier, can ptr range be calculated with scalar ALU op

2018-06-01 Thread John Fastabend
At the moment any BPF_ADD or BPF_NEG with a pointer type will create a new pointer and destroy the register range. Then any memory access after this will fail because it looks like no bounds checking has been done, even if it was previously done on the other pointer. So patterns like this fail,

[RFC PATCH 11/16] bpf: cfg: detect irreducible loop using Eric Stoltz algorithm

2018-06-01 Thread John Fastabend
From: Jiong Wang We don't want to do any further loop bounds analysis for irreducible loop, so just reject programs containing it. The current DOM based loop detection can't detect irreducible loop. We'd use the algorithm given by Eric Stoltz to detect it. The algorithm requires DOM info. Algor

[RFC PATCH 12/16] bpf: cfg: pretty print CFG and DOM

2018-06-01 Thread John Fastabend
Add functions to pretty print the CFG and DOM table. We can also add contrib scripts to print this dot format so tools can visualize them. I at least found this helpful. Will add scripts in tools/bpf follow up patch. For development we are always printing these but should put these noisy routines

[RFC PATCH 14/16] bpf: verifier, add initial support to allow bounded loops

2018-06-01 Thread John Fastabend
Allow bounded loops if we can become convinced they will in fact terminate. At a high level this is done in steps the first two steps are done outside of the do_check routine which "runs" the instructions. 1. Use dom tree to find loops. 2. Find loop induction variable in the loop. (I use loop

[RFC PATCH 15/16] bpf: verifier, simple loop examples

2018-06-01 Thread John Fastabend
Add some simple loop examples. For now I just load these using bpftool but eventually they should have a loader simliar to test_verifier except for C snippets. We want to use C files here instead of BPF because most users will be using C clang/llvm and want to test how well this works with the cod

[RFC PATCH 16/16] bpf: tools: dbg patch to turn on debugging and add primitive examples

2018-06-01 Thread John Fastabend
While developing this I found it useful to always have the log output when dealing with bpftool. This is a quick hack to enable it but we should add a '-v' option shortly. Then add a set of good and bad loop examples to test with. These are all very basic at the moment but will get better soon. S

Re: [PATCH] net: core: improve the tx_hash calculating

2018-06-01 Thread Eric Dumazet
On 05/31/2018 06:14 AM, Tonghao Zhang wrote: > Use the % instead of while, and it may simple code and improve > the calculating. The real_num_tx_queues has been checked when > allocating and setting it. > > Signed-off-by: Tonghao Zhang > --- > net/core/dev.c | 8 +++- > 1 file changed, 3

Re: [PATCH v2 net] mlx4_core: restore optimal ICM memory allocation

2018-06-01 Thread Eric Dumazet
On 05/31/2018 09:51 PM, Qing Huang wrote: > > It would be great if you could share the test case that triggered the KASAN > report in your > environment. Our QA has been running intensive tests using 8KB or 4KB chunk > size configuration > for some time, no one has reported memory corruption

[net-next][PATCH] tcp: probe timer MUST not less than 5 minuter for tcp PMTU

2018-06-01 Thread Li RongQing
RFC4821 say: The value for this timer MUST NOT be less than 5 minutes and is recommended to be 10 minutes, per RFC 1981. Signed-off-by: Li RongQing --- net/ipv4/sysctl_net_ipv4.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/net/ipv4/sysctl_net_ipv4.c b/net/ipv4/sysctl_n

Re: [PATCH net-next v4 00/11] Modify action API for implementing lockless actions

2018-06-01 Thread Jamal Hadi Salim
On 31/05/18 08:38 AM, Vlad Buslov wrote: Hi Jamal, On current net-next I still have action with single reference after last step: ~$ sudo $TC -s actions ls action skbedit total acts 1 action order 0: skbedit mark 1 pipe

Re: [PATCH net-next] rtnetlink: Fix null-ptr-deref in rtnl_newlink

2018-06-01 Thread Ido Schimmel
On Fri, Jun 01, 2018 at 05:16:58PM +0900, Prashant Bhole wrote: > In rtnl_newlink(), NULL check is performed on m_ops however member of > ops is accessed. Fixed by accessing member of m_ops instead of ops. > > [ 345.432629] BUG: KASAN: null-ptr-deref in rtnl_newlink+0x400/0x1110 > [ 345.432629]

Re: [PATCH bpf v3 3/5] selftests/bpf: test_sockmap, fix test timeout

2018-06-01 Thread John Fastabend
On 05/30/2018 09:13 PM, Prashant Bhole wrote: > > > On 5/31/2018 4:59 AM, John Fastabend wrote: >> On 05/30/2018 12:29 PM, Alexei Starovoitov wrote: >>> On Wed, May 30, 2018 at 02:56:09PM +0900, Prashant Bhole wrote: In order to reduce runtime of tests, recently timout for select() call

Re: [PATCH bpf-next v4 1/5] selftests/bpf: test_sockmap, check test failure

2018-06-01 Thread John Fastabend
On 05/30/2018 09:42 PM, Prashant Bhole wrote: > Test failures are not identified because exit code of RX/TX threads > is not checked. Also threads are not returning correct exit code. > > - Return exit code from threads depending on test execution status > - In main thread, check the exit code of

[PATCH net] ipv4: igmp: hold wakelock to prevent delayed reports

2018-06-01 Thread Tejaswi Tanikella
On receiving a IGMPv2/v3 query, based on max_delay set in the header a timer is started to send out a response after a random time within max_delay. If the system then moves into suspend state, Report is delayed until system wakes up. In one reported scenario, on arm64 devices, max_delay was set t

Re: [PATCH bpf-next v4 3/5] selftests/bpf: test_sockmap, timing improvements

2018-06-01 Thread John Fastabend
On 05/30/2018 09:42 PM, Prashant Bhole wrote: > Currently 10us delay is too low for many tests to succeed. It needs to > be increased. Also, many corked tests are expected to hit rx timeout > irrespective of timeout value. > > - This patch sets 1000usec timeout value for corked tests because less

Re: [PATCH net-next] rtnetlink: Fix null-ptr-deref in rtnl_newlink

2018-06-01 Thread David Miller
From: Prashant Bhole Date: Fri, 1 Jun 2018 17:16:58 +0900 > In rtnl_newlink(), NULL check is performed on m_ops however member of > ops is accessed. Fixed by accessing member of m_ops instead of ops. > > [ 345.432629] BUG: KASAN: null-ptr-deref in rtnl_newlink+0x400/0x1110 > [ 345.432629] Rea

Re: [PATCH net] ipv4: igmp: hold wakelock to prevent delayed reports

2018-06-01 Thread Florian Fainelli
On 06/01/2018 07:05 AM, Tejaswi Tanikella wrote: > On receiving a IGMPv2/v3 query, based on max_delay set in the header a > timer is started to send out a response after a random time within > max_delay. If the system then moves into suspend state, Report is > delayed until system wakes up. > >

Re: [PATCH iproute2] devlink: don't enforce NETLINK_{CAP,EXT}_ACK sock opts

2018-06-01 Thread Jiri Pirko
Fri, Jun 01, 2018 at 10:18:49AM CEST, ivec...@redhat.com wrote: >Since commit 049c58539f5d ("devlink: mnlg: Add support for extended ack") >devlink requires NETLINK_{CAP,EXT}_ACK. This prevents devlink from >working with older kernels that don't support these features. > >host # ./devlink/devlink >

[PATCH net-next 1/1] net/smc: remove duplicate check in smc_setsockopt

2018-06-01 Thread Ursula Braun
From: Ursula Braun smc_setsockopt contains a check for the length specified on the setsockopt socket call. If checked, it is supposed to return with EINVAL. But the equivalent check is already contained in the preceding setsockopt call on the internal TCP socket. That means, the extra check can b

Re: [PATCH iproute2] ip: IFLA_NEW_NETNSID/IFLA_NEW_IFINDEX support

2018-06-01 Thread Nicolas Dichtel
Le 31/05/2018 à 17:51, Nicolas Dichtel a écrit : > Le 31/05/2018 à 17:46, Stephen Hemminger a écrit : >> On Thu, 31 May 2018 16:28:48 +0200 > [snip] >> This makes sense. All of linkinfo that is present should be displayed. >> >> Both netns and ifindex are really unsigned values. Use __u32 and print

Re: [PATCH V2 mlx5-next 0/2] Mellanox, mlx5 new device events

2018-06-01 Thread Doug Ledford
On Thu, 2018-05-31 at 15:36 -0400, David Miller wrote: > From: Saeed Mahameed > Date: Wed, 30 May 2018 10:59:48 -0700 > > > The following series is for mlx5-next tree [1], it adds the support of two > > new device events, from Ilan Tayari: > > > > 1. High temperature warnings. > > 2. FPGA QP err

Re: [PATCH net-next v2] net: sched: split tc_ctl_tfilter into three handlers

2018-06-01 Thread David Miller
From: Vlad Buslov Date: Thu, 31 May 2018 09:52:53 +0300 > tc_ctl_tfilter handles three netlink message types: RTM_NEWTFILTER, > RTM_DELTFILTER, RTM_GETTFILTER. However, implementation of this function > involves a lot of branching on specific message type because most of the > code is message-spe

Re: [PATCH v2] net: dsa: b53: Add BCM5389 support

2018-06-01 Thread David Miller
From: Damien Thébault Date: Thu, 31 May 2018 07:04:01 + > This patch adds support for the BCM5389 switch connected through MDIO. > > Signed-off-by: Damien Thébault Applied, thank you.

Re: [PATCH net-next v4 00/11] Modify action API for implementing lockless actions

2018-06-01 Thread Vlad Buslov
On Fri 01 Jun 2018 at 12:24, Jamal Hadi Salim wrote: > On 31/05/18 08:38 AM, Vlad Buslov wrote: > >> Hi Jamal, >> >> On current net-next I still have action with single reference after last >> step: >> ~$ sudo $TC -s actions ls action skbedit >> total acts 1 >>

[PATCH net-next v5 01/11] net: sched: use rcu for action cookie update

2018-06-01 Thread Vlad Buslov
Implement functions to atomically update and free action cookie using rcu mechanism. Reviewed-by: Marcelo Ricardo Leitner Signed-off-by: Vlad Buslov Signed-off-by: Jiri Pirko --- include/net/act_api.h | 2 +- include/net/pkt_cls.h | 1 + net/sched/act_api.c | 44 +++

[PATCH net-next v5 06/11] net: sched: add 'delete' function to action ops

2018-06-01 Thread Vlad Buslov
Extend action ops with 'delete' function. Each action type to implements its own delete function that doesn't depend on rtnl lock. Implement delete function that is required to delete actions without holding rtnl lock. Use action API function that atomically deletes action only if it is still in a

[PATCH net-next v5 00/11] Modify action API for implementing lockless actions

2018-06-01 Thread Vlad Buslov
Currently, all netlink protocol handlers for updating rules, actions and qdiscs are protected with single global rtnl lock which removes any possibility for parallelism. This patch set is a first step to remove rtnl lock dependency from TC rules update path. Recently, new rtnl registration flag RT

[PATCH net-next v5 05/11] net: sched: implement action API that deletes action by index

2018-06-01 Thread Vlad Buslov
Implement new action API function that atomically finds and deletes action from idr by index. Intended to be used by lockless actions that do not rely on rtnl lock. Reviewed-by: Marcelo Ricardo Leitner Signed-off-by: Vlad Buslov Signed-off-by: Jiri Pirko --- Changes from V1 to V2: - Rename tcf_

[PATCH net-next v5 07/11] net: sched: implement reference counted action release

2018-06-01 Thread Vlad Buslov
Implement helper delete function that uses new action ops 'delete', instead of destroying action directly. This is required so act API could delete actions by index, without holding any references to action that is being deleted. Implement function __tcf_action_put() that releases reference to act

[PATCH net-next v5 10/11] net: sched: atomically check-allocate action

2018-06-01 Thread Vlad Buslov
Implement function that atomically checks if action exists and either takes reference to it, or allocates idr slot for action index to prevent concurrent allocations of actions with same index. Use EBUSY error pointer to indicate that idr slot is reserved. Implement cleanup helper function that re

[PATCH net-next v5 08/11] net: sched: don't release reference on action overwrite

2018-06-01 Thread Vlad Buslov
Return from action init function with reference to action taken, even when overwriting existing action. Action init API initializes its fourth argument (pointer to pointer to tc action) to either existing action with same index or newly created action. In case of existing index(and bind argument i

[PATCH net-next v5 09/11] net: sched: use reference counting action init

2018-06-01 Thread Vlad Buslov
Change action API to assume that action init function always takes reference to action, even when overwriting existing action. This is necessary because action API continues to use action pointer after init function is done. At this point action becomes accessible for concurrent modifications, so u

[PATCH net-next v5 11/11] net: sched: change action API to use array of pointers to actions

2018-06-01 Thread Vlad Buslov
Act API used linked list to pass set of actions to functions. It is intrusive data structure that stores list nodes inside action structure itself, which means it is not safe to modify such list concurrently. However, action API doesn't use any linked list specific operations on this set of actions

[PATCH net-next v5 04/11] net: sched: always take reference to action

2018-06-01 Thread Vlad Buslov
Without rtnl lock protection it is no longer safe to use pointer to tc action without holding reference to it. (it can be destroyed concurrently) Remove unsafe action idr lookup function. Instead of it, implement safe tcf idr check function that atomically looks up action in idr and increments its

[PATCH net-next v5 03/11] net: sched: implement unlocked action init API

2018-06-01 Thread Vlad Buslov
Add additional 'rtnl_held' argument to act API init functions. It is required to implement actions that need to release rtnl lock before loading kernel module and reacquire if afterwards. Reviewed-by: Marcelo Ricardo Leitner Signed-off-by: Vlad Buslov Signed-off-by: Jiri Pirko --- Changes from

[PATCH net-next v5 02/11] net: sched: change type of reference and bind counters

2018-06-01 Thread Vlad Buslov
Change type of action reference counter to refcount_t. Change type of action bind counter to atomic_t. This type is used to allow decrementing bind counter without testing for 0 result. Reviewed-by: Marcelo Ricardo Leitner Signed-off-by: Vlad Buslov Signed-off-by: Jiri Pirko --- include/net/a

[PATCH net] vrf: check the original netdevice for generating redirect

2018-06-01 Thread Stephen Suryaputra
Use the right device to determine if redirect should be sent especially when using vrf. Same as well as when sending the redirect. Signed-off-by: Stephen Suryaputra --- net/ipv6/ip6_output.c | 3 ++- net/ipv6/ndisc.c | 6 ++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/

Re: [PATCH iproute2 net-next] iproute: ip route get support for sport, dport and ipproto match

2018-06-01 Thread David Ahern
On 5/30/18 11:06 AM, Roopa Prabhu wrote: > From: Roopa Prabhu > > Signed-off-by: Roopa Prabhu > --- > ip/iproute.c | 26 +- > man/man8/ip-route.8.in | 20 +++- > 2 files changed, 44 insertions(+), 2 deletions(-) applied to iproute2-next. Thanks

Re: [PATCH V2 mlx5-next 0/2] Mellanox, mlx5 new device events

2018-06-01 Thread David Miller
From: Doug Ledford Date: Fri, 01 Jun 2018 11:08:24 -0400 > On Thu, 2018-05-31 at 15:36 -0400, David Miller wrote: >> From: Saeed Mahameed >> Date: Wed, 30 May 2018 10:59:48 -0700 >> >> > The following series is for mlx5-next tree [1], it adds the support of two >> > new device events, from Ilan

[PATCH iproute2] iplink_vrf: Save device index from response for return code

2018-06-01 Thread dsahern
From: David Ahern A recent commit changed rtnl_talk_* to return the response message in allocated memory so callers need to free it. The change to name_is_vrf did not save the device index which is pointing to a struct inside the now allocated and freed memory resulting in garbage getting returne

ndo_star_xmit() - resevered head and tailroom

2018-06-01 Thread Alexander Aring
Hi netdev community, I am again on bug fixing in 6lowpan branch and thought that my needed_headroom and needed_tailroom of net_device are available inside my ndo_start_xmit() callback. In case of a UDP socket, it was not the case. I send a fix now to use skb_expand_copy() to make sure this space

Re: [PATCH V2 mlx5-next 0/2] Mellanox, mlx5 new device events

2018-06-01 Thread Leon Romanovsky
On Fri, Jun 01, 2018 at 11:45:58AM -0400, David Miller wrote: > From: Doug Ledford > Date: Fri, 01 Jun 2018 11:08:24 -0400 > > > On Thu, 2018-05-31 at 15:36 -0400, David Miller wrote: > >> From: Saeed Mahameed > >> Date: Wed, 30 May 2018 10:59:48 -0700 > >> > >> > The following series is for mlx5

[PATCH net] net/packet: refine check for priv area size

2018-06-01 Thread Eric Dumazet
syzbot was able to trick af_packet again [1] Various commits tried to address the problem in the past, but failed to take into account V3 header size. [1] tpacket_rcv: packet too big, clamped from 72 to 4294967224. macoff=96 BUG: KASAN: use-after-free in prb_run_all_ft_ops net/packet/af_packet.c

Re: [PATCH V2 mlx5-next 0/2] Mellanox, mlx5 new device events

2018-06-01 Thread Doug Ledford
On Fri, 2018-06-01 at 19:21 +0300, Leon Romanovsky wrote: > On Fri, Jun 01, 2018 at 11:45:58AM -0400, David Miller wrote: > > From: Doug Ledford > > Date: Fri, 01 Jun 2018 11:08:24 -0400 > > > > > On Thu, 2018-05-31 at 15:36 -0400, David Miller wrote: > > > > From: Saeed Mahameed > > > > Date: W

Re: [PATCH V2 mlx5-next 0/2] Mellanox, mlx5 new device events

2018-06-01 Thread Doug Ledford
On Fri, 2018-06-01 at 11:45 -0400, David Miller wrote: > From: Doug Ledford > Date: Fri, 01 Jun 2018 11:08:24 -0400 > > > On Thu, 2018-05-31 at 15:36 -0400, David Miller wrote: > >> From: Saeed Mahameed > >> Date: Wed, 30 May 2018 10:59:48 -0700 > >> > >> > The following series is for mlx5-next

Re: [PATCH iproute2] iplink_vrf: Save device index from response for return code

2018-06-01 Thread Phil Sutter
On Fri, Jun 01, 2018 at 08:50:16AM -0700, dsah...@kernel.org wrote: > From: David Ahern > > A recent commit changed rtnl_talk_* to return the response message in > allocated memory so callers need to free it. The change to name_is_vrf > did not save the device index which is pointing to a struct

Re: [PATCH V2 mlx5-next 0/2] Mellanox, mlx5 new device events

2018-06-01 Thread David Miller
From: Leon Romanovsky Date: Fri, 1 Jun 2018 19:21:26 +0300 > Of course, it is harmless for both of you to pull, but it looks like > extra work which is not needed for you. Just put net-next or rdma-next in the subject line(s) and that will make it very clear what it expected to happen.

Re: pull request (net): ipsec 2018-05-31

2018-06-01 Thread David Miller
From: Steffen Klassert Date: Thu, 31 May 2018 12:23:24 +0200 > 1) Avoid possible overflow of the offset variable >in _decode_session6(), this fixes an infinite >lookp there. From Eric Dumazet. > > 2) We may use an error pointer in the error path of >xfrm_bundle_create(). Fix this by

Re: [PATCH] net: core: improve the tx_hash calculating

2018-06-01 Thread David Miller
From: Tonghao Zhang Date: Thu, 31 May 2018 03:14:01 -0700 > Use the % instead of while, and it may simple code and improve > the calculating. The real_num_tx_queues has been checked when > allocating and setting it. > > Signed-off-by: Tonghao Zhang The loop is there to avoid the expensive modu

Re: [PATCH net v2 0/2] ip[6] tunnels: fix mtu calculations

2018-06-01 Thread David Miller
From: Nicolas Dichtel Date: Thu, 31 May 2018 10:59:31 +0200 > The first patch restores the possibility to bind an ip4 tunnel to an > interface whith a large mtu. > The second patch was spotted after the first fix. I also target it to net > because it fixes the max mtu value that can be used for i

Re: suspicius csum initialization in vmxnet3_rx_csum

2018-06-01 Thread Ronak Doshi
On Thu, 31 May 2018, Neil Horman wrote: > On Thu, May 31, 2018 at 11:02:34AM -0700, Ronak Doshi wrote: > > > > On Wed, 30 May 2018, Paolo Abeni wrote: > > > > > Hi, > > > > > > On Thu, 2018-05-24 at 21:48 +, Guolin Yang wrote: > > > > Yes, that code is not correct, we should fix that co

Re: [PATCH net-next 0/9] Test mirror-to-gretap with bridge in UL

2018-06-01 Thread David Miller
From: Petr Machata Date: Thu, 31 May 2018 19:51:56 +0200 > This patchset adds more tests to the mirror-to-gretap suite where bridge > is present in the underlay. Specifically it adds tests for bridge VLAN > handling, FDB, and bridge port STP status. > > In patches #1-#3, the codebase is refactor

Re: [PATCH bpf-next] bpf: prevent non-IPv4 socket to be added into sock hash

2018-06-01 Thread John Fastabend
On 06/01/2018 12:56 AM, John Fastabend wrote: > On 05/31/2018 06:00 PM, Eric Dumazet wrote: >> On Thu, May 31, 2018 at 7:32 PM John Fastabend >> wrote: >>> >>> >>> Hi Wei, >>> >>> Thanks for the report and fix. It would be better to fix the >>> root cause so that IPv6 works as intended. >>> >>> I

Re: [PATCH V2 mlx5-next 0/2] Mellanox, mlx5 new device events

2018-06-01 Thread Leon Romanovsky
On Fri, Jun 01, 2018 at 01:08:18PM -0400, David Miller wrote: > From: Leon Romanovsky > Date: Fri, 1 Jun 2018 19:21:26 +0300 > > > Of course, it is harmless for both of you to pull, but it looks like > > extra work which is not needed for you. > > Just put net-next or rdma-next in the subject line

[bpf PATCH v2] bpf: sockmap, fix crash when ipv6 sock is added

2018-06-01 Thread John Fastabend
This fixes a crash where we assign tcp_prot to IPv6 sockets instead of tcpv6_prot. Previously we overwrote the sk->prot field with tcp_prot even in the AF_INET6 case. This patch ensures the correct tcp_prot and tcpv6_prot are used. Further, only allow ESTABLISHED connections to join the map per no

Re: [PATCH iproute2 v2] ipaddress: strengthen check on 'label' input

2018-06-01 Thread Stephen Hemminger
On Tue, 29 May 2018 16:57:07 +0200 Patrick Talbert wrote: > As mentioned in the ip-address man page, an address label must > be equal to the device name or prefixed by the device name > followed by a colon. Currently the only check on this input is > to see if the device name appears at the begin

Re: [bpf PATCH v2] bpf: sockmap, fix crash when ipv6 sock is added

2018-06-01 Thread Eric Dumazet
On 06/01/2018 03:46 PM, John Fastabend wrote: > This fixes a crash where we assign tcp_prot to IPv6 sockets instead > of tcpv6_prot. ... > + /* ULPs are currently supported only for TCP sockets in ESTABLISHED > + * state. Supporting sockets in LISTEN state will require us to > +

Re: [PATCH v2 iproute2-next] ip route: print RTA_CACHEINFO if it exists

2018-06-01 Thread Stephen Hemminger
On Wed, 30 May 2018 08:30:09 -0700 dsah...@kernel.org wrote: > From: David Ahern > > RTA_CACHEINFO can be sent for non-cloned routes. If the attribute is > present print it. Allows route dumps to print expires times for example > which can exist on FIB entries. > > Signed-off-by: David Ahern

Re: [PATCH iproute2] ip: IFLA_NEW_NETNSID/IFLA_NEW_IFINDEX support

2018-06-01 Thread Stephen Hemminger
On Fri, 1 Jun 2018 17:02:18 +0200 Nicolas Dichtel wrote: > Le 31/05/2018 à 17:51, Nicolas Dichtel a écrit : > > Le 31/05/2018 à 17:46, Stephen Hemminger a écrit : > >> On Thu, 31 May 2018 16:28:48 +0200 > > [snip] > >> This makes sense. All of linkinfo that is present should be displayed. >

Re: [PATCH] iproute2: fix 'ip xfrm monitor all' command

2018-06-01 Thread Stephen Hemminger
On Wed, 30 May 2018 12:11:32 -0700 Nathan Harold wrote: > Currently, calling 'ip xfrm monitor all' will > actually invoke the 'all-nsid' command because the > soft-match for 'all-nsid' occurs before the precise > match for 'all'. This patch rearranges the checks > so that the 'all' command, itsel

Re: [PATCH rdma-next v3 05/14] IB/uverbs: Add create/destroy counters support

2018-06-01 Thread Jason Gunthorpe
> diff --git a/drivers/infiniband/core/uverbs_std_types_counters.c > b/drivers/infiniband/core/uverbs_std_types_counters.c > new file mode 100644 > index ..a5bc50ceee13 > +++ b/drivers/infiniband/core/uverbs_std_types_counters.c > @@ -0,0 +1,100 @@ > +/* SPDX-License-Identifier: ((GPL-

Re: [PATCH rdma-next v3 00/14] Verbs flow counters support

2018-06-01 Thread Jason Gunthorpe
On Thu, May 31, 2018 at 04:43:27PM +0300, Leon Romanovsky wrote: > From: Leon Romanovsky > > Changelog: > v2->v3: > * Change function mlx5_fc_query signature to hide the details of >internal core driver struct mlx5_fc > * Add commen to data[] field at struct mlx5_ib_flow_counters_data > (m

Re: [PATCH 0/4] RFC CPSW switchdev mode

2018-06-01 Thread Grygorii Strashko
Hi Ilias, On 05/24/2018 01:56 AM, Ilias Apalodimas wrote: > Hello, > > This is adding a new mode on the cpsw driver based around switchdev. > In order to enable this you need to enable CONFIG_NET_SWITCHDEV, > CONFIG_BRIDGE_VLAN_FILTERING, CONFIG_TI_CPSW_SWITCHDEV > and add to udev config: > > SU

Re: [PATCH 4/4] cpsw: add switchdev support

2018-06-01 Thread Florian Fainelli
On 05/24/2018 09:56 PM, Ilias Apalodimas wrote: > On Thu, May 24, 2018 at 06:39:04PM +0200, Andrew Lunn wrote: >> On Thu, May 24, 2018 at 04:32:34PM +0300, Ilias Apalodimas wrote: >>> On Thu, May 24, 2018 at 03:12:29PM +0200, Andrew Lunn wrote: Device tree is supposed to describe the hardwa

Re: [net-next:master 375/376] net/core/rtnetlink.c:3099:1: warning: the frame size of 1280 bytes is larger than 1024 bytes

2018-06-01 Thread Kees Cook
On Thu, May 31, 2018 at 10:07 PM, kbuild test robot wrote: > tree: https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git > master > head: 4b8e6ac41a594ea67ded6af6af5935f03221ea4c > commit: ccf8dbcd062a930e64741c939ca784d15316aa0c [375/376] rtnetlink: Remove > VLA usage > config:

Re: [PATCH net-next] rtnetlink: Fix null-ptr-deref in rtnl_newlink

2018-06-01 Thread Kees Cook
On Fri, Jun 1, 2018 at 1:26 AM, Eric Dumazet wrote: > On Fri, Jun 1, 2018 at 4:18 AM Prashant Bhole > wrote: >> >> In rtnl_newlink(), NULL check is performed on m_ops however member of >> ops is accessed. Fixed by accessing member of m_ops instead of ops. >> >> [ 345.432629] BUG: KASAN: null-ptr

Re: suspicius csum initialization in vmxnet3_rx_csum

2018-06-01 Thread Neil Horman
On Fri, Jun 01, 2018 at 11:10:01AM -0700, Ronak Doshi wrote: > > > On Thu, 31 May 2018, Neil Horman wrote: > > > On Thu, May 31, 2018 at 11:02:34AM -0700, Ronak Doshi wrote: > > > > > > On Wed, 30 May 2018, Paolo Abeni wrote: > > > > > > > Hi, > > > > > > > > On Thu, 2018-05-24 at 21:48 +

Re: [PATCH V2 mlx5-next 0/2] Mellanox, mlx5 new device events

2018-06-01 Thread Saeed Mahameed
On Thu, 2018-05-31 at 15:36 -0400, David Miller wrote: > From: Saeed Mahameed > Date: Wed, 30 May 2018 10:59:48 -0700 > > > The following series is for mlx5-next tree [1], it adds the support > > of two > > new device events, from Ilan Tayari: > > > > 1. High temperature warnings. > > 2. FPGA QP

Re: [PATCH V2 mlx5-next 0/2] Mellanox, mlx5 new device events

2018-06-01 Thread Saeed Mahameed
On Fri, 2018-06-01 at 17:13 -0700, sae...@mellanox.com wrote: > On Thu, 2018-05-31 at 15:36 -0400, David Miller wrote: > > From: Saeed Mahameed > > Date: Wed, 30 May 2018 10:59:48 -0700 > > > > > The following series is for mlx5-next tree [1], it adds the > > > support > > > of two > > > new devi

[net-next 04/17] net/mlx5e: Remove redundant active_channels indication

2018-06-01 Thread Saeed Mahameed
From: Eran Ben Elisha Now, when all channels stats are saved regardless of the channel's state {open, closed}, we can safely remove this indication and the stats spin lock which protects it. Fixes: 76c3810bade3 ("net/mlx5e: Avoid reset netdev stats on configuration changes") Signed-off-by: Eran

[PATCH 05/20] netfilter: nf_tables: remove synchronize_rcu in commit phase

2018-06-01 Thread Pablo Neira Ayuso
From: Florian Westphal synchronize_rcu() is expensive. The commit phase currently enforces an unconditional synchronize_rcu() after incrementing the generation counter. This is to make sure that a packet always sees a consistent chain, either nft_do_chain is still using old generation (it will

[net-next 05/17] net/mlx5e: Increase aRFS flow tables size

2018-06-01 Thread Saeed Mahameed
From: Maor Gottlieb Increase the aRFS flow table size to 64k so it could contain up to 64k different streams. Signed-off-by: Maor Gottlieb Signed-off-by: Saeed Mahameed --- drivers/net/ethernet/mellanox/mlx5/core/en_arfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dr

[pull request][net-next 00/17] Mellanox, mlx5e updates 2018-06-01

2018-06-01 Thread Saeed Mahameed
Hi dave, Sorry for the extra 2 patches in this series, but mostly the series contains small patches and some fixes to previous patches in this submission window, with one main patch from Tariq to improve legacy RQ buffer management, for more information please refer to that tag log below. Please

[net-next 01/17] net/mlx5e: IPOIB, Fix overflowing SQ WQE memset

2018-06-01 Thread Saeed Mahameed
From: Tariq Toukan IPoIB WQE size is larger than a single WQEBB. Must not fetch the WQE, and surely not memset it, until it is guaranteed that there are enough WQEBBs available before getting to SQ/frag edge. Fixes: 043dc78ecf07 ("net/mlx5e: TX, Use actual WQE size for SQ edge fill") Signed-off

[net-next 16/17] net/mlx5e: RX, Always prefer Linear SKB configuration

2018-06-01 Thread Saeed Mahameed
From: Tariq Toukan Prefer the linear SKB configuration of Legacy RQ over the non-linear one of Striding RQ. This implies that ConnectX-4 LX now uses legacy RQ by default, as it does not support the linear configuration of Striding RQ. Signed-off-by: Tariq Toukan Signed-off-by: Saeed Mahameed

[net-next 17/17] net/mlx5e: TX, Separate cachelines of xmit and completion stats

2018-06-01 Thread Saeed Mahameed
From: Tariq Toukan Avoid false sharing of cachelines by separating the cachelines of TX stats that are dertied in xmit flow and in completion flow. Signed-off-by: Tariq Toukan Signed-off-by: Saeed Mahameed --- drivers/net/ethernet/mellanox/mlx5/core/en_stats.c | 8 drivers/net/ethern

[net-next 15/17] net/mlx5e: RX, Enhance legacy Receive Queue memory scheme

2018-06-01 Thread Saeed Mahameed
From: Tariq Toukan Enhance the memory scheme of the legacy RQ, such that only order-0 pages are used. Whenever possible, prefer using a linear SKB, and build it wrapping the WQE buffer. Otherwise (for example, jumbo frames on x86), use non-linear SKB, with as many frags as needed. In this case,

[net-next 12/17] net/mlx5e: RX, Remove HW LRO support in legacy RQ

2018-06-01 Thread Saeed Mahameed
From: Tariq Toukan Current LRO implementation in Legacy RQ uses high-order pages. In downstream patches of this series we complete the transition to using only order-0 pages in RX datapath (which was already done in Striding RQ). Unlike the more advanced Striding RQ, Legacy RQ does not make reus

[net-next 02/17] net/mlx5e: IPOIB, Add a missing skb_pull

2018-06-01 Thread Saeed Mahameed
From: Tariq Toukan A call to mlx5e_tx_skb_pull_inline was mistakenly dropped in the cited patch. Get it back. Fixes: 043dc78ecf07 ("net/mlx5e: TX, Use actual WQE size for SQ edge fill") Signed-off-by: Tariq Toukan Signed-off-by: Saeed Mahameed --- drivers/net/ethernet/mellanox/mlx5/core/en_tx

[net-next 03/17] net/mlx5e: Present SW stats when state is not opened

2018-06-01 Thread Saeed Mahameed
From: Eran Ben Elisha The driver can present all SW stats even when the state not opened. Fixed get strings, count and stats to support it. In addition, fix tc2txq to hold a static mapping which doesn't depend on the amount of open channels, and cannot have the same value on two different cells

[net-next 06/17] net/mlx5e: Support configurable MTU for vport representors

2018-06-01 Thread Saeed Mahameed
From: Adi Nissim The representor MTU was hard coded to 1500 bytes. Allow setting arbitrary MTU values up to the max supported by the FW. Signed-off-by: Adi Nissim Reviewed-by: Or Gerlitz Signed-off-by: Saeed Mahameed --- drivers/net/ethernet/mellanox/mlx5/core/en.h | 4 drivers/ne

  1   2   >