Re: [PATCH net] sctp: not allow to set rto_min with a value below 200 msecs

2018-05-27 Thread Michael Tuexen
> On 26. May 2018, at 17:50, Dmitry Vyukov wrote: > > On Sat, May 26, 2018 at 5:42 PM, Michael Tuexen > wrote: >>> On 25. May 2018, at 21:13, Neil Horman wrote: >>> >>> On Sat, May 26, 2018 at 01:41:02AM +0800, Xin Long wrote: syzbot reported a rcu_sched self-detected stall on CPU which i

[PATCH rdma-next v1 07/13] IB/core: Support passing uhw for create_flow

2018-05-27 Thread Leon Romanovsky
From: Matan Barak This is required when user-space drivers need to pass extra information regarding how to handle this flow steering specification. Reviewed-by: Yishai Hadas Signed-off-by: Matan Barak Signed-off-by: Boris Pismenny Signed-off-by: Leon Romanovsky --- drivers/infiniband/core/u

[PATCH rdma-next v1 09/13] IB/uverbs: Add support for flow counters

2018-05-27 Thread Leon Romanovsky
From: Raed Salem The struct ib_uverbs_flow_spec_action_count associates a counters object with the flow. Post this association the flow counters can be read via the counters object. Reviewed-by: Yishai Hadas Signed-off-by: Raed Salem Signed-off-by: Leon Romanovsky --- drivers/infiniband/cor

[PATCH rdma-next v1 01/13] IB/uverbs: Add an ib_uobject getter to ioctl() infrastructure

2018-05-27 Thread Leon Romanovsky
From: Matan Barak Previously, the user had to dig inside the attribute to get the uobject. Add a helper function that correctly extract it (and do the required checks) for him/her. Signed-off-by: Matan Barak Signed-off-by: Leon Romanovsky --- drivers/infiniband/core/uverbs_std_types_cq.c

[PATCH rdma-next v1 00/13] Verbs flow counters support

2018-05-27 Thread Leon Romanovsky
From: Leon Romanovsky Changelog v0->v1: * Decouple from DevX submission * Use uverbs_attr_get_obj at counters read method * Added define for max read buffer size (MAX_COUNTERS_BUFF_SIZE) * Removed the struct mlx5_ib_flow_counter basic_flow_cnts and the related structs used, used define ins

[PATCH rdma-next v1 06/13] IB/uverbs: Add read counters support

2018-05-27 Thread Leon Romanovsky
From: Raed Salem This patch exposes the read counters verb to user space applications. By that verb the user can read the hardware counters which are associated with the counters object. The application needs to provide a sufficient memory to hold the statistics. Reviewed-by: Yishai Hadas Sign

[PATCH rdma-next v1 04/13] IB/uverbs: Add create/destroy counters support

2018-05-27 Thread Leon Romanovsky
From: Raed Salem User space application which uses counters functionality, is expected to allocate/release the counters resources by calling create/destroy verbs and in turn get a unique handle that can be used to attach the counters to its counted type. Reviewed-by: Yishai Hadas Signed-off-by:

[PATCH rdma-next v1 03/13] IB/core: Introduce counters object and its create/destroy

2018-05-27 Thread Leon Romanovsky
From: Raed Salem A verbs application may need to get statistics and info on various aspects of a verb object (e.g. Flow, QP, ...), in general case the application will state which object's counters its interested in (we refer to this action as attach), bind this new counters object to the appropr

[PATCH rdma-next v1 10/13] IB/mlx5: Add counters create and destroy support

2018-05-27 Thread Leon Romanovsky
From: Raed Salem This patch implements the device counters create and destroy APIs and introducing some internal management structures. Downstream patches in this series will add the functionality to support flow counters binding and reading. Reviewed-by: Yishai Hadas Signed-off-by: Raed Salem

[PATCH rdma-next v1 11/13] IB/mlx5: Add flow counters binding support

2018-05-27 Thread Leon Romanovsky
From: Raed Salem Associates a counters with a flow when IB_FLOW_SPEC_ACTION_COUNT is part of the flow specifications. The counters user space placements of location and description (index, description) pairs are passed as private data of the counters flow specification. Reviewed-by: Yishai Hada

[PATCH rdma-next v1 12/13] IB/mlx5: Add flow counters read support

2018-05-27 Thread Leon Romanovsky
From: Raed Salem Implements the flow counters read wrapper. Reviewed-by: Yishai Hadas Signed-off-by: Raed Salem Signed-off-by: Leon Romanovsky --- drivers/infiniband/hw/mlx5/main.c| 16 drivers/infiniband/hw/mlx5/mlx5_ib.h | 11 +++ 2 files changed, 27 insertions

[PATCH mlx5-next v1 02/13] net/mlx5: Export flow counter related API

2018-05-27 Thread Leon Romanovsky
From: Raed Salem Exports counters API to be used in both IB and EN. Reviewed-by: Yishai Hadas Signed-off-by: Raed Salem Signed-off-by: Leon Romanovsky --- drivers/net/ethernet/mellanox/mlx5/core/fs_core.h | 23 -- .../net/ethernet/mellanox/mlx5/core/fs_counters.c | 3 +

[PATCH rdma-next v1 05/13] IB/core: Introduce counters read verb

2018-05-27 Thread Leon Romanovsky
From: Raed Salem The user supplies counters instance and a reference to an output array of uint64_t. The driver reads the hardware counters values and writes them to the output index location in the user supplied array. All counters values are represented as uint64_t types. To be able to success

[PATCH rdma-next v1 13/13] IB/mlx5: Add counters read support

2018-05-27 Thread Leon Romanovsky
From: Raed Salem This patch implements the uverbs counters read API, it will use the specific read counters function to the given type to accomplish its task. Reviewed-by: Yishai Hadas Signed-off-by: Raed Salem Signed-off-by: Leon Romanovsky --- drivers/infiniband/hw/mlx5/main.c | 44 +++

[PATCH rdma-next v1 08/13] IB/core: Add support for flow counters

2018-05-27 Thread Leon Romanovsky
From: Raed Salem A counters object could be attached to flow on creation by providing the counter specification action. General counters description which count packets and bytes are introduced, downstream patches from this series will use them as part of flow counters binding. In addition, inc

[PATCH mlx5-next 1/3] net/mlx5: Exposing a new mini-CQE format

2018-05-27 Thread Leon Romanovsky
From: Yonatan Cohen The new mini-CQE format includes byte-count, checksum and stride index. Reviewed-by: Yishai Hadas Reviewed-by: Guy Levi Signed-off-by: Yonatan Cohen Signed-off-by: Leon Romanovsky --- include/linux/mlx5/mlx5_ifc.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)

[PATCH rdma-next 3/3] IB/mlx5: Introduce a new mini-CQE format

2018-05-27 Thread Leon Romanovsky
From: Yonatan Cohen The new mini-CQE format includes the stride index, byte count and packet checksum. Stride index is needed for striding WQ feature. This patch exposes this capability and enables its setting via mlx5 UHW data as part of query device and cq creation. Reviewed-by: Yishai Hadas

[PATCH rdma-next 0/3] Introduce new mlx5 CQE format

2018-05-27 Thread Leon Romanovsky
From: Leon Romanovsky Introduce new internal to mlx5 CQE format - mini-CQE. It is a CQE in compressed form that holds data needed to extra a single full CQE. It stride index, byte count and packet checksum. Thanks Yonatan Cohen (3): net/mlx5: Exposing a new mini-CQE format IB/mlx5: Refacto

[PATCH rdma-next 2/3] IB/mlx5: Refactor CQE compression response

2018-05-27 Thread Leon Romanovsky
From: Yonatan Cohen Refactor CQE compression response to be fully set only when it`s really supported. There is no change from user perspective because anyway resp.cqe_comp_caps.max_num was set to zero. Reviewed-by: Yishai Hadas Signed-off-by: Yonatan Cohen W Signed-off-by: Leon Romanovsky ---

[PATCH v5 3/3] bpf: add selftest for lirc_mode2 type program

2018-05-27 Thread Sean Young
This is simple test over rc-loopback. Acked-by: Yonghong Song Signed-off-by: Sean Young --- tools/bpf/bpftool/prog.c | 1 + tools/include/uapi/linux/bpf.h| 53 - tools/include/uapi/linux/lirc.h | 217 ++ tools/lib/bpf/lib

[PATCH v5 1/3] bpf: bpf_prog_array_copy() should return -ENOENT if exclude_prog not found

2018-05-27 Thread Sean Young
This makes is it possible for bpf prog detach to return -ENOENT. Acked-by: Yonghong Song Signed-off-by: Sean Young --- kernel/bpf/core.c| 11 +-- kernel/trace/bpf_trace.c | 2 ++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/kernel/bpf/core.c b/kernel/bpf/core

[PATCH v5 0/3] IR decoding using BPF

2018-05-27 Thread Sean Young
The kernel IR decoders (drivers/media/rc/ir-*-decoder.c) support the most widely used IR protocols, but there are many protocols which are not supported[1]. For example, the lirc-remotes[2] repo has over 2700 remotes, many of which are not supported by rc-core. There is a "long tail" of unsupported

[PATCH v5 2/3] media: rc: introduce BPF_PROG_LIRC_MODE2

2018-05-27 Thread Sean Young
Add support for BPF_PROG_LIRC_MODE2. This type of BPF program can call rc_keydown() to reported decoded IR scancodes, or rc_repeat() to report that the last key should be repeated. The bpf program can be attached to using the bpf(BPF_PROG_ATTACH) syscall; the target_fd must be the /dev/lircN devic

[PATCH bpf 2/2] bpf: enforce usage of __aligned_u64 in the UAPI header

2018-05-27 Thread Eugene Syromiatnikov
Use __aligned_u64 instead of __u64 everywhere in the UAPI header, similarly to v4.17-rc1~94^2~58^2 "RDMA: Change all uapi headers to use __aligned_u64 instead of __u64". This commit doesn't change structure layouts, but imposes additional alignment requirements on struct bpf_stack_build_id, struct

[PATCH bpf 1/2] bpf: fix alignment of netns_dev/netns_ino fields in bpf_{map,prog}_info

2018-05-27 Thread Eugene Syromiatnikov
Recent introduction of netns_dev/netns_ino to bpf_map_info/bpf_prog info has broken compat, as offsets of these fields are different in 32-bit and 64-bit ABIs. One fix (other than implementing compat support in syscall in order to handle this discrepancy) is to use __aligned_u64 instead of __u64 f

[PATCH bpf 0/2] Use __aligned_u64 in UAPI fields

2018-05-27 Thread Eugene Syromiatnikov
Hello. It was discovered during strace development that struct bpf_map_info and struct bpf_prog_info now have different layouts of i386/compat and x86_64. Since it's already broken and bpf syscall has no separate compat (as far as I can see), and the affecting change was introduced recently (in Li

Re: [PATCH net] mlxsw: spectrum: Forbid creation of VLAN 1 over port/LAG

2018-05-27 Thread Jiri Pirko
Sun, May 27, 2018 at 08:48:41AM CEST, ido...@mellanox.com wrote: >From: Petr Machata > >VLAN 1 is internally used for untagged traffic. Prevent creation of >explicit netdevice for that VLAN, because that currently isn't supported >and leads to the NULL pointer dereference cited below. > >Fix by pr

[PATCH] iptables-compat: homogenize error message

2018-05-27 Thread Arushi Singhal
There is a difference between error messages in iptables and iptables-compat: #sudo iptables-compat -D INPUT 4 iptables: No chain/target/match by that name. #sudo iptables -D INPUT 4 iptables: Index of deletion too big. Now, will show same error message. Signed-off-by: Arushi Singhal --- ipta

[PATCH net-next 0/7] net: Add address attribute to control metric of prefix route

2018-05-27 Thread dsahern
From: David Ahern For use cases such as VRR (Virtual Router Redundancy) interface managers want efficient control over the order of prefix routes when multiple interfaces have addresses with overlapping/duplicate subnets. Currently, if two interfaces have addresses in the same subnet, the order

[PATCH net-next 7/7] selftests: fib_tests: Add prefix route tests with metric

2018-05-27 Thread dsahern
From: David Ahern Add tests verifying prefix routes are inserted with expected metric. IPv6 prefix route tests TEST: Default metric [ OK ] TEST: User specified metric on first device [ OK ] TEST: User specified metric on second devic

[PATCH iproute2-next] ipaddress: Add support for address metric

2018-05-27 Thread dsahern
From: David Ahern Add support for IFA_RT_PRIORITY using the same keywords as iproute for RTA_PRIORITY. Signed-off-by: David Ahern --- include/uapi/linux/if_addr.h | 1 + ip/ipaddress.c | 15 ++- man/man8/ip-address.8.in | 6 ++ 3 files changed, 21 insertions

[PATCH net-next 1/7] net/ipv6: Convert ipv6_add_addr to struct ifa6_config

2018-05-27 Thread dsahern
From: David Ahern Move config parameters for adding an ipv6 address to a struct. struct names stem from inet6_rtm_newaddr which is the modern handler for adding an address. Start the conversion to ifa6_config with ipv6_add_addr. This is an argument move only; no functional change intended. Mappi

[PATCH net-next 3/7] net/ipv6: Pass ifa6_config struct to inet6_addr_modify

2018-05-27 Thread dsahern
From: David Ahern Update inet6_addr_modify to take ifa6_config argument versus a parameter list. This is an argument move only; no functional change intended. Signed-off-by: David Ahern --- net/ipv6/addrconf.c | 44 +++- 1 file changed, 23 insertions(+),

[PATCH net-next 5/7] net/ipv4: Add support for specifying metric of connected routes

2018-05-27 Thread dsahern
From: David Ahern Add support for IFA_RT_PRIORITY to ipv4 addresses. If the metric is changed on an existing address then the new route is inserted before removing the old one. Since the metric is one of the route keys, the prefix route can not be replaced. Signed-off-by: David Ahern --- incl

[PATCH net-next 6/7] net/ipv6: Add support for specifying metric of connected routes

2018-05-27 Thread dsahern
From: David Ahern Add support for IFA_RT_PRIORITY to ipv6 addresses. If the metric is changed on an existing address then the new route is inserted before removing the old one. Since the metric is one of the route keys, the prefix route can not be atomically replaced. Signed-off-by: David Ahern

[PATCH net-next 2/7] net/ipv6: Pass ifa6_config struct to inet6_addr_add

2018-05-27 Thread dsahern
From: David Ahern Move the creation of struct ifa6_config up to callers of inet6_addr_add. Signed-off-by: David Ahern --- net/ipv6/addrconf.c | 112 ++-- 1 file changed, 57 insertions(+), 55 deletions(-) diff --git a/net/ipv6/addrconf.c b/net/ip

[PATCH net-next 4/7] net: Add IFA_RT_PRIORITY address attribute

2018-05-27 Thread dsahern
From: David Ahern Currently, if two interfaces have addresses in the same connected route, then the order of the prefix route entries is determined by the order in which the addresses are assigned or the links brought up. Add IFA_RT_PRIORITY to allow user to specify the metric of the prefix rout

Re: [PATCH net] VSOCK: check sk state before receive

2018-05-27 Thread Hangbin Liu
Hmm...Although I won't reproduce this bug with my reproducer after apply my patch. I could still get a similiar issue with syzkaller sock vnet test. It looks this patch is not complete. Here is the KASAN call trace with my patch. I can also reproduce it without my patch.

[PATCH v2 3/5] crypto: chtls: dereference null variable

2018-05-27 Thread Atul Gupta
skb dereferenced before check in sendpage Reported-by: Dan Carpenter Signed-off-by: Atul Gupta --- drivers/crypto/chelsio/chtls/chtls_io.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/crypto/chelsio/chtls/chtls_io.c b/drivers/crypto/chelsio/chtls/chtls_io.c ind

[PATCH v2 2/5] crypto: chtls: wait for memory sendmsg, sendpage

2018-05-27 Thread Atul Gupta
address suspicious code 1210 set_bit(SOCK_NOSPACE, &sk->sk_socket->flags); 1211 } The issue is that in the code above, set_bit is never reached due to the 'continue' statement at line 1208. Also reported by bug report: 1210 set_bit(SOCK_NOSPACE, &sk->sk_socket->flags);

[PATCH v2 4/5] crypto: chtls: kbuild warnings

2018-05-27 Thread Atul Gupta
- unindented continue - check for null page - signed return Reported-by: Dan Carpenter Signed-off-by: Atul Gupta --- drivers/crypto/chelsio/chtls/chtls_io.c | 11 ++- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/crypto/chelsio/chtls/chtls_io.c b/drivers/crypto/

[PATCH v2 5/5] crypto: chtls: free beyond end rspq_skb_cache

2018-05-27 Thread Atul Gupta
Reported-by: Dan Carpenter Signed-off-by: Atul Gupta --- drivers/crypto/chelsio/chtls/chtls_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/crypto/chelsio/chtls/chtls_main.c b/drivers/crypto/chelsio/chtls/chtls_main.c index 273afd3..9b07f91 100644 --- a/driver

[PATCH v2 1/5] crypto:chtls: key len correction

2018-05-27 Thread Atul Gupta
corrected the key length to copy 128b key. Removed 192b and 256b key as user input supports key of size 128b in gcm_ctx Reported-by: Dan Carpenter Signed-off-by: Atul Gupta --- drivers/crypto/chelsio/chtls/chtls_hw.c | 6 +- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/drive

[PATCH v2 0/5] build warnings cleanup

2018-05-27 Thread Atul Gupta
Build warnings cleanup reported for - using only 128b key - wait for buffer in sendmsg/sendpage - check for null before using skb - free rspq_skb_cache in error path - indentation v2: Added bug report description for 0002 Incorported comments from Dan Carpenter Atul Gupta (5): crypto:chtls:

Re: [PATCH rdma-next v1 00/13] Verbs flow counters support

2018-05-27 Thread Leon Romanovsky
On Sun, May 27, 2018 at 01:23:33PM +0300, Leon Romanovsky wrote: > From: Leon Romanovsky > > Changelog v0->v1: > * Decouple from DevX submission > * Use uverbs_attr_get_obj at counters read method > * Added define for max read buffer size (MAX_COUNTERS_BUFF_SIZE) > * Removed the struct mlx5_ib

[PATCH v2 04/11] net: sched: always take reference to action

2018-05-27 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 v2 00/11] Modify action API for implementing lockless actions

2018-05-27 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 v2 10/11] net: sched: atomically check-allocate action

2018-05-27 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 v2 09/11] net: sched: use reference counting action init

2018-05-27 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 v2 11/11] net: sched: change action API to use array of pointers to actions

2018-05-27 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 v2 02/11] net: sched: change type of reference and bind counters

2018-05-27 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. Signed-off-by: Vlad Buslov Signed-off-by: Jiri Pirko --- include/net/act_api.h | 5 +++-- net/sched/ac

[PATCH v2 03/11] net: sched: implement unlocked action init API

2018-05-27 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. Signed-off-by: Vlad Buslov --- include/net/act_api.h | 6 -- net/sched/act_api.c| 18 +

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

2018-05-27 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 v2 05/11] net: sched: implement action API that deletes action by index

2018-05-27 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. Signed-off-by: Vlad Buslov --- include/net/act_api.h | 1 + net/sched/act_api.c | 39 +++ 2

[PATCH v2 07/11] net: sched: implement reference counted action release

2018-05-27 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 v2 08/11] net: sched: don't release reference on action overwrite

2018-05-27 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 v2 01/11] net: sched: use rcu for action cookie update

2018-05-27 Thread Vlad Buslov
Implement functions to atomically update and free action cookie using rcu mechanism. 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 ++-- 3 files changed, 32

Re: [PATCH v2 00/11] Modify action API for implementing lockless actions

2018-05-27 Thread Jiri Pirko
Sun, May 27, 2018 at 06:41:27PM CEST, vla...@mellanox.com wrote: [...] >Changes from V1 to V2: >- Removed redundant actions ops lookup during delete. >- Merge action ops delete definition and implementation. >- Assume all actions have delete implemented and don't check for it > explicitly. >- Re

[PATCH] net: sched: split tc_ctl_tfilter into three handlers

2018-05-27 Thread Vlad Buslov
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-specific. This significantly complicates adding new functionality and

KASAN: use-after-free Write in bpf_tcp_close

2018-05-27 Thread syzbot
Hello, syzbot found the following crash on: HEAD commit:ff4fb475cea8 Merge branch 'btf-uapi-cleanups' git tree: bpf-next console output: https://syzkaller.appspot.com/x/log.txt?x=12b3d57780 kernel config: https://syzkaller.appspot.com/x/.config?x=b632d8e2c2ab2c1 dashboard link: ht

[PATCH] ath10k: fix memory leak of tpc_stats

2018-05-27 Thread Colin King
From: Colin Ian King Currently tpc_stats is allocated and is leaked on the return path if num_tx_chain is greater than WMI_TPC_TX_N_CHAIN. Avoid this leak by performing the check on num_tx_chain before the allocation of tpc_stats. Detected by CoverityScan, CID#1469422 ("Resource Leak") Fixes: 4b

[PATCH v3 01/11] net: sched: use rcu for action cookie update

2018-05-27 Thread Vlad Buslov
Implement functions to atomically update and free action cookie using rcu mechanism. 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 ++-- 3 files changed, 32

[PATCH v3 03/11] net: sched: implement unlocked action init API

2018-05-27 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. Signed-off-by: Vlad Buslov --- Changes from V1 to V2: - Rename "unlocked" to "rtnl_held" for clarity. inclu

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

2018-05-27 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. Signed-off-by: Vlad Buslov --- Changes from V1 to V2: - Rename tcf_idr_find_delete to tcf_idr_delete_index. include/net/act_api.h

[PATCH v3 04/11] net: sched: always take reference to action

2018-05-27 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 v3 00/11] Modify action API for implementing lockless actions

2018-05-27 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 v3 02/11] net: sched: change type of reference and bind counters

2018-05-27 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. Signed-off-by: Vlad Buslov Signed-off-by: Jiri Pirko --- include/net/act_api.h | 5 +++-- net/sched/ac

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

2018-05-27 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 v3 09/11] net: sched: use reference counting action init

2018-05-27 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 v3 07/11] net: sched: implement reference counted action release

2018-05-27 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 v3 10/11] net: sched: atomically check-allocate action

2018-05-27 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 v3 08/11] net: sched: don't release reference on action overwrite

2018-05-27 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 v3 06/11] net: sched: add 'delete' function to action ops

2018-05-27 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

Re: KASAN: use-after-free Write in bpf_tcp_close

2018-05-27 Thread Daniel Borkmann
[ +John ] On 05/27/2018 10:06 PM, syzbot wrote: > Hello, > > syzbot found the following crash on: > > HEAD commit:    ff4fb475cea8 Merge branch 'btf-uapi-cleanups' > git tree:   bpf-next > console output: https://syzkaller.appspot.com/x/log.txt?x=12b3d57780 > kernel config:  https://syzk

Re: general protection fault in bpf_tcp_close

2018-05-27 Thread Daniel Borkmann
[ +John ] On 05/26/2018 11:13 AM, syzbot wrote: > Hello, > > syzbot found the following crash on: > > HEAD commit:    fd0bfa8d6e04 Merge branch 'bpf-af-xdp-cleanups' > git tree:   bpf-next > console output: https://syzkaller.appspot.com/x/log.txt?x=11da942780 > kernel config:  https://sy

Re: KASAN: use-after-free Read in bpf_tcp_close

2018-05-27 Thread Daniel Borkmann
[ +John ] On 05/26/2018 10:54 AM, syzbot wrote: > Hello, > > syzbot found the following crash on: > > HEAD commit:    3fb48d881dbe Merge branch 'bpf-fib-mtu-check' > git tree:   bpf-next > console output: https://syzkaller.appspot.com/x/log.txt?x=15fc197780 > kernel config:  https://syzk

Re: aio poll and a new in-kernel poll API V13

2018-05-27 Thread Al Viro
OK, it's in -next now; there are several cleanups I'd put into vfs.git#work.aio: aio: all callers of aio_{read,write,fsync,poll} treat 0 and -EIOCBQUEUED the same way aio_read_events_ring(): make a bit more readable aio: shift copyin of iocb into io_submit_one() aio

Proposal

2018-05-27 Thread Miss Zeliha Omer Faruk
-- Hello I have been trying to contact you. Did you get my business proposal? Best Regards, Miss.Zeliha ömer faruk Esentepe Mahallesi Büyükdere Caddesi Kristal Kule Binasi No:215 Sisli - Istanbul, Turke

Re: [PATCH bpf-next] libbpf: Install btf.h with libbpf

2018-05-27 Thread Daniel Borkmann
On 05/25/2018 07:23 PM, Andrey Ignatov wrote: > install_headers target should contain all headers that are part of > libbpf. Add missing btf.h > > Signed-off-by: Andrey Ignatov Applied to bpf-next, thanks Andrey!

Re: [bpf-next PATCH] bpf: sockhash fix race with bpf_tcp_close and map delete

2018-05-27 Thread Daniel Borkmann
On 05/25/2018 07:37 PM, John Fastabend wrote: > syzbot reported two related splats, a use after free and null > pointer dereference, when a TCP socket is closed while the map is > also being removed. > > The psock keeps a reference to all map slots that have a reference > to the sock so that when

Re: [PATCH, net-next 1/2] bpf: btf: avoid -Wreturn-type warning

2018-05-27 Thread Daniel Borkmann
On 05/25/2018 11:33 PM, Arnd Bergmann wrote: > gcc warns about a noreturn function possibly returning in > some configurations: > > kernel/bpf/btf.c: In function 'env_type_is_resolve_sink': > kernel/bpf/btf.c:729:1: error: control reaches end of non-void function > [-Werror=return-type] > > Usin

Re: [PATCH bpf-next v2] selftests/bpf: missing headers test_lwt_seg6local

2018-05-27 Thread Daniel Borkmann
On 05/26/2018 04:44 PM, Mathieu Xhonneux wrote: > Previous patch "selftests/bpf: test for seg6local End.BPF action" lacks > some UAPI headers in tools/. > > clang -I. -I./include/uapi -I../../../include/uapi -idirafter > /usr/local/include -idirafter > /data/users/yhs/work/llvm/build/install/lib/c

Re: [PATCH, net-next 2/2] bpf: avoid -Wmaybe-uninitialized warning

2018-05-27 Thread Daniel Borkmann
On 05/25/2018 11:33 PM, Arnd Bergmann wrote: > The stack_map_get_build_id_offset() function is too long for gcc to track > whether 'work' may or may not be initialized at the end of it, leading > to a false-positive warning: > > kernel/bpf/stackmap.c: In function 'stack_map_get_build_id_offset': >

Re: [PATCH v3 bpf-next 0/5] bpf: Hooks for sys_sendmsg

2018-05-27 Thread Daniel Borkmann
On 05/25/2018 07:09 AM, Andrey Ignatov wrote: > v2 -> v3: > * place BPF logic under static key in udp_sendmsg, udpv6_sendmsg; > * rebase. > > v1 -> v2: > * return ENOTSUPP if bpf_prog rewrote IPv6-only with IPv4-mapped IPv6; > * add test for IPv4-mapped IPv6 use-case; > * fix build for CONFIG_CGRO

Re: [PATCH v3 bpf-next 0/5] bpf: Hooks for sys_sendmsg

2018-05-27 Thread Daniel Borkmann
On 05/28/2018 12:56 AM, Daniel Borkmann wrote: > On 05/25/2018 07:09 AM, Andrey Ignatov wrote: >> v2 -> v3: >> * place BPF logic under static key in udp_sendmsg, udpv6_sendmsg; >> * rebase. [...] > > Applied to bpf-next, thanks Andrey! Woops, and I meant of course v4 [0] of the series not v3. ;-)

Re: WARNING in bpf_int_jit_compile

2018-05-27 Thread Daniel Borkmann
On 05/26/2018 11:29 AM, syzbot wrote: > syzbot has found a reproducer for the following crash on: > > HEAD commit:    62d18ecfa641 Merge tag 'arm64-fixes' of git://git.kernel.o.. > git tree:   upstream > console output: https://syzkaller.appspot.com/x/log.txt?x=14c6bf5780 > kernel config: 

[PATCH] net: qmi_wwan: Add Netgear Aircard 779S

2018-05-27 Thread Josh Hill
Add support for Netgear Aircard 779S Signed-off-by: Josh Hill --- drivers/net/usb/qmi_wwan.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/usb/qmi_wwan.c b/drivers/net/usb/qmi_wwan.c index 42565dd..0946808 100644 --- a/drivers/net/usb/qmi_wwan.c +++ b/drivers/net/usb/qmi_wwan.

[PATCH bpf-next 03/11] bpf: fixup error message from gpl helpers on license mismatch

2018-05-27 Thread Daniel Borkmann
Stating 'proprietary program' in the error is just silly since it can also be a different open source license than that which is just not compatible. Reference: https://twitter.com/majek04/status/998531268039102465 Signed-off-by: Daniel Borkmann Acked-by: Alexei Starovoitov --- kernel/bpf/verif

[PATCH bpf-next 08/11] bpf: fix cbpf parser bug for octal numbers

2018-05-27 Thread Daniel Borkmann
Range is 0-7, not 0-9, otherwise parser silently excludes it from the strtol() rather than throwing an error. Reported-by: Marc Boschma Signed-off-by: Daniel Borkmann Acked-by: Alexei Starovoitov --- tools/bpf/bpf_exp.l | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/

[PATCH bpf-next 00/11] Misc BPF improvements

2018-05-27 Thread Daniel Borkmann
This set adds various patches I still had in my queue, first two are test cases to provide coverage for the recent two fixes that went to bpf tree, then a small improvement on the error message for gpl helpers. Next, we expose prog and map id into fdinfo in order to allow for inspection of these ob

[PATCH bpf-next 11/11] bpf, doc: add missing patchwork url and libbpf to maintainers

2018-05-27 Thread Daniel Borkmann
Add missing bits under tools/lib/bpf/ and also Q: entry in order to make it easier for people to retrieve current patch queue. Signed-off-by: Daniel Borkmann Acked-by: Alexei Starovoitov --- MAINTAINERS | 2 ++ 1 file changed, 2 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index f49243

[PATCH bpf-next 05/11] bpf: avoid retpoline for lookup/update/delete calls on maps

2018-05-27 Thread Daniel Borkmann
While some of the BPF map lookup helpers provide a ->map_gen_lookup() callback for inlining the map lookup altogether it is not available for every map, so the remaining ones have to call bpf_map_lookup_elem() helper which does a dispatch to map->ops->map_lookup_elem(). In times of retpolines, this

[PATCH bpf-next 04/11] bpf: show prog and map id in fdinfo

2018-05-27 Thread Daniel Borkmann
Its trivial and straight forward to expose it for scripts that can then use it along with bpftool in order to inspect an individual application's used maps and progs. Right now we dump some basic information in the fdinfo file but with the help of the map/prog id full introspection becomes possible

[PATCH bpf-next 06/11] bpf: add bpf_skb_cgroup_id helper

2018-05-27 Thread Daniel Borkmann
Add a new bpf_skb_cgroup_id() helper that allows to retrieve the cgroup id from the skb's socket. This is useful in particular to enable bpf_get_cgroup_classid()-like behavior for cgroup v1 in cgroup v2 by allowing ID based matching on egress. This can in particular be used in combination with appl

[PATCH bpf-next 07/11] bpf: make sure to clear unused fields in tunnel/xfrm state fetch

2018-05-27 Thread Daniel Borkmann
Since the remaining bits are not filled in struct bpf_tunnel_key resp. struct bpf_xfrm_state and originate from uninitialized stack space, we should make sure to clear them before handing control back to the program. Also add a padding element to struct bpf_xfrm_state for future use similar as we

[PATCH bpf-next 02/11] bpf: add also cbpf long jump test cases with heavy expansion

2018-05-27 Thread Daniel Borkmann
We have one triggering on eBPF but lets also add a cBPF example to make sure we keep tracking them. Also add anther cBPF test running max number of MSH ops. Signed-off-by: Daniel Borkmann Acked-by: Alexei Starovoitov --- lib/test_bpf.c | 63 ++

[PATCH bpf-next 01/11] bpf: test case for map pointer poison with calls/branches

2018-05-27 Thread Daniel Borkmann
Add several test cases where the same or different map pointers originate from different paths in the program and execute a map lookup or tail call at a common location. Signed-off-by: Daniel Borkmann Acked-by: Alexei Starovoitov --- include/linux/filter.h | 10 ++ tools/i

[PATCH bpf-next 10/11] bpf: sync bpf uapi header with tools

2018-05-27 Thread Daniel Borkmann
Pull in recent changes from include/uapi/linux/bpf.h. Signed-off-by: Daniel Borkmann Acked-by: Alexei Starovoitov --- tools/include/uapi/linux/bpf.h | 20 ++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/tools/include/uapi/linux/bpf.h b/tools/include/uapi/linu

Re: [PATCH v4 net] stmmac: 802.1ad tag stripping support fix

2018-05-27 Thread Toshiaki Makita
On 2018/05/27 4:24, Elad Nachman wrote: > stmmac reception handler calls stmmac_rx_vlan() to strip the vlan before > calling napi_gro_receive(). > > The function assumes VLAN tagged frames are always tagged with 802.1Q > protocol, > and assigns ETH_P_8021Q to the skb by hard-coding the parameter

[PATCH bpf-next 09/11] bpf: fix context access in tracing progs on 32 bit archs

2018-05-27 Thread Daniel Borkmann
Wang reported that all the testcases for BPF_PROG_TYPE_PERF_EVENT program type in test_verifier report the following errors on x86_32: 172/p unpriv: spill/fill of different pointers ldx FAIL Unexpected error message! 0: (bf) r6 = r10 1: (07) r6 += -8 2: (15) if r1 == 0x0 goto pc+3 R1=c

  1   2   >