Re: KASAN: slab-out-of-bounds Read in __sctp_v6_cmp_addr

2018-04-22 Thread Xin Long
On Mon, Apr 23, 2018 at 9:02 AM, syzbot wrote: > Hello, > > syzbot hit the following crash on upstream commit > 83beed7b2b26f232d782127792dd0cd4362fdc41 (Fri Apr 20 17:56:32 2018 +) > Merge branch 'fixes' of > git://git.kernel.org/pub/scm/linux/kernel/git/evalenti/linux-soc-thermal > syzbot da

Re: [PATCH bpf-next] bpf: fix virtio-net's length calc for XDP_PASS

2018-04-22 Thread Jason Wang
On 2018年04月23日 12:16, Nikita V. Shirokov wrote: In commit 6870de435b90 ("bpf: make virtio compatible w/ bpf_xdp_adjust_tail") i didn't account for vi->hdr_len during new packet's length calculation after bpf_prog_run in receive_mergeable. because of this all packets, if they were passed to the

Re: [PATCH] [net] ipv6: sr: fix NULL pointer dereference in seg6_do_srh_encap()- v4 pkts

2018-04-22 Thread Ahmed Abdelsalam
On Sun, 22 Apr 2018 21:06:04 -0400 (EDT) David Miller wrote: > From: Ahmed Abdelsalam > Date: Fri, 20 Apr 2018 15:58:05 +0200 > > > In case of seg6 in encap mode, seg6_do_srh_encap() calls set_tun_src() > > in order to set the src addr of outer IPv6 header. > > > > The net_device is required f

[PATCH bpf-next v4 04/10] bpf: remove never-hit branches in verifier adjust_scalar_min_max_vals

2018-04-22 Thread Yonghong Song
In verifier function adjust_scalar_min_max_vals, when src_known is false and the opcode is BPF_LSH/BPF_RSH, early return will happen in the function. So remove the branch in handling BPF_LSH/BPF_RSH when src_known is false. Signed-off-by: Yonghong Song --- kernel/bpf/verifier.c | 11 ++-

[PATCH bpf-next v4 03/10] bpf/verifier: refine retval R0 state for bpf_get_stack helper

2018-04-22 Thread Yonghong Song
The special property of return values for helpers bpf_get_stack and bpf_probe_read_str are captured in verifier. Both helpers return a negative error code or a length, which is equal to or smaller than the buffer size argument. This additional information in the verifier can avoid the condition suc

[PATCH bpf-next v4 10/10] tools/bpf: add a test for bpf_get_stack with tracepoint prog

2018-04-22 Thread Yonghong Song
The test_stacktrace_map and test_stacktrace_build_id are enhanced to call bpf_get_stack in the helper to get the stack trace as well. The stack traces from bpf_get_stack and bpf_get_stackid are compared to ensure that for the same stack as represented as the same hash, their ip addresses or build

[PATCH bpf-next v4 06/10] tools/bpf: add bpf_get_stack helper to tools headers

2018-04-22 Thread Yonghong Song
Signed-off-by: Yonghong Song --- tools/include/uapi/linux/bpf.h| 19 +-- tools/testing/selftests/bpf/bpf_helpers.h | 3 ++- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/tools/include/uapi/linux/bpf.h b/tools/include/uapi/linux/bpf.h index 7f7fbb9..1

[PATCH bpf-next v4 07/10] samples/bpf: move common-purpose trace functions to selftests

2018-04-22 Thread Yonghong Song
There is no functionality change in this patch. The common-purpose trace functions, including perf_event polling and ksym lookup, are moved from trace_output_user.c and bpf_load.c to selftests/bpf/trace_helpers.c so that these function can be reused later in selftests. Acked-by: Alexei Starovoitov

[PATCH bpf-next v4 05/10] bpf/verifier: improve register value range tracking with ARSH

2018-04-22 Thread Yonghong Song
When helpers like bpf_get_stack returns an int value and later on used for arithmetic computation, the LSH and ARSH operations are often required to get proper sign extension into 64-bit. For example, without this patch: 54: R0=inv(id=0,umax_value=800) 54: (bf) r8 = r0 55: R0=inv(id=0,u

[PATCH bpf-next v4 02/10] bpf: add bpf_get_stack helper

2018-04-22 Thread Yonghong Song
Currently, stackmap and bpf_get_stackid helper are provided for bpf program to get the stack trace. This approach has a limitation though. If two stack traces have the same hash, only one will get stored in the stackmap table, so some stack traces are missing from user perspective. This patch impl

[PATCH bpf-next v4 08/10] tools/bpf: add a verifier test case for bpf_get_stack helper and ARSH

2018-04-22 Thread Yonghong Song
The test_verifier already has a few ARSH test cases. This patch adds a new test case which takes advantage of newly improved verifier behavior for bpf_get_stack and ARSH. Signed-off-by: Yonghong Song --- tools/testing/selftests/bpf/test_verifier.c | 45 + 1 file chang

[PATCH bpf-next v4 01/10] bpf: change prototype for stack_map_get_build_id_offset

2018-04-22 Thread Yonghong Song
This patch didn't incur functionality change. The function prototype got changed so that the same function can be reused later. Signed-off-by: Yonghong Song --- kernel/bpf/stackmap.c | 13 + 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/kernel/bpf/stackmap.c b/kernel/

[PATCH bpf-next v4 09/10] tools/bpf: add a test for bpf_get_stack with raw tracepoint prog

2018-04-22 Thread Yonghong Song
The test attached a raw_tracepoint program to sched/sched_switch. It tested to get stack for user space, kernel space and user space with build_id request. It also tested to get user and kernel stack into the same buffer with back-to-back bpf_get_stack helper calls. Whenever the kernel stack is av

[PATCH bpf-next v4 00/10] bpf: add bpf_get_stack helper

2018-04-22 Thread Yonghong Song
Currently, stackmap and bpf_get_stackid helper are provided for bpf program to get the stack trace. This approach has a limitation though. If two stack traces have the same hash, only one will get stored in the stackmap table regardless of whether BPF_F_REUSE_STACKID is specified or not, so some st

Re: [RFC v2] virtio: support packed ring

2018-04-22 Thread Jason Wang
On 2018年04月01日 22:12, Tiwei Bie wrote: Hello everyone, This RFC implements packed ring support for virtio driver. The code was tested with DPDK vhost (testpmd/vhost-PMD) implemented by Jens at http://dpdk.org/ml/archives/dev/2018-January/089417.html Minor changes are needed for the vhost code

Re: [PATCH net] team: check team dev npinfo when adding a port only

2018-04-22 Thread Xin Long
On Mon, Apr 23, 2018 at 12:20 PM, kbuild test robot wrote: > Hi Xin, > > Thank you for the patch! Yet something to improve: > > [auto build test ERROR on net/master] > > url: > https://github.com/0day-ci/linux/commits/Xin-Long/team-check-team-dev-npinfo-when-adding-a-port-only/20180423-114310

[RFC V3 PATCH 2/8] vhost: hide used ring layout from device

2018-04-22 Thread Jason Wang
We used to return descriptor head by vhost_get_vq_desc() to device and pass it back to vhost_add_used() and its friends. This exposes the internal used ring layout to device which makes it hard to be extended for e.g packed ring layout. So this patch tries to hide the used ring layout by - lettin

[RFC V3 PATCH 5/8] vhost: vhost_put_user() can accept metadata type

2018-04-22 Thread Jason Wang
We assumes used ring update is the only user for vhost_put_user() in the past. This may not be the case for the incoming packed ring which may update the descriptor ring for used. So introduce a new type parameter. Signed-off-by: Jason Wang --- drivers/vhost/vhost.c | 14 +++--- 1 file c

[RFC V3 PATCH 4/8] vhost_net: do not explicitly manipulate vhost_used_elem

2018-04-22 Thread Jason Wang
Two helpers of setting/getting used len were introduced to avoid explicitly manipulating vhost_used_elem in zerocopy code. This will be used to hide used_elem internals and simplify packed ring implementation. Signed-off-by: Jason Wang --- drivers/vhost/net.c | 11 +-- drivers/vhost/vh

[RFC V3 PATCH 3/8] vhost: do not use vring_used_elem

2018-04-22 Thread Jason Wang
Instead of depending on the exported vring_used_elem, this patch switches to use a new internal structure vhost_used_elem which embed vring_used_elem in itself. This could be used to let vhost to record extra metadata for the incoming packed ring layout. Signed-off-by: Jason Wang --- drivers/vho

[RFC V3 PATCH 6/8] virtio: introduce packed ring defines

2018-04-22 Thread Jason Wang
Signed-off-by: Jason Wang --- include/uapi/linux/virtio_config.h | 9 + include/uapi/linux/virtio_ring.h | 13 + 2 files changed, 22 insertions(+) diff --git a/include/uapi/linux/virtio_config.h b/include/uapi/linux/virtio_config.h index 308e209..5903d51 100644 --- a/incl

[RFC V3 PATCH 7/8] vhost: packed ring support

2018-04-22 Thread Jason Wang
Signed-off-by: Jason Wang --- drivers/vhost/net.c | 3 +- drivers/vhost/vhost.c | 535 ++ drivers/vhost/vhost.h | 8 +- 3 files changed, 509 insertions(+), 37 deletions(-) diff --git a/drivers/vhost/net.c b/drivers/vhost/net.c index 30273ad..

[RFC V3 PATCH 8/8] vhost: event suppression for packed ring

2018-04-22 Thread Jason Wang
This patch introduces basic support for event suppression aka driver and device area. Signed-off-by: Jason Wang --- drivers/vhost/vhost.c| 170 --- drivers/vhost/vhost.h| 10 ++- include/uapi/linux/virtio_ring.h | 19 + 3 files ch

[RFC V3 PATCH 0/8] Packed ring for vhost

2018-04-22 Thread Jason Wang
Hi all: This RFC implement packed ring layout. The code were tested with Tiwei's RFC V2 a thttps://lkml.org/lkml/2018/4/1/48. Some fixups and tweaks were needed on top of Tiwei's code to make it run. TCP stream and pktgen does not show obvious difference compared with split ring. Changes from V2:

[RFC V3 PATCH 1/8] vhost: move get_rx_bufs to vhost.c

2018-04-22 Thread Jason Wang
Move get_rx_bufs() to vhost.c and rename it to vhost_get_rx_bufs(). This helps to hide vring internal layout from specific device implementation. Packed ring implementation will benefit from this. Signed-off-by: Jason Wang --- drivers/vhost/net.c | 83 ++

[PATCH net-next] lan78xx: Lan7801 Support for Fixed PHY

2018-04-22 Thread Raghuram Chary J
Adding Fixed PHY support to the lan78xx driver. Signed-off-by: Raghuram Chary J --- drivers/net/usb/Kconfig | 1 + drivers/net/usb/lan78xx.c | 43 +++ 2 files changed, 40 insertions(+), 4 deletions(-) diff --git a/drivers/net/usb/Kconfig b/drivers/net/

Re: [PATCH bpf-next v3 4/9] bpf/verifier: improve register value range tracking with ARSH

2018-04-22 Thread Alexei Starovoitov
On Sun, Apr 22, 2018 at 09:31:19PM -0700, Yonghong Song wrote: > > > On 4/22/18 9:19 PM, Alexei Starovoitov wrote: > > On Sun, Apr 22, 2018 at 07:49:13PM -0700, Yonghong Song wrote: > > > > > > > > > On 4/22/18 5:16 PM, Alexei Starovoitov wrote: > > > > On Fri, Apr 20, 2018 at 03:18:37PM -0700,

Re: [PATCH bpf-next v3 4/9] bpf/verifier: improve register value range tracking with ARSH

2018-04-22 Thread Yonghong Song
On 4/22/18 9:19 PM, Alexei Starovoitov wrote: On Sun, Apr 22, 2018 at 07:49:13PM -0700, Yonghong Song wrote: On 4/22/18 5:16 PM, Alexei Starovoitov wrote: On Fri, Apr 20, 2018 at 03:18:37PM -0700, Yonghong Song wrote: When helpers like bpf_get_stack returns an int value and later on used f

Re: [PATCH net] team: check team dev npinfo when adding a port only

2018-04-22 Thread kbuild test robot
Hi Xin, Thank you for the patch! Yet something to improve: [auto build test ERROR on net/master] url: https://github.com/0day-ci/linux/commits/Xin-Long/team-check-team-dev-npinfo-when-adding-a-port-only/20180423-114310 config: i386-randconfig-x071-201816 (attached as .config) compiler: gcc-7

Re: [PATCH bpf-next v3 4/9] bpf/verifier: improve register value range tracking with ARSH

2018-04-22 Thread Alexei Starovoitov
On Sun, Apr 22, 2018 at 07:49:13PM -0700, Yonghong Song wrote: > > > On 4/22/18 5:16 PM, Alexei Starovoitov wrote: > > On Fri, Apr 20, 2018 at 03:18:37PM -0700, Yonghong Song wrote: > > > When helpers like bpf_get_stack returns an int value > > > and later on used for arithmetic computation, the

Re: [PATCH net] team: check team dev npinfo when adding a port only

2018-04-22 Thread kbuild test robot
Hi Xin, Thank you for the patch! Yet something to improve: [auto build test ERROR on net/master] url: https://github.com/0day-ci/linux/commits/Xin-Long/team-check-team-dev-npinfo-when-adding-a-port-only/20180423-114310 config: x86_64-randconfig-x011-201816 (attached as .config) compiler: gcc

[PATCH bpf-next] bpf: fix virtio-net's length calc for XDP_PASS

2018-04-22 Thread Nikita V. Shirokov
In commit 6870de435b90 ("bpf: make virtio compatible w/ bpf_xdp_adjust_tail") i didn't account for vi->hdr_len during new packet's length calculation after bpf_prog_run in receive_mergeable. because of this all packets, if they were passed to the kernel, were truncated by 12 bytes. Fixes:6870d

Re: [PATCH bpf-next v3 9/9] tools/bpf: add a test for bpf_get_stack with tracepoint prog

2018-04-22 Thread Yonghong Song
On 4/22/18 5:27 PM, Alexei Starovoitov wrote: On Fri, Apr 20, 2018 at 03:18:42PM -0700, Yonghong Song wrote: The test_stacktrace_map and test_stacktrace_build_id are enhanced to call bpf_get_stack in the helper to get the stack trace as well. The stack traces from bpf_get_stack and bpf_get_st

Re: [PATCH bpf-next v3 8/9] tools/bpf: add a test for bpf_get_stack with raw tracepoint prog

2018-04-22 Thread Yonghong Song
On 4/22/18 5:23 PM, Alexei Starovoitov wrote: On Fri, Apr 20, 2018 at 03:18:41PM -0700, Yonghong Song wrote: The test attached a raw_tracepoint program to sched/sched_switch. It tested to get stack for user space, kernel space and user space with build_id request. It also tested to get user an

bpf: samples/bpf/sockex2: Assertion `setsockopt(sock, SOL_SOCKET, SO_ATTACH_BPF, prog_fd, sizeof(prog_fd[0])) == 0' failed.

2018-04-22 Thread Wang Sheng-Hui
Sorry to trouble you! I run samples/bpf/sockex2 failed with "Assertion `setsockopt(sock, SOL_SOCKET, SO_ATTACH_BPF, prog_fd, sizeof(prog_fd[0])) == 0' failed." Then I run " strace ./sockex2" and got: ... bind(3, {sa_family=AF_PACKET, sll_protocol=htons(ETH_P_ALL), sll_ifindex=if_nametoindex("l

Re: [PATCH bpf-next v3 4/9] bpf/verifier: improve register value range tracking with ARSH

2018-04-22 Thread Yonghong Song
On 4/22/18 5:16 PM, Alexei Starovoitov wrote: On Fri, Apr 20, 2018 at 03:18:37PM -0700, Yonghong Song wrote: When helpers like bpf_get_stack returns an int value and later on used for arithmetic computation, the LSH and ARSH operations are often required to get proper sign extension into 64-bi

Re: [PATCH bpf-next v3 3/9] bpf/verifier: refine retval R0 state for bpf_get_stack helper

2018-04-22 Thread Yonghong Song
On 4/22/18 4:55 PM, Alexei Starovoitov wrote: On Fri, Apr 20, 2018 at 03:18:36PM -0700, Yonghong Song wrote: The special property of return values for helpers bpf_get_stack and bpf_probe_read_str are captured in verifier. Both helpers return a negative error code or a length, which is equal to

Re: [PATCH net-next 2/2] netns: isolate seqnums to use per-netns locks

2018-04-22 Thread kbuild test robot
Hi Christian, Thank you for the patch! Yet something to improve: [auto build test ERROR on net-next/master] url: https://github.com/0day-ci/linux/commits/Christian-Brauner/netns-uevent-performance-tweaks/20180420-013717 config: alpha-alldefconfig (attached as .config) compiler: alpha-linux-g

Re: [PATCH 1/6] rhashtable: remove outdated comments about grow_decision etc

2018-04-22 Thread NeilBrown
On Wed, Apr 18 2018, David Miller wrote: > From: NeilBrown > Date: Thu, 19 Apr 2018 09:09:05 +1000 > >> On Wed, Apr 18 2018, Herbert Xu wrote: >> >>> On Wed, Apr 18, 2018 at 04:47:01PM +1000, NeilBrown wrote: grow_decision and shink_decision no longer exist, so remove the remaining ref

Re: [PATCH 2/6] rhashtable: remove incorrect comment on r{hl, hash}table_walk_enter()

2018-04-22 Thread NeilBrown
On Thu, Apr 19 2018, Herbert Xu wrote: > On Thu, Apr 19, 2018 at 08:56:28AM +1000, NeilBrown wrote: >> >> I don't want to do that - I just want the documentation to be correct >> (or at least, not be blatantly incorrect). The function does not sleep, >> and is safe to call with spin locks held. >

[PATCH net] ipv6: add RTA_TABLE and RTA_PREFSRC to rtm_ipv6_policy

2018-04-22 Thread Eric Dumazet
KMSAN reported use of uninit-value that I tracked to lack of proper size check on RTA_TABLE attribute. I also believe RTA_PREFSRC lacks a similar check. Fixes: 86872cb57925 ("[IPv6] route: FIB6 configuration using struct fib6_config") Fixes: c3968a857a6b ("ipv6: RTA_PREFSRC support for ipv6 rout

Re: pull-request: bpf 2018-04-21

2018-04-22 Thread David Miller
From: Daniel Borkmann Date: Sat, 21 Apr 2018 02:22:24 +0200 > The following pull-request contains BPF updates for your *net* tree. > > The main changes are: > > 1) Fix a deadlock between mm->mmap_sem and bpf_event_mutex when >one task is detaching a BPF prog via perf_event_detach_bpf_prog()

Re: [PATCH net] ibmvnic: Clean actual number of RX or TX pools

2018-04-22 Thread David Miller
From: Thomas Falcon Date: Fri, 20 Apr 2018 14:25:32 -0500 > Avoid using value stored in the login response buffer when > cleaning TX and RX buffer pools since these could be inconsistent > depending on the device state. Instead use the field in the driver's > private data that tracks the number o

Re: [PATCHv4 net 0/3] net: sched: ife: malformed ife packet fixes

2018-04-22 Thread David Miller
From: Alexander Aring Date: Fri, 20 Apr 2018 15:15:02 -0400 > As promised at netdev 2.2 tc workshop I am working on adding scapy support for > tdc testing. It is still work in progress. I will submit the patches to tdc > later (they are not in good shape yet). The good news is I have been able to

Re: [PATCH net] strparser: Do not call mod_delayed_work with a timeout of LONG_MAX

2018-04-22 Thread David Miller
From: Doron Roberts-Kedes Date: Fri, 20 Apr 2018 12:11:11 -0700 > struct sock's sk_rcvtimeo is initialized to > LONG_MAX/MAX_SCHEDULE_TIMEOUT in sock_init_data. Calling > mod_delayed_work with a timeout of LONG_MAX causes spurious execution of > the work function. timer->expires is set equal to j

Re: [PATCH for-rc] uapi: Fix SPDX tags for files referring to the 'OpenIB.org' license

2018-04-22 Thread David Miller
From: Jason Gunthorpe Date: Fri, 20 Apr 2018 09:49:10 -0600 > Based on discussion with Kate Stewart this license is not a > BSD-2-Clause, but is now formally identified as Linux-OpenIB > by SPDX. > > The key difference between the licenses is in the 'warranty' > paragraph. > > if_infiniband.h r

Re: [PATCH] hv_netvsc: select needed ucs2_string routine

2018-04-22 Thread David Miller
From: Stephen Hemminger Date: Fri, 20 Apr 2018 08:48:47 -0700 > The conversion of rndis friendly name to utf8 uses a standard > kernel routine which is optional in config. Therefore build > would fail for some configurations. Resolve by selecting needed > library. > > Fixes: 0fe554a46a0f ("hv_ne

Re: [PATCH] [net] ipv6: sr: fix NULL pointer dereference in seg6_do_srh_encap()- v4 pkts

2018-04-22 Thread David Miller
From: Ahmed Abdelsalam Date: Fri, 20 Apr 2018 15:58:05 +0200 > In case of seg6 in encap mode, seg6_do_srh_encap() calls set_tun_src() > in order to set the src addr of outer IPv6 header. > > The net_device is required for set_tun_src(). However calling ip6_dst_idev() > on dst_entry in case of IP

KASAN: slab-out-of-bounds Read in __sctp_v6_cmp_addr

2018-04-22 Thread syzbot
Hello, syzbot hit the following crash on upstream commit 83beed7b2b26f232d782127792dd0cd4362fdc41 (Fri Apr 20 17:56:32 2018 +) Merge branch 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/evalenti/linux-soc-thermal syzbot dashboard link: https://syzkaller.appspot.com/bug?extid=cd

KASAN: null-ptr-deref Read in refcount_inc_not_zero

2018-04-22 Thread syzbot
Hello, syzbot hit the following crash on upstream commit 285848b0f4074f04ab606f1e5dca296482033d54 (Sun Apr 22 04:20:48 2018 +) Merge tag 'random_for_linus_stable' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/random syzbot dashboard link: https://syzkaller.appspot.com/bug?extid=6

Re: [PATCH net-next] net: stmmac: Implement logic to automatically select HW Interface

2018-04-22 Thread David Miller
From: Jose Abreu Date: Thu, 19 Apr 2018 16:24:15 +0100 > @@ -0,0 +1,216 @@ > +// SPDX-License-Identifier: (GPL-2.0 OR MIT) > +// Copyright (c) 2018 Synopsys, Inc. and/or its affiliates. > +// stmmac HW Interface Handling Please do not use C++ style comments for anything past the SPDX identifier

Re: XDP breakage with virtio due to 6870de435b90c083ae0f3f7f341287976ef56f03

2018-04-22 Thread Nikita V. Shirokov
On Sun, Apr 22, 2018 at 04:47:48PM -0600, David Ahern wrote: > This commit breaks my FIB forwarding program: > > commit 6870de435b90c083ae0f3f7f341287976ef56f03 > Author: Nikita V. Shirokov > Date: Tue Apr 17 21:42:20 2018 -0700 > > bpf: make virtio compatible w/ bpf_xdp_adjust_tail > >

Re: [PATCH bpf-next,v2 1/2] bpf: add helper for getting xfrm states

2018-04-22 Thread Alexei Starovoitov
On Fri, Apr 20, 2018 at 06:43:56AM +0300, Eyal Birger wrote: > Hi, > > On Wed, 18 Apr 2018 15:31:03 -0700 > Alexei Starovoitov wrote: > > > On Thu, Apr 19, 2018 at 12:58:22AM +0300, Eyal Birger wrote: > > > This commit introduces a helper which allows fetching xfrm state > > > parameters by eBPF

Re: [PATCH bpf-next v3 9/9] tools/bpf: add a test for bpf_get_stack with tracepoint prog

2018-04-22 Thread Alexei Starovoitov
On Fri, Apr 20, 2018 at 03:18:42PM -0700, Yonghong Song wrote: > The test_stacktrace_map and test_stacktrace_build_id are > enhanced to call bpf_get_stack in the helper to get the > stack trace as well. The stack traces from bpf_get_stack > and bpf_get_stackid are compared to ensure that for the >

Re: [PATCH bpf-next v3 8/9] tools/bpf: add a test for bpf_get_stack with raw tracepoint prog

2018-04-22 Thread Alexei Starovoitov
On Fri, Apr 20, 2018 at 03:18:41PM -0700, Yonghong Song wrote: > The test attached a raw_tracepoint program to sched/sched_switch. > It tested to get stack for user space, kernel space and user > space with build_id request. It also tested to get user > and kernel stack into the same buffer with ba

Re: [PATCH bpf-next v3 6/9] samples/bpf: move common-purpose trace functions to selftests

2018-04-22 Thread Alexei Starovoitov
On Fri, Apr 20, 2018 at 03:18:39PM -0700, Yonghong Song wrote: > There is no functionality change in this patch. The common-purpose > trace functions, including perf_event polling and ksym lookup, > are moved from trace_output_user.c and bpf_load.c to > selftests/bpf/trace_helpers.c so that these f

Re: [PATCH bpf-next v3 4/9] bpf/verifier: improve register value range tracking with ARSH

2018-04-22 Thread Alexei Starovoitov
On Fri, Apr 20, 2018 at 03:18:37PM -0700, Yonghong Song wrote: > When helpers like bpf_get_stack returns an int value > and later on used for arithmetic computation, the LSH and ARSH > operations are often required to get proper sign extension into > 64-bit. For example, without this patch: > 5

Re: [PATCH bpf-next v3 3/9] bpf/verifier: refine retval R0 state for bpf_get_stack helper

2018-04-22 Thread Alexei Starovoitov
On Fri, Apr 20, 2018 at 03:18:36PM -0700, Yonghong Song wrote: > The special property of return values for helpers bpf_get_stack > and bpf_probe_read_str are captured in verifier. > Both helpers return a negative error code or > a length, which is equal to or smaller than the buffer > size argument

XDP breakage with virtio due to 6870de435b90c083ae0f3f7f341287976ef56f03

2018-04-22 Thread David Ahern
This commit breaks my FIB forwarding program: commit 6870de435b90c083ae0f3f7f341287976ef56f03 Author: Nikita V. Shirokov Date: Tue Apr 17 21:42:20 2018 -0700 bpf: make virtio compatible w/ bpf_xdp_adjust_tail w/ bpf_xdp_adjust_tail helper xdp's data_end pointer could be changed as

[PATCH bpf-next v4 2/2] tools/bpf: add verifier tests for accesses to map

2018-04-22 Thread Paul Chaignon
This patch adds new test cases for accesses to map values from map helpers. Signed-off-by: Paul Chaignon --- tools/testing/selftests/bpf/test_verifier.c | 266 1 file changed, 266 insertions(+) diff --git a/tools/testing/selftests/bpf/test_verifier.c b/tools/testin

[PATCH bpf-next v4 1/2] bpf: allow map helpers access to map values directly

2018-04-22 Thread Paul Chaignon
Helpers that expect ARG_PTR_TO_MAP_KEY and ARG_PTR_TO_MAP_VALUE can only access stack and packet memory. Allow these helpers to directly access map values by passing registers of type PTR_TO_MAP_VALUE. This change removes the need for an extra copy to the stack when using a map value to perform a

[PATCH bpf-next v4 0/2] bpf: allow map helpers access to map values directly

2018-04-22 Thread Paul Chaignon
Currently, helpers that expect ARG_PTR_TO_MAP_KEY and ARG_PTR_TO_MAP_VALUE can only access stack and packet memory. This patchset allows these helpers to directly access map values by passing registers of type PTR_TO_MAP_VALUE. The first patch changes the verifier; the second adds new test cases.

kTLS in combination with mlx4 is very unstable

2018-04-22 Thread Andre Tomt
Hello! kTLS looks fun, so I decided to play with it. It is quite spiffy - however with mlx4 I get kernel crashes I'm not seeing when testing on ixgbe. For testing I'm using a git build of the "stream reflector" cubemap[1] configured with kTLS and 8 worker threads running on 4 physical cores,

Re: [PATCH 1/3] ethtool: Support ETHTOOL_GSTATS2 command.

2018-04-22 Thread Roopa Prabhu
On Sun, Apr 22, 2018 at 11:54 AM, David Miller wrote: > From: Johannes Berg > Date: Thu, 19 Apr 2018 17:26:57 +0200 > >> On Thu, 2018-04-19 at 08:25 -0700, Ben Greear wrote: >>> >>> Maybe this could be in followup patches? It's going to touch a lot of >>> files, >>> and might be hell to get mer

Re: linux-next on x60: network manager often complains "network is disabled" after resume

2018-04-22 Thread Pavel Machek
Hi! > >I guess you can't reproduce it easily? I tried bisecting, but while it > >happens often enough to make v4.17 hard to use, it does not permit > >reliable bisect. > > > >These should be bad according to my notes > > > >b04240a33b99b32cf6fbdf5c943c04e505a0cb07 > > ed80dc19e4dd395c951f745acd14

Re: [Patch net] llc: fix NULL pointer deref for SOCK_ZAPPED

2018-04-22 Thread David Miller
From: Cong Wang Date: Thu, 19 Apr 2018 21:54:34 -0700 > For SOCK_ZAPPED socket, we don't need to care about llc->sap, > so we should just skip these refcount functions in this case. > > Fixes: f7e43672683b ("llc: hold llc_sap before release_sock()") > Reported-by: kernel test robot > Signed-off

Re: [PATCH v2] net: ethernet: ti: cpsw: fix tx vlan priority mapping

2018-04-22 Thread David Miller
From: Ivan Khoronzhuk Date: Thu, 19 Apr 2018 22:49:09 +0300 > The CPDMA_TX_PRIORITY_MAP in real is vlan pcp field priority mapping > register and basically replaces vlan pcp field for tagged packets. > So, set it to be 1:1 mapping. Otherwise, it will cause unexpected > change of egress vlan tagge

Re: [Patch net] llc: delete timers synchronously in llc_sk_free()

2018-04-22 Thread David Miller
From: Cong Wang Date: Thu, 19 Apr 2018 12:25:38 -0700 > The connection timers of an llc sock could be still flying > after we delete them in llc_sk_free(), and even possibly > after we free the sock. We could just wait synchronously > here in case of troubles. > > Note, I leave other call paths

Re: [PATCH 1/3] ethtool: Support ETHTOOL_GSTATS2 command.

2018-04-22 Thread David Miller
From: Johannes Berg Date: Thu, 19 Apr 2018 17:26:57 +0200 > On Thu, 2018-04-19 at 08:25 -0700, Ben Greear wrote: >> >> Maybe this could be in followup patches? It's going to touch a lot of files, >> and might be hell to get merged all at once, and I've never used spatch, so >> just maybe someon

Re: [PATCH net] l2tp: fix {pppol2tp,l2tp_dfs}_seq_stop() in case of seq_file overflow

2018-04-22 Thread David Miller
From: Guillaume Nault Date: Thu, 19 Apr 2018 16:20:48 +0200 > Commit 0e0c3fee3a59 ("l2tp: hold reference on tunnels printed in pppol2tp > proc file") > assumed that if pppol2tp_seq_stop() was called with non-NULL private > data (the 'v' pointer), then pppol2tp_seq_start() would not be called > a

Re: [PATCH net 0/6] s390/qeth: fixes 2018-04-19

2018-04-22 Thread David Miller
From: Julian Wiedmann Date: Thu, 19 Apr 2018 12:52:05 +0200 > new mail address, same old me. > > Please apply the following qeth fixes for 4.17. The common theme > seems to be error handling improvements in various areas of cmd IO. > > Patches 1-3 should also go back to stable. Series applied

Re: [PATCH v7 net-next 2/4] net: Introduce generic failover module

2018-04-22 Thread kbuild test robot
] url: https://github.com/0day-ci/linux/commits/Sridhar-Samudrala/Enable-virtio_net-to-act-as-a-standby-for-a-passthru-device/20180422-210557 reproduce: # apt-get install sparse make ARCH=x86_64 allmodconfig make C=1 CF=-D__CHECK_ENDIAN__ sparse warnings: (new ones

Re: [PATCH v7 net-next 2/4] net: Introduce generic failover module

2018-04-22 Thread Michael S. Tsirkin
On Thu, Apr 19, 2018 at 06:42:02PM -0700, Sridhar Samudrala wrote: > +#if IS_ENABLED(CONFIG_NET_FAILOVER) > + > +int failover_create(struct net_device *standby_dev, > + struct failover **pfailover); Should we rename all these structs net_failover? It's possible to extend the concep

Re: Page allocator bottleneck

2018-04-22 Thread Tariq Toukan
On 21/04/2018 11:15 AM, Aaron Lu wrote: Sorry to bring up an old thread... I want to thank you very much for bringing this up! On Thu, Nov 02, 2017 at 07:21:09PM +0200, Tariq Toukan wrote: On 18/09/2017 12:16 PM, Tariq Toukan wrote: On 15/09/2017 1:23 PM, Mel Gorman wrote: On Thu, S

Re: sendmmsg flags userspace ABI change in kernel 4.6

2018-04-22 Thread Mark Wielaard
Hi, Adding valgrind-developers to CC. On Wed, 2018-04-18 at 21:03 +0200, Florian Weimer wrote: > Since this commit: > > commit 28a94d8fb35b3a75b802f368ae6f4a9f6b0d435a > Author: Tom Herbert > Date:   Mon Mar 7 14:11:02 2016 -0800 > > net: Allow MSG_EOR in each msghdr of sendmmsg > > T

Re: [PATCH v7 net-next 4/4] netvsc: refactor notifier/event handling code to use the failover framework

2018-04-22 Thread kbuild test robot
: https://github.com/0day-ci/linux/commits/Sridhar-Samudrala/Enable-virtio_net-to-act-as-a-standby-for-a-passthru-device/20180422-210557 config: x86_64-allyesdebian (attached as .config) compiler: gcc-7 (Debian 7.3.0-16) 7.3.0 reproduce: # save the attached .config to linux build tree

Re: [PATCH v7 net-next 3/4] virtio_net: Extend virtio to use VF datapath when available

2018-04-22 Thread kbuild test robot
] url: https://github.com/0day-ci/linux/commits/Sridhar-Samudrala/Enable-virtio_net-to-act-as-a-standby-for-a-passthru-device/20180422-210557 config: i386-randconfig-a1-04221429 (attached as .config) compiler: gcc-4.9 (Debian 4.9.4-2) 4.9.4 reproduce: # save the attached .config to linux

Re: [PATCH 3/3] xen blkback: add fault injection facility

2018-04-22 Thread kbuild test robot
/linux/commits/Stanislav-Kinsburskii/Introduce-Xen-fault-injection-facility/20180422-201946 config: x86_64-allmodconfig (attached as .config) compiler: gcc-7 (Debian 7.3.0-16) 7.3.0 reproduce: # save the attached .config to linux build tree make ARCH=x86_64 All errors (new ones

Re: [PATCH v7 net-next 3/4] virtio_net: Extend virtio to use VF datapath when available

2018-04-22 Thread kbuild test robot
: https://github.com/0day-ci/linux/commits/Sridhar-Samudrala/Enable-virtio_net-to-act-as-a-standby-for-a-passthru-device/20180422-210557 config: i386-randconfig-x071-201816 (attached as .config) compiler: gcc-7 (Debian 7.3.0-16) 7.3.0 reproduce: # save the attached .config to linux build tree

[PATCH V6 net-next 06/15] net/tls: Split conf to rx + tx

2018-04-22 Thread Boris Pismenny
In TLS inline crypto, we can have one direction in software and another in hardware. Thus, we split the TLS configuration to separate structures for receive and transmit. Signed-off-by: Boris Pismenny --- include/net/tls.h | 51 +--- net/tls/tls_main.c | 103 +++

[PATCH V6 net-next 14/15] MAINTAINERS: Update mlx5 innova driver maintainers

2018-04-22 Thread Boris Pismenny
Signed-off-by: Boris Pismenny Signed-off-by: Saeed Mahameed --- MAINTAINERS | 17 - 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/MAINTAINERS b/MAINTAINERS index fc812fb..4bc79e3 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -9018,26 +9018,17 @@ W: http://ww

[PATCH V6 net-next 05/15] net: Add TLS TX offload features

2018-04-22 Thread Boris Pismenny
From: Ilya Lesokhin This patch adds a netdev feature to configure TLS TX offloads. Signed-off-by: Ilya Lesokhin Signed-off-by: Boris Pismenny Signed-off-by: Aviad Yehezkel --- include/linux/netdev_features.h | 2 ++ net/core/ethtool.c | 1 + 2 files changed, 3 insertions(+) dif

[PATCH V6 net-next 01/15] tcp: Add clean acked data hook

2018-04-22 Thread Boris Pismenny
From: Ilya Lesokhin Called when a TCP segment is acknowledged. Could be used by application protocols who hold additional metadata associated with the stream data. This is required by TLS device offload to release metadata associated with acknowledged TLS records. Signed-off-by: Ilya Lesokhin

[PATCH V6 net-next 11/15] net/mlx5e: TLS, Add Innova TLS TX support

2018-04-22 Thread Boris Pismenny
From: Ilya Lesokhin Add NETIF_F_HW_TLS_TX capability and expose tlsdev_ops to work with the TLS generic NIC offload infrastructure. The NETIF_F_HW_TLS_TX capability will be added in the next patch. Signed-off-by: Ilya Lesokhin Signed-off-by: Boris Pismenny Acked-by: Saeed Mahameed --- driver

[PATCH V6 net-next 07/15] net/tls: Add generic NIC offload infrastructure

2018-04-22 Thread Boris Pismenny
From: Ilya Lesokhin This patch adds a generic infrastructure to offload TLS crypto to a network device. It enables the kernel TLS socket to skip encryption and authentication operations on the transmit side of the data path. Leaving those computationally expensive operations to the NIC. The NIC

[PATCH V6 net-next 08/15] net/tls: Support TLS device offload with IPv6

2018-04-22 Thread Boris Pismenny
From: Ilya Lesokhin Previously get_netdev_for_sock worked only with IPv4. Signed-off-by: Ilya Lesokhin Signed-off-by: Boris Pismenny --- net/tls/tls_device.c | 51 ++- 1 file changed, 50 insertions(+), 1 deletion(-) diff --git a/net/tls/tls_dev

[PATCH V6 net-next 03/15] net: Add Software fallback infrastructure for socket dependent offloads

2018-04-22 Thread Boris Pismenny
From: Ilya Lesokhin With socket dependent offloads we rely on the netdev to transform the transmitted packets before sending them to the wire. When a packet from an offloaded socket is rerouted to a different device we need to detect it and do the transformation in software. Signed-off-by: Ilya

[PATCH V6 net-next 09/15] net/mlx5e: Move defines out of ipsec code

2018-04-22 Thread Boris Pismenny
From: Ilya Lesokhin The defines are not IPSEC specific. Signed-off-by: Ilya Lesokhin Signed-off-by: Boris Pismenny Acked-by: Saeed Mahameed --- drivers/net/ethernet/mellanox/mlx5/core/en.h | 3 +++ drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec.h | 3 --- drivers/net/ethe

[PATCH V6 net-next 10/15] net/mlx5: Accel, Add TLS tx offload interface

2018-04-22 Thread Boris Pismenny
From: Ilya Lesokhin Add routines for manipulating TLS TX offload contexts. In Innova TLS, TLS contexts are added or deleted via a command message over the SBU connection. The HW then sends a response message over the same connection. Add implementation for Innova TLS (FPGA-based) hardware. The

[PATCH V6 net-next 12/15] net/mlx5e: TLS, Add Innova TLS TX offload data path

2018-04-22 Thread Boris Pismenny
From: Ilya Lesokhin Implement the TLS tx offload data path according to the requirements of the TLS generic NIC offload infrastructure. Special metadata ethertype is used to pass information to the hardware. Signed-off-by: Ilya Lesokhin Signed-off-by: Boris Pismenny Acked-by: Saeed Mahameed

[PATCH V6 net-next 00/15] TLS offload, netdev & MLX5 support

2018-04-22 Thread Boris Pismenny
Hi Dave, The following series provides TLS TX inline crypto offload. v1->v2: - Added IS_ENABLED(CONFIG_TLS_DEVICE) and a STATIC_KEY for icsk_clean_acked - File license fix - Fix spelling, comment by DaveW - Move memory allocations out of tls_set_device_offload and other misc fixes,

[PATCH V6 net-next 15/15] MAINTAINERS: Update TLS maintainers

2018-04-22 Thread Boris Pismenny
Signed-off-by: Boris Pismenny Signed-off-by: Saeed Mahameed --- MAINTAINERS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MAINTAINERS b/MAINTAINERS index 4bc79e3..9e218d1 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -9820,7 +9820,7 @@ F:net/netfilter/xt_CONNSECMARK

[PATCH V6 net-next 13/15] net/mlx5e: TLS, Add error statistics

2018-04-22 Thread Boris Pismenny
From: Ilya Lesokhin Add statistics for rare TLS related errors. Since the errors are rare we have a counter per netdev rather then per SQ. Signed-off-by: Ilya Lesokhin Signed-off-by: Boris Pismenny Acked-by: Saeed Mahameed --- drivers/net/ethernet/mellanox/mlx5/core/Makefile | 2 +- drive

[PATCH V6 net-next 02/15] net: Rename and export copy_skb_header

2018-04-22 Thread Boris Pismenny
From: Ilya Lesokhin copy_skb_header is renamed to skb_copy_header and exported. Exposing this function give more flexibility in copying SKBs. skb_copy and skb_copy_expand do not give enough control over which parts are copied. Signed-off-by: Ilya Lesokhin Signed-off-by: Boris Pismenny --- inc

[PATCH V6 net-next 04/15] net: Add TLS offload netdev ops

2018-04-22 Thread Boris Pismenny
From: Ilya Lesokhin Add new netdev ops to add and delete tls context Signed-off-by: Ilya Lesokhin Signed-off-by: Boris Pismenny Signed-off-by: Aviad Yehezkel --- include/linux/netdevice.h | 24 1 file changed, 24 insertions(+) diff --git a/include/linux/netdevice.h

[PATCH] r8169: don't use netif_info et al before net_device has been registered

2018-04-22 Thread Heiner Kallweit
There's no benefit in using netif_info et al before the net_device has been registered. We get messages like r8169 :03:00.0 (unnamed net_device) (uninitialized): [message] Therefore use dev_info/dev_err instead. As a side effect we don't need parameter dev for function rtl8169_get_mac_version(

Re: [PATCH/RFC net-next 5/5] ravb: remove tx buffer addr 4byte alilgnment restriction for R-Car Gen3

2018-04-22 Thread Sergei Shtylyov
Hello! On 4/17/2018 11:50 AM, Simon Horman wrote: From: Kazuya Mizuguchi This patch sets from two descriptor to one descriptor because R-Car Gen3 does not have the 4 bytes alignment restriction of the transmission buffer. Signed-off-by: Kazuya Mizuguchi Signed-off-by: Simon Horman [...]

[PATCH net-next] net: init sk_cookie for inet socket

2018-04-22 Thread Yafang Shao
With sk_cookie we can identify a socket, that is very helpful for traceing and statistic, i.e. tcp tracepiont and ebpf. So we'd better init it by default for inet socket. When using it, we just need call atomic64_read(&sk->sk_cookie). Signed-off-by: Yafang Shao --- include/linux/sock_diag.h | 9

Re: [PATCH] kvmalloc: always use vmalloc if CONFIG_DEBUG_VM

2018-04-22 Thread Michal Hocko
On Sat 21-04-18 07:47:57, Matthew Wilcox wrote: > On Fri, Apr 20, 2018 at 05:21:26PM -0400, Mikulas Patocka wrote: > > On Fri, 20 Apr 2018, Matthew Wilcox wrote: > > > On Fri, Apr 20, 2018 at 04:54:53PM -0400, Mikulas Patocka wrote: > > > > On Fri, 20 Apr 2018, Michal Hocko wrote: > > > > > No way.

Re: linux-next on x60: network manager often complains "network is disabled" after resume

2018-04-22 Thread Woody Suwalski
Pavel Machek wrote: On Tue 2018-03-20 21:11:54, Woody Suwalski wrote: Woody Suwalski wrote: Pavel Machek wrote: On Mon 2018-03-19 05:17:45, Woody Suwalski wrote: Pavel Machek wrote: Hi! With recent linux-next, after resume networkmanager often claims that "network is disabled". Sometimes su

  1   2   >