[PATCH iproute2] net:sched: add action inheritdsfield to skbedit

2018-05-27 Thread Fu, Qiaobin
The new action inheritdsfield copies the field DS of IPv4 and IPv6 packets into skb->priority. This enables later classification of packets based on the DS field. Original idea by Jamal Hadi Salim Signed-off-by: Qiaobin Fu Reviewed-by: Michel Machado

[PATCH v2 net-next] net:sched: add action inheritdsfield to skbedit

2018-05-27 Thread Fu, Qiaobin
The new action inheritdsfield copies the field DS of IPv4 and IPv6 packets into skb->priority. This enables later classification of packets based on the DS field. Original idea by Jamal Hadi Salim Signed-off-by: Qiaobin Fu Reviewed-by: Michel Machado

[PATCH net] be2net: Fix error detection logic for BE3

2018-05-27 Thread Suresh Reddy
Check for 0xE00 (RECOVERABLE_ERR) along with ARMFW UE (0x0) in be_detect_error() to know whether the error is valid error or not Fixes: 673c96e5a ("be2net: Fix UE detection logic for BE3") Signed-off-by: Suresh Reddy --- drivers/net/ethernet/emulex/benet/be_main.c | 4

Re: [PATCH v2] Revert "alx: remove WoL support"

2018-05-27 Thread AceLan Kao
Hi all, Just inform you a news reported by a user who confirmed the wake up issue can't be reproduce by the new kernel. https://bugzilla.kernel.org/show_bug.cgi?id=61651#c126 Guillaume de Jabrun 2018-05-27 15:12:54 UTC I am using this patch for a long time. I was experiencing the "wake up

[PATCH bpf v2 5/5] selftests/bpf: test_sockmap, print additional test options

2018-05-27 Thread Prashant Bhole
Print values of test options like apply, cork, start, end so that individual failed tests can be identified for manual run Acked-by: John Fastabend Signed-off-by: Prashant Bhole --- tools/testing/selftests/bpf/test_sockmap.c | 28

[PATCH bpf v2 4/5] selftests/bpf: test_sockmap, fix data verification

2018-05-27 Thread Prashant Bhole
When data verification is enabled, some tests fail because verification is done incorrectly. Following changes fix it. - Identify the size of data block to be verified - Reset verification counter when data block size is reached - Fixed the value printed in case of verfication failure Fixes:

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

2018-05-27 Thread Prashant Bhole
In order to reduce runtime of tests, recently timout for select() call was reduced from 1sec to 10usec. This was causing many tests failures. It was caught with failure handling commits in this series. Restoring the timeout from 10usec to 1sec Fixes: a18fda1a62c3 ("bpf: reduce runtime of

[PATCH bpf v2 2/5] selftests/bpf: test_sockmap, join cgroup in selftest mode

2018-05-27 Thread Prashant Bhole
In case of selftest mode, temporary cgroup environment is created but cgroup is not joined. It causes test failures. Fixed by joining the cgroup Fixes: 16962b2404ac ("bpf: sockmap, add selftests") Acked-by: John Fastabend Signed-off-by: Prashant Bhole

[PATCH bpf v2 1/5] selftests/bpf: test_sockmap, check test failure

2018-05-27 Thread Prashant Bhole
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 RX/TX threads Fixes: 16962b2404ac ("bpf: sockmap, add

[PATCH bpf v2 0/5] fix test_sockmap

2018-05-27 Thread Prashant Bhole
This series fixes error handling, timeout and data verification in test_sockmap. Previously it was not able to detect failure/timeout in RX/TX thread because error was not notified to the main thread. Also slightly improved test output by printing parameter values (cork, apply, start, end) so

Re: [PATCH net] tun: Fix NULL pointer dereference in XDP redirect

2018-05-27 Thread Toshiaki Makita
On 2018/05/28 11:24, Jason Wang wrote: > On 2018年05月25日 21:43, Toshiaki Makita wrote: > > [...] > @@ -1917,16 +1923,22 @@ static ssize_t tun_get_user(struct tun_struct *tun, struct tun_file *tfile,   struct bpf_prog *xdp_prog;   int ret; +   

Re: [PATCH bpf-next 0/5] fix test_sockmap

2018-05-27 Thread Prashant Bhole
On 5/25/2018 11:01 PM, John Fastabend wrote: On 05/25/2018 01:28 AM, Prashant Bhole wrote: On 5/24/2018 1:58 PM, John Fastabend wrote: On 05/23/2018 09:47 PM, Prashant Bhole wrote: On 5/23/2018 6:44 PM, Prashant Bhole wrote: On 5/22/2018 2:08 AM, John Fastabend wrote: On 05/20/2018

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

2018-05-27 Thread Andrew Lunn
> diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum.c > b/drivers/net/ethernet/mellanox/mlxsw/spectrum.c > index ca38a30fbe91..adc6ab2cf429 100644 > --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum.c > +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum.c > @@ -4433,6 +4433,11 @@ static

Re: [PATCH] drivers/net/phy/micrel: Fix for PHY KSZ8061 errrata: Potential link-up failure when Ethernet cable is connected slowly

2018-05-27 Thread Andrew Lunn
> This e-mail (including any attachments) is confidential and may be > legally privileged. If you are not an intended recipient or an > authorized representative of an intended recipient, you are > prohibited from using, copying or distributing the information in > this e-mail or its attachments.

Re: [PATCH net] tun: Fix NULL pointer dereference in XDP redirect

2018-05-27 Thread Jason Wang
On 2018年05月25日 21:43, Toshiaki Makita wrote: [...] @@ -1917,16 +1923,22 @@ static ssize_t tun_get_user(struct tun_struct *tun, struct tun_file *tfile,   struct bpf_prog *xdp_prog;   int ret; +    local_bh_disable(); +    preempt_disable();   rcu_read_lock();  

[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 ---

[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

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

[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

[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

[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 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

[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,

[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

[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

[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

[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

[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 +++

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: 

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: [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

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, 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] > >

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 >

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 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!

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: 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()

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: 

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: 

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: 

[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

[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

[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

[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

[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

[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

[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 ---

[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

[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

[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.

[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

[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

[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

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:

[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

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. >-

[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

[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 ---

[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 --

[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

[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

[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

[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

[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

[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

[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

[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

[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

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) > *

[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):

[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,

[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

[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_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

[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

[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

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 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

[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.

[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(-)

[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

[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

[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

[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:

[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

[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

[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

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

[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

[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,

[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

[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

[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

[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

[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

[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

[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:

[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

[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.

  1   2   >