[PATCH bpf-next v8 06/12] bpf: Adds field bpf_sock_ops_cb_flags to tcp_sock

2018-01-23 Thread Lawrence Brakmo
Adds field bpf_sock_ops_cb_flags to tcp_sock and bpf_sock_ops. Its primary use is to determine if there should be calls to sock_ops bpf program at various points in the TCP code. The field is initialized to zero, disabling the calls. A sock_ops BPF program can set it, per connection and as necessar

[PATCH bpf-next v8 01/12] bpf: Make SOCK_OPS_GET_TCP size independent

2018-01-23 Thread Lawrence Brakmo
Make SOCK_OPS_GET_TCP helper macro size independent (before only worked with 4-byte fields. Signed-off-by: Lawrence Brakmo --- net/core/filter.c | 13 - 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/net/core/filter.c b/net/core/filter.c index 18da42a..31c10a4 100644 -

[PATCH bpf-next v8 04/12] bpf: Only reply field should be writeable

2018-01-23 Thread Lawrence Brakmo
Currently, a sock_ops BPF program can write the op field and all the reply fields (reply and replylong). This is a bug. The op field should not have been writeable and there is currently no way to use replylong field for indices >= 1. This patch enforces that only the reply field (which equals repl

[PATCH bpf-next v8 03/12] bpf: Add write access to tcp_sock and sock fields

2018-01-23 Thread Lawrence Brakmo
This patch adds a macro, SOCK_OPS_SET_FIELD, for writing to struct tcp_sock or struct sock fields. This required adding a new field "temp" to struct bpf_sock_ops_kern for temporary storage that is used by sock_ops_convert_ctx_access. It is used to store and recover the contents of a register, so th

[PATCH bpf-next v8 08/12] bpf: Add support for reading sk_state and more

2018-01-23 Thread Lawrence Brakmo
Add support for reading many more tcp_sock fields state,same as sk->sk_state rtt_min same as sk->rtt_min.s[0].v (current rtt_min) snd_ssthresh rcv_nxt snd_nxt snd_una mss_cache ecn_flags rate_delivered rate_interval_us packets_out retrans_out total_retrans

[PATCH bpf-next v8 12/12] bpf: add selftest for tcpbpf

2018-01-23 Thread Lawrence Brakmo
Added a selftest for tcpbpf (sock_ops) that checks that the appropriate callbacks occured and that it can access tcp_sock fields and that their values are correct. Run with command: ./test_tcpbpf_user Signed-off-by: Lawrence Brakmo Acked-by: Alexei Starovoitov --- tools/include/uapi/linux/bpf.

[PATCH bpf-next v8 11/12] bpf: Add BPF_SOCK_OPS_STATE_CB

2018-01-23 Thread Lawrence Brakmo
Adds support for calling sock_ops BPF program when there is a TCP state change. Two arguments are used; one for the old state and another for the new state. There is a new enum in include/uapi/linux/bpf.h that exports the TCP states that prepends BPF_ to the current TCP state names. If it is ever

[PATCH bpf-next v8 10/12] bpf: Add BPF_SOCK_OPS_RETRANS_CB

2018-01-23 Thread Lawrence Brakmo
Adds support for calling sock_ops BPF program when there is a retransmission. Two arguments are used; one for the sequence number and other for the number of segments retransmitted. Does not include syn-ack retransmissions. New op: BPF_SOCK_OPS_RETRANS_CB. Signed-off-by: Lawrence Brakmo --- inc

[PATCH bpf-next v8 05/12] bpf: Support passing args to sock_ops bpf function

2018-01-23 Thread Lawrence Brakmo
Adds support for passing up to 4 arguments to sock_ops bpf functions. It reusues the reply union, so the bpf_sock_ops structures are not increased in size. Signed-off-by: Lawrence Brakmo --- include/linux/filter.h | 1 + include/net/tcp.h| 40 +++-

[PATCH bpf-next v8 09/12] bpf: Add sock_ops R/W access to tclass

2018-01-23 Thread Lawrence Brakmo
Adds direct write access to sk_txhash and access to tclass for ipv6 flows through getsockopt and setsockopt. Sample usage for tclass: bpf_getsockopt(skops, SOL_IPV6, IPV6_TCLASS, &v, sizeof(v)) where skops is a pointer to the ctx (struct bpf_sock_ops). Signed-off-by: Lawrence Brakmo --- net/

[PATCH bpf-next v8 07/12] bpf: Add sock_ops RTO callback

2018-01-23 Thread Lawrence Brakmo
Adds an optional call to sock_ops BPF program based on whether the BPF_SOCK_OPS_RTO_CB_FLAG is set in bpf_sock_ops_flags. The BPF program is passed 2 arguments: icsk_retransmits and whether the RTO has expired. Signed-off-by: Lawrence Brakmo --- include/uapi/linux/bpf.h | 5 + include/uapi/l

[PATCH bpf-next v8 00/12] bpf: More sock_ops callbacks

2018-01-23 Thread Lawrence Brakmo
This patchset adds support for: - direct R or R/W access to many tcp_sock fields - passing up to 4 arguments to sock_ops BPF functions - tcp_sock field bpf_sock_ops_cb_flags for controlling callbacks - optionally calling sock_ops BPF program when RTO fires - optionally calling sock_ops BPF program

[PATCH bpf-next v8 02/12] bpf: Make SOCK_OPS_GET_TCP struct independent

2018-01-23 Thread Lawrence Brakmo
Changed SOCK_OPS_GET_TCP to SOCK_OPS_GET_FIELD and added 2 arguments so now it can also work with struct sock fields. The first argument is the name of the field in the bpf_sock_ops struct, the 2nd argument is the name of the field in the OBJ struct. Previous: SOCK_OPS_GET_TCP(FIELD_NAME) New:

Re: WARNING in check_flush_dependency

2018-01-23 Thread Johannes Berg
On Mon, 2018-01-22 at 23:39 -0800, syzbot wrote: > Hello, > > syzbot hit the following crash on upstream commit > 0d665e7b109d512b7cae3ccef6e8654714887844 (Fri Jan 19 12:49:24 2018 +) > mm, page_vma_mapped: Drop faulty pointer arithmetics in check_pte() > > So far this crash happened 23 times

[PATCH bpf-next v7 12/12] bpf: add selftest for tcpbpf callbacks

2018-01-23 Thread Lawrence Brakmo
Added a selftest for tcpbpf (sock_ops) that checks that the appropriate callbacks occured and that it can access tcp_sock fields and that their values are correct. Run with command: ./test_tcpbpf_user Signed-off-by: Lawrence Brakmo --- tools/include/uapi/linux/bpf.h | 74 ++

[PATCH bpf-next v7 07/12] bpf: Add sock_ops RTO callback

2018-01-23 Thread Lawrence Brakmo
Adds an optional call to sock_ops BPF program based on whether the BPF_SOCK_OPS_RTO_CB_FLAG is set in bpf_sock_ops_flags. The BPF program is passed 2 arguments: icsk_retransmits and whether the RTO has expired. Signed-off-by: Lawrence Brakmo --- include/uapi/linux/bpf.h | 5 + include/uapi/l

[PATCH bpf-next v7 09/12] bpf: Add sock_ops R/W access to tclass

2018-01-23 Thread Lawrence Brakmo
Adds direct write access to sk_txhash and access to tclass for ipv6 flows through getsockopt and setsockopt. Sample usage for tclass: bpf_getsockopt(skops, SOL_IPV6, IPV6_TCLASS, &v, sizeof(v)) where skops is a pointer to the ctx (struct bpf_sock_ops). Signed-off-by: Lawrence Brakmo --- net/

[PATCH bpf-next v7 02/12] bpf: Make SOCK_OPS_GET_TCP struct independent

2018-01-23 Thread Lawrence Brakmo
Changed SOCK_OPS_GET_TCP to SOCK_OPS_GET_FIELD and added 2 arguments so now it can also work with struct sock fields. The first argument is the name of the field in the bpf_sock_ops struct, the 2nd argument is the name of the field in the OBJ struct. Previous: SOCK_OPS_GET_TCP(FIELD_NAME) New:

[PATCH bpf-next v7 03/12] bpf: Add write access to tcp_sock and sock fields

2018-01-23 Thread Lawrence Brakmo
This patch adds a macro, SOCK_OPS_SET_FIELD, for writing to struct tcp_sock or struct sock fields. This required adding a new field "temp" to struct bpf_sock_ops_kern for temporary storage that is used by sock_ops_convert_ctx_access. It is used to store and recover the contents of a register, so th

[PATCH bpf-next v7 01/12] bpf: Make SOCK_OPS_GET_TCP size independent

2018-01-23 Thread Lawrence Brakmo
Make SOCK_OPS_GET_TCP helper macro size independent (before only worked with 4-byte fields. Signed-off-by: Lawrence Brakmo --- net/core/filter.c | 13 - 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/net/core/filter.c b/net/core/filter.c index 18da42a..31c10a4 100644 -

[PATCH bpf-next v7 10/12] bpf: Add BPF_SOCK_OPS_RETRANS_CB

2018-01-23 Thread Lawrence Brakmo
Adds support for calling sock_ops BPF program when there is a retransmission. Two arguments are used; one for the sequence number and other for the number of segments retransmitted. Does not include syn-ack retransmissions. New op: BPF_SOCK_OPS_RETRANS_CB. Signed-off-by: Lawrence Brakmo --- inc

[PATCH bpf-next v7 08/12] bpf: Add support for reading sk_state and more

2018-01-23 Thread Lawrence Brakmo
Add support for reading many more tcp_sock fields state,same as sk->sk_state rtt_min same as sk->rtt_min.s[0].v (current rtt_min) snd_ssthresh rcv_nxt snd_nxt snd_una mss_cache ecn_flags rate_delivered rate_interval_us packets_out retrans_out total_retrans

[PATCH bpf-next v7 06/12] bpf: Adds field bpf_sock_ops_cb_flags to tcp_sock

2018-01-23 Thread Lawrence Brakmo
Adds field bpf_sock_ops_cb_flags to tcp_sock and bpf_sock_ops. Its primary use is to determine if there should be calls to sock_ops bpf program at various points in the TCP code. The field is initialized to zero, disabling the calls. A sock_ops BPF program can set it, per connection and as necessar

[PATCH bpf-next v7 11/12] bpf: Add BPF_SOCK_OPS_STATE_CB

2018-01-23 Thread Lawrence Brakmo
Adds support for calling sock_ops BPF program when there is a TCP state change. Two arguments are used; one for the old state and another for the new state. There is a new enum in include/uapi/linux/bpf.h that exports the TCP states that prepends BPF_ to the current TCP state names. If it is ever

[PATCH bpf-next v7 05/12] bpf: Support passing args to sock_ops bpf function

2018-01-23 Thread Lawrence Brakmo
Adds support for passing up to 4 arguments to sock_ops bpf functions. It reusues the reply union, so the bpf_sock_ops structures are not increased in size. Signed-off-by: Lawrence Brakmo --- include/linux/filter.h | 1 + include/net/tcp.h| 40 +++-

[PATCH bpf-next v7 04/12] bpf: Only reply field should be writeable

2018-01-23 Thread Lawrence Brakmo
Currently, a sock_ops BPF program can write the op field and all the reply fields (reply and replylong). This is a bug. The op field should not have been writeable and there is currently no way to use replylong field for indices >= 1. This patch enforces that only the reply field (which equals repl

Re: Memory corruption with r8169 across several device revisions and kernels

2018-01-23 Thread Andreas Hartmann
On 01/24/2018 at 06:31 AM Andreas Hartmann wrote: > On 01/23/2018 at 04:47 PM Oliver Freyermuth wrote: >> Am 23.01.2018 um 16:28 schrieb David Miller: >>> Looking at how these DMA counters are handled, there appears to be a >>> requirement that the memory buffer is 64-byte aligned. >>> >>> [...] >>

Re: [PATCH target-pending] iscsi-target: make sure to wake up sleeping login worker

2018-01-23 Thread Nicholas A. Bellinger
Hey Florian & Co, On Fri, 2018-01-19 at 18:26 +0100, Florian Westphal wrote: > Eric Dumazet wrote: > > On Fri, 2018-01-19 at 14:36 +0100, Florian Westphal wrote: > > > diff --git a/drivers/target/iscsi/iscsi_target_nego.c > > > b/drivers/target/iscsi/iscsi_target_nego.c > > > index b686e2ce9c0e.

Re: [net-next: PATCH v4 1/7] device property: Introduce fwnode_get_mac_address()

2018-01-23 Thread Marcin Wojtas
Hi Rafael, 2018-01-24 3:08 GMT+01:00 Rafael J. Wysocki : > On Tue, Jan 23, 2018 at 7:12 AM, Marcin Wojtas wrote: >> Hi Rafael, >> >>> > if (res) >>> > return res; >>> > >>> > - return device_get_mac_addr(dev, "address", addr, alen); >>> > + return fwnode_get_ma

Re: [PATCH] xfrm: fix boolean assignment in xfrm_get_type_offload

2018-01-23 Thread Steffen Klassert
On Mon, Jan 22, 2018 at 04:34:09PM -0600, Gustavo A. R. Silva wrote: > Assign true or false to boolean variables instead of an integer value. > > This issue was detected with the help of Coccinelle. > > Fixes: ffdb5211da1c ("xfrm: Auto-load xfrm offload modules") > Signed-off-by: Gustavo A. R. Si

Re: [PATCH net] xfrm: Fix eth_hdr(skb)->h_proto to reflect inner IP version

2018-01-23 Thread Steffen Klassert
On Tue, Jan 23, 2018 at 12:16:21AM +0200, yoss...@mellanox.com wrote: > From: Yossi Kuperman > > IPSec tunnel mode supports encapsulation of IPv4 over IPv6 and vice-versa. > > The outer IP header is stripped and the inner IP inherits the original > Ethernet header. Tcpdump fails to properly deco

Re: Memory corruption with r8169 across several device revisions and kernels

2018-01-23 Thread Andreas Hartmann
On 01/23/2018 at 04:47 PM Oliver Freyermuth wrote: > Am 23.01.2018 um 16:28 schrieb David Miller: >> Looking at how these DMA counters are handled, there appears to be a >> requirement that the memory buffer is 64-byte aligned. >> >> [...] >> >> Therefore the driver needs to allocate "size + (64 -

Re: [PATCH net-next] net/ipv6: Do not allow route add with a device that is down

2018-01-23 Thread Roopa Prabhu
On Tue, Jan 23, 2018 at 7:13 PM, David Ahern wrote: > IPv6 allows routes to be installed when the device is not up (admin up). > Worse, it does not mark it as LINKDOWN. IPv4 does not allow it and really > there is no reason for IPv6 to allow it, so check the flags and deny if > device is admin dow

Re: [PATCH v3 1/2] skbuff: Add skb_network_trim

2018-01-23 Thread Pravin Shelar
On Mon, Jan 22, 2018 at 6:42 PM, Ed Swierk wrote: > IPv4 and IPv6 packets may arrive with lower-layer padding that is not > included in the L3 length. For example, a short IPv4 packet may have > up to 6 bytes of padding following the IP payload when received on an > Ethernet device with a minimum

[PATCH bpf-next] selftests/bpf: make 'dubious pointer arithmetic' test useful

2018-01-23 Thread Alexei Starovoitov
mostly revert the previous workaround and make 'dubious pointer arithmetic' test useful again. Use (ptr - ptr) << const instead of ptr << const to generate large scalar. The rest stays as before commit 2b36047e7889. Fixes: 2b36047e7889 ("selftests/bpf: fix test_align") Signed-off-by: Alexei Starov

[PATCH] net:l2tp: Allow MAC to be configured via netlink

2018-01-23 Thread Isaac Lee
The linux kernel by default uses random MAC address for l2tp interfaces. However, there are situations where it is desirable to have a deterministic MAC address. A sample scenario would be where the host IP stack is attached directly to a tunnel hence the "random" address is now propagated via ARP

Re: [PATCH iproute2-next v2 0/8] ip: Introduce and use get_addr_rta()/inet_addr_match_rta()

2018-01-23 Thread David Ahern
On 1/23/18 12:19 PM, Serhey Popovych wrote: > Now we enhance get_addr() to return additional > information about address (e.g. if it unspecified > or multicast) we want to have same functionality > for attributes in netlink message. > > Introduce and use get_addr_rta() that parses > given netlink

RE: [Intel-wired-lan] [PATCH] igb: add VF trust infrastructure

2018-01-23 Thread Brown, Aaron F
> From: Intel-wired-lan [mailto:intel-wired-lan-boun...@osuosl.org] On > Behalf Of Alexander Duyck > Sent: Monday, January 22, 2018 2:58 PM > To: intel-wired-lan ; Netdev > > Cc: Corinna Vinschen > Subject: Re: [Intel-wired-lan] [PATCH] igb: add VF trust infrastructure > > Hi Corinna, > > I've

[PATCH net-next] net/ipv6: Do not allow route add with a device that is down

2018-01-23 Thread David Ahern
IPv6 allows routes to be installed when the device is not up (admin up). Worse, it does not mark it as LINKDOWN. IPv4 does not allow it and really there is no reason for IPv6 to allow it, so check the flags and deny if device is admin down. Signed-off-by: David Ahern --- net/ipv6/route.c | 5 +++

Re: [Intel-wired-lan] [RFC v2 net-next 01/10] net: Add a new socket option for a future transmit time.

2018-01-23 Thread Richard Cochran
On Tue, Jan 23, 2018 at 01:22:37PM -0800, Vinicius Costa Gomes wrote: > What I think would be the ideal scenario would be if the clockid > parameter to the TBS Qdisc would not be necessary (if offload was > enabled), but that's not quite possible right now, because there's no > support for using th

[PATCH net-next 3/3] net/ipv6: Add support for onlink flag

2018-01-23 Thread David Ahern
Similar to IPv4 allow routes to be added with the RTNH_F_ONLINK flag. The onlink option requires a gateway and a nexthop device. Any unicast gateway is allowed (including IPv4 mapped addresses and unresolved ones) as long as the gateway is not a local address and if it resolves it must match the gi

[PATCH net-next 1/3] net/ipv6: Move gateway validation into helper

2018-01-23 Thread David Ahern
Move existing code to validate nexthop into a helper. Next patch adds support for nexthops marked with onlink and this helper keeps the complexity of ip6_route_info_create in check. Signed-off-by: David Ahern --- net/ipv6/route.c | 85 1 f

[PATCH net-next 2/3] net/ipv6: Add flags arg to ip6_nh_lookup_table

2018-01-23 Thread David Ahern
onlink verification needs to do a lookup without the RT6_LOOKUP_F_IFACE flag. Change ip6_nh_lookup_table to take a flags argument and pass RT6_LOOKUP_F_IFACE. Both verifications want to ignore link state, so add that in the lookup helper. Signed-off-by: David Ahern --- net/ipv6/route.c | 9 +

[PATCH net-next 0/3] net/ipv6: Add support for ONLINK flag

2018-01-23 Thread David Ahern
Add support for RTNH_F_ONLINK with ipv6 routes. First patch moves existing gateway validation into helper. The onlink flag requires a different set of checks and the existing validation makes ip6_route_info_create long enough. Second patch makes the RT6_LOOKUP_F_IFACE flag an option to ip6_nh_lo

[PATCH net-next 02/12] net: sched: prepare for reimplementation of tc_cls_common_offload_init()

2018-01-23 Thread Jakub Kicinski
Rename tc_cls_common_offload_init() to tc_cls_common_offload_init__() and add a new implementation which also takes flags argument. We will only set extack if flags indicate that offload is forced (skip_sw) otherwise driver errors should be ignored, as they don't influence the overall filter insta

[PATCH net-next 06/12] cls_matchall: pass offload flags to tc_cls_common_offload_init()

2018-01-23 Thread Jakub Kicinski
Pass offload flags to the new implementation of tc_cls_common_offload_init(). Extack will now only be set if user requested skip_sw. Signed-off-by: Jakub Kicinski Reviewed-by: Simon Horman --- net/sched/cls_matchall.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/net/

[PATCH net-next 04/12] cls_bpf: pass offload flags to tc_cls_common_offload_init()

2018-01-23 Thread Jakub Kicinski
Pass offload flags to the new implementation of tc_cls_common_offload_init(). Extack will now only be set if user requested skip_sw. Signed-off-by: Jakub Kicinski Reviewed-by: Simon Horman --- net/sched/cls_bpf.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/net/sche

[PATCH net-next 08/12] cls_flower: pass offload flags to tc_cls_common_offload_init()

2018-01-23 Thread Jakub Kicinski
Pass offload flags to the new implementation of tc_cls_common_offload_init(). Extack will now only be set if user requested skip_sw. Signed-off-by: Jakub Kicinski Reviewed-by: Simon Horman --- net/sched/cls_flower.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/net/

[PATCH net-next 12/12] net: sched: remove tc_cls_common_offload_init__()

2018-01-23 Thread Jakub Kicinski
All users are now converted to tc_cls_common_offload_init(). Signed-off-by: Jakub Kicinski Reviewed-by: Simon Horman --- include/net/pkt_cls.h | 11 --- 1 file changed, 11 deletions(-) diff --git a/include/net/pkt_cls.h b/include/net/pkt_cls.h index 14b0674e062a..1a41513cec7f 100644 --

[PATCH net-next 09/12] cls_flower: propagate extack to delete callback

2018-01-23 Thread Jakub Kicinski
Propagate extack on removal of offloaded filter. Don't pass extack from error paths. Signed-off-by: Jakub Kicinski Reviewed-by: Simon Horman --- net/sched/cls_flower.c | 18 ++ 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/net/sched/cls_flower.c b/net/sched/cls

[PATCH net-next 11/12] cls_u32: propagate extack to delete callback

2018-01-23 Thread Jakub Kicinski
Propagate extack on removal of offloaded filter. Don't pass extack from error paths. Signed-off-by: Jakub Kicinski Reviewed-by: Simon Horman --- net/sched/cls_u32.c | 34 +++--- 1 file changed, 19 insertions(+), 15 deletions(-) diff --git a/net/sched/cls_u32.c b/ne

[PATCH net-next 10/12] cls_u32: pass offload flags to tc_cls_common_offload_init()

2018-01-23 Thread Jakub Kicinski
Pass offload flags to the new implementation of tc_cls_common_offload_init(). Extack will now only be set if user requested skip_sw. hnodes need to hold onto the flags now to be able to reuse them on filter removal. Signed-off-by: Jakub Kicinski Reviewed-by: Simon Horman --- net/sched/cls_u32

[PATCH net-next 07/12] cls_matchall: propagate extack to delete callback

2018-01-23 Thread Jakub Kicinski
Propagate extack on removal of offloaded filter. Don't pass extack from error paths. Signed-off-by: Jakub Kicinski Reviewed-by: Simon Horman --- net/sched/cls_matchall.c | 9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/net/sched/cls_matchall.c b/net/sched/cls_matcha

[PATCH net-next 05/12] cls_bpf: propagate extack to offload delete callback

2018-01-23 Thread Jakub Kicinski
Propagate extack on removal of offloaded filter. Signed-off-by: Jakub Kicinski Reviewed-by: Simon Horman --- net/sched/cls_bpf.c | 14 -- 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/net/sched/cls_bpf.c b/net/sched/cls_bpf.c index 323b01f76a4c..8e5326bc6440 100644 -

[PATCH net-next 03/12] cls_bpf: remove gen_flags from bpf_offload

2018-01-23 Thread Jakub Kicinski
cls_bpf now guarantees that only device-bound programs are allowed with skip_sw. The drivers no longer pay attention to flags on filter load, therefore the bpf_offload member can be removed. If flags are needed again they should probably be added to struct tc_cls_common_offload instead. Signed-o

[PATCH net-next 01/12] net: sched: propagate extack to cls->destroy callbacks

2018-01-23 Thread Jakub Kicinski
Propagate extack to cls->destroy callbacks when called from non-error paths. On error paths pass NULL to avoid overwriting the failure message. Signed-off-by: Jakub Kicinski Reviewed-by: Simon Horman --- include/net/sch_generic.h | 3 ++- net/sched/cls_api.c | 15 --- net/sc

[PATCH net-next 00/12] net: sched: propagate extack to cls offloads on destroy and only with skip_sw

2018-01-23 Thread Jakub Kicinski
Hi! This series some of Jiri's comments and the fact that today drivers may produce extack even if there is no skip_sw flag (meaning the driver failure is not really a problem), and warning messages will only confuse the users. First patch propagates extack to destroy as requested by Jiri, extack

Re: [PATCH] net: Make synchronize_net() be expedited only when it's really need

2018-01-23 Thread Kirill Tkhai
On 23.01.2018 19:26, Stephen Hemminger wrote: > On Mon, 22 Jan 2018 12:41:41 +0300 > Kirill Tkhai wrote: > >> Commit be3fc413da9e "net: use synchronize_rcu_expedited()" introducing >> synchronize_net() says: >> >> >When we hold RTNL mutex, we would like to spend some cpu cycles but not >>

Re: [net-next: PATCH v4 1/7] device property: Introduce fwnode_get_mac_address()

2018-01-23 Thread Rafael J. Wysocki
On Tue, Jan 23, 2018 at 7:12 AM, Marcin Wojtas wrote: > Hi Rafael, > >> > if (res) >> > return res; >> > >> > - return device_get_mac_addr(dev, "address", addr, alen); >> > + return fwnode_get_mac_addr(fwnode, "address", addr, alen); >> > +} >> > +EXPORT_SYMBOL(

[PATCH net-next] cxgb4: make symbol pedits static

2018-01-23 Thread Wei Yongjun
Fixes the following sparse warning: drivers/net/ethernet/chelsio/cxgb4/cxgb4_tc_flower.c:46:27: warning: symbol 'pedits' was not declared. Should it be static? Fixes: 27ece1f357b7 ("cxgb4: add tc flower support for ETH-DMAC rewrite") Signed-off-by: Wei Yongjun --- drivers/net/ethernet/chelsio/

Re: [RFC v2 net-next 00/10] Time based packet transmission

2018-01-23 Thread Levi Pearson
On Wed, Jan 17, 2018 at 4:06 PM, Jesus Sanchez-Palencia wrote: > This series is the v2 of the Time based packet transmission RFC, which was > originally proposed by Richard Cochran: https://lwn.net/Articles/733962/ . Great to see you carrying on with this! > Our main questions at this stage are

Re: [PATCH bpf-next v6 04/11] bpf: Support passing args to sock_ops bpf function

2018-01-23 Thread Daniel Borkmann
On 01/24/2018 02:30 AM, Lawrence Brakmo wrote: > On 1/23/18, 5:11 PM, "Daniel Borkmann" wrote: [...] > > +{ > > + return -EPERM; > > +} > > + > > +static inline int tcp_call_bpf_4arg(struct sock *sk, int op, u32 arg1, > u32 arg2, > > +

Re: Memory corruption with r8169 across several device revisions and kernels

2018-01-23 Thread David Miller
From: Oliver Freyermuth Date: Wed, 24 Jan 2018 02:21:55 +0100 > Am 23.01.2018 um 23:13 schrieb Francois Romieu: >> >> It helps. Can you try the snippet below ? > > It seems to fix the issue - I could not reproduce memory corruption > anymore neither on an Ubuntu 17.10.1 live system (with patche

Re: [PATCH bpf-next v6 04/11] bpf: Support passing args to sock_ops bpf function

2018-01-23 Thread Lawrence Brakmo
On 1/23/18, 5:11 PM, "Daniel Borkmann" wrote: On 01/20/2018 02:45 AM, Lawrence Brakmo wrote: > Adds support for passing up to 4 arguments to sock_ops bpf functions. It > reusues the reply union, so the bpf_sock_ops structures are not > increased in size. > > Signed-off-by

Re: [PATCH bpf-next v6 07/11] bpf: Add support for reading sk_state and more

2018-01-23 Thread Lawrence Brakmo
On 1/23/18, 5:05 PM, "Daniel Borkmann" wrote: On 01/20/2018 02:45 AM, Lawrence Brakmo wrote: > Add support for reading many more tcp_sock fields > > state, same as sk->sk_state > rtt_min same as sk->rtt_min.s[0].v (current rtt_min) > snd_ssthresh > rcv_nxt

Re: [PATCH net-next 0/5] bpf and netdevsim test updates

2018-01-23 Thread David Miller
From: Jakub Kicinski Date: Tue, 23 Jan 2018 11:22:51 -0800 > A number of test improvements (delayed by merges). Quentin provides > patches for checking printing to the verifier log from the drivers > and validating extack messages are propagated. There is also a test > for replacing TC filters

Re: [net-next 00/12][pull request] 40GbE Intel Wired LAN Driver Updates 2018-01-23

2018-01-23 Thread David Miller
From: Jeff Kirsher Date: Tue, 23 Jan 2018 12:38:32 -0800 > This series contains updates to i40e and i40evf only. Pulled, thanks Jeff.

Re: Memory corruption with r8169 across several device revisions and kernels

2018-01-23 Thread Oliver Freyermuth
Am 23.01.2018 um 23:13 schrieb Francois Romieu: > > It helps. Can you try the snippet below ? It seems to fix the issue - I could not reproduce memory corruption anymore neither on an Ubuntu 17.10.1 live system (with patched kernel module) nor on my Gentoo system (4.14.12 with your patch applied)

Re: [PATCH bpf-next v6 04/11] bpf: Support passing args to sock_ops bpf function

2018-01-23 Thread Daniel Borkmann
On 01/20/2018 02:45 AM, Lawrence Brakmo wrote: > Adds support for passing up to 4 arguments to sock_ops bpf functions. It > reusues the reply union, so the bpf_sock_ops structures are not > increased in size. > > Signed-off-by: Lawrence Brakmo > --- > include/linux/filter.h | 1 + > include/n

Re: [PATCH v3 1/2] skbuff: Add skb_network_trim

2018-01-23 Thread David Miller
From: Ed Swierk Date: Mon, 22 Jan 2018 18:42:18 -0800 > IPv4 and IPv6 packets may arrive with lower-layer padding that is not > included in the L3 length. For example, a short IPv4 packet may have > up to 6 bytes of padding following the IP payload when received on an > Ethernet device with a min

Re: [PATCH bpf-next v6 07/11] bpf: Add support for reading sk_state and more

2018-01-23 Thread Daniel Borkmann
On 01/20/2018 02:45 AM, Lawrence Brakmo wrote: > Add support for reading many more tcp_sock fields > > state, same as sk->sk_state > rtt_min same as sk->rtt_min.s[0].v (current rtt_min) > snd_ssthresh > rcv_nxt > snd_nxt > snd_una > mss_cache > ecn_flags > rate_delivered

[PATCH net] net: erspan: fix use-after-free

2018-01-23 Thread William Tu
When building the erspan header for either v1 or v2, the eth_hdr() does not point to the right inner packet's eth_hdr, causing kasan report use-after-free and slab-out-of-bouds read. The patch fixes the following syzkaller issues: [1] BUG: KASAN: slab-out-of-bounds in erspan_xmit+0x22d4/0x2430 ne

[PATCH net-next 2/2] kcm: Check if sk_user_data already set in kcm_attach

2018-01-23 Thread Tom Herbert
This is needed to prevent sk_user_data being overwritten. The check is done under the callback lock. This should prevent a socket from being attached twice to a KCM mux. It also prevents a socket from being attached for other use cases of sk_user_data as long as the other cases set sk_user_data und

[PATCH net-next 1/2] kcm: Only allow TCP sockets to be attached to a KCM mux

2018-01-23 Thread Tom Herbert
TCP sockets for IPv4 and IPv6 that are not listeners or in closed stated are allowed to be attached to a KCM mux. Fixes: ab7ac4eb9832 ("kcm: Kernel Connection Multiplexor module") Reported-by: syzbot+8865eaff7f9acd593...@syzkaller.appspotmail.com Signed-off-by: Tom Herbert --- net/kcm/kcmsock.c

[PATCH net-next 0/2] kcm: fix two syzcaller issues

2018-01-23 Thread Tom Herbert
In this patch set: - Don't allow attaching non-TCP or listener sockets to a KCM mux. - In kcm_attach Check if sk_user_data is already set. This is under lock to avoid race conditions. More work is need to make all of the users of sk_user_data to use the same locking. Tom Herbert (2): kcm: O

Re: [PATCH] vmxnet3: repair memory leak

2018-01-23 Thread David Miller
From: Neil Horman Date: Mon, 22 Jan 2018 16:06:37 -0500 > with the introduction of commit > b0eb57cb97e7837ebb746404c2c58c6f536f23fa, it appears that rq->buf_info > is improperly handled. While it is heap allocated when an rx queue is > setup, and freed when torn down, an old line of code in > v

Re: [PATCH v6 20/36] nds32: Signal handling support

2018-01-23 Thread Vincent Chen
2018-01-18 18:30 GMT+08:00 Arnd Bergmann : > On Mon, Jan 15, 2018 at 6:53 AM, Greentime Hu wrote: >> From: Greentime Hu >> >> This patch adds support for signal handling. >> >> Signed-off-by: Vincent Chen >> Signed-off-by: Greentime Hu > > I never feel qualified enough to properly review signal

Re: [PATCH net] ipv6: Fix getsockopt() for sockets with default IPV6_AUTOFLOWLABEL

2018-01-23 Thread David Miller
From: Ben Hutchings Date: Mon, 22 Jan 2018 20:06:42 + > Commit 513674b5a2c9 ("net: reevalulate autoflowlabel setting after > sysctl setting") removed the initialisation of > ipv6_pinfo::autoflowlabel and added a second flag to indicate > whether this field or the net namespace default should

Re: [PATCH net-next v3 0/2] net/sched: remove spinlock from 'csum' action

2018-01-23 Thread David Miller
From: Davide Caratti Date: Mon, 22 Jan 2018 18:14:30 +0100 > Similarly to what has been done earlier with other actions [1][2], this > series tries to improve the performance of 'csum' tc action, removing a > spinlock in the data path. Patch 1 lets act_csum use per-CPU counters; > patch 2 removes

Re: [PATCH net] pppoe: take ->needed_headroom of lower device into account on xmit

2018-01-23 Thread David Miller
From: Guillaume Nault Date: Mon, 22 Jan 2018 18:06:37 +0100 > In pppoe_sendmsg(), reserving dev->hard_header_len bytes of headroom > was probably fine before the introduction of ->needed_headroom in > commit f5184d267c1a ("net: Allow netdevices to specify needed head/tailroom"). > > But now, vir

Re: [PATCH net-next v2] net: link_watch: mark bonding link events urgent

2018-01-23 Thread David Miller
From: Roopa Prabhu Date: Mon, 22 Jan 2018 08:07:19 -0800 > From: Roopa Prabhu > > It takes 1sec for bond link down notification to hit user-space > when all slaves of the bond go down. 1sec is too long for > protocol daemons in user-space relying on bond notification > to recover (eg: multichas

Re: [PATCH] r8169: improve multicast hash filter handling

2018-01-23 Thread David Miller
From: Heiner Kallweit Date: Sun, 21 Jan 2018 14:52:37 +0100 > The multicast hash filter is a 64 bit value and the code can be > simplified by using a u64 variable. > > Signed-off-by: Heiner Kallweit This is a wash on 32-bit and probably generates worse code. So, I'm not applying this. Sorry.

Re: [PATCHv5 0/5] GEHC Bx50 Switch Support

2018-01-23 Thread David Miller
From: Sebastian Reichel Date: Tue, 23 Jan 2018 16:03:45 +0100 > This adds support for the internal switch found in GE Healthcare > B450v3, B650v3 and B850v3. All devices use a GPIO bitbanged MDIO > bus to communicate with the switch and a PCIe based network card > for exchanging network data. The

Re: TCP many-connection regression (bisected to 4.5.0-rc2+)

2018-01-23 Thread Ben Greear
On 01/23/2018 03:27 PM, Ben Greear wrote: On 01/23/2018 03:21 PM, Eric Dumazet wrote: On Tue, 2018-01-23 at 15:10 -0800, Ben Greear wrote: On 01/23/2018 02:29 PM, Eric Dumazet wrote: On Tue, 2018-01-23 at 14:09 -0800, Ben Greear wrote: On 01/23/2018 02:07 PM, Eric Dumazet wrote: On Tue, 2018

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

2018-01-23 Thread William Tu
On Tue, Jan 23, 2018 at 11:45 AM, Dmitry Vyukov wrote: > On Tue, Jan 23, 2018 at 8:17 PM, William Tu wrote: >> Thanks for the reply. >> >> On Tue, Jan 23, 2018 at 11:03 AM, Dmitry Vyukov wrote: >>> On Tue, Jan 23, 2018 at 7:58 PM, David Ahern wrote: On 1/23/18 11:50 AM, William Tu wrote: >

e1000e hardware unit hangs

2018-01-23 Thread Ben Greear
Hello, Anyone have any more suggestions for making e1000e work better? This is from a 4.9.65+ kernel, with these additional e1000e patches applied: e1000e: Fix error path in link detection e1000e: Fix wrong comment related to link detection e1000e: Fix return value test e1000e: Separate signal

Re: [PATCH net] bpf: always re-init the congestion control after switching to it

2018-01-23 Thread Yuchung Cheng
On Tue, Jan 23, 2018 at 3:30 PM, Lawrence Brakmo wrote: > > > > On 1/23/18, 3:26 PM, "Alexei Starovoitov" > wrote: > > On Tue, Jan 23, 2018 at 08:19:54PM +, Lawrence Brakmo wrote: > > On 1/23/18, 11:50 AM, "Eric Dumazet" wrote: > > > > On Tue, 2018-01-23 at 14:39 -0500,

Re: [PATCH net] bpf: always re-init the congestion control after switching to it

2018-01-23 Thread Lawrence Brakmo
On 1/23/18, 3:26 PM, "Alexei Starovoitov" wrote: On Tue, Jan 23, 2018 at 08:19:54PM +, Lawrence Brakmo wrote: > On 1/23/18, 11:50 AM, "Eric Dumazet" wrote: > > On Tue, 2018-01-23 at 14:39 -0500, Neal Cardwell wrote: > > On Tue, Jan 23, 2018 at 2:20 PM, Lawrence

Re: TCP many-connection regression (bisected to 4.5.0-rc2+)

2018-01-23 Thread Ben Greear
On 01/23/2018 03:21 PM, Eric Dumazet wrote: On Tue, 2018-01-23 at 15:10 -0800, Ben Greear wrote: On 01/23/2018 02:29 PM, Eric Dumazet wrote: On Tue, 2018-01-23 at 14:09 -0800, Ben Greear wrote: On 01/23/2018 02:07 PM, Eric Dumazet wrote: On Tue, 2018-01-23 at 13:49 -0800, Ben Greear wrote: O

Re: [PATCH net] bpf: always re-init the congestion control after switching to it

2018-01-23 Thread Alexei Starovoitov
On Tue, Jan 23, 2018 at 08:19:54PM +, Lawrence Brakmo wrote: > On 1/23/18, 11:50 AM, "Eric Dumazet" wrote: > > On Tue, 2018-01-23 at 14:39 -0500, Neal Cardwell wrote: > > On Tue, Jan 23, 2018 at 2:20 PM, Lawrence Brakmo wrote: > > > On 1/23/18, 9:30 AM, "Yuchung Cheng" wrote: >

Re: TCP many-connection regression (bisected to 4.5.0-rc2+)

2018-01-23 Thread Eric Dumazet
On Tue, 2018-01-23 at 15:10 -0800, Ben Greear wrote: > On 01/23/2018 02:29 PM, Eric Dumazet wrote: > > On Tue, 2018-01-23 at 14:09 -0800, Ben Greear wrote: > > > On 01/23/2018 02:07 PM, Eric Dumazet wrote: > > > > On Tue, 2018-01-23 at 13:49 -0800, Ben Greear wrote: > > > > > On 01/22/2018 10:16 AM

Re: TCP many-connection regression (bisected to 4.5.0-rc2+)

2018-01-23 Thread Ben Greear
On 01/23/2018 02:29 PM, Eric Dumazet wrote: On Tue, 2018-01-23 at 14:09 -0800, Ben Greear wrote: On 01/23/2018 02:07 PM, Eric Dumazet wrote: On Tue, 2018-01-23 at 13:49 -0800, Ben Greear wrote: On 01/22/2018 10:16 AM, Eric Dumazet wrote: On Mon, 2018-01-22 at 09:28 -0800, Ben Greear wrote: M

Re: [virtio-dev] [RFC PATCH net-next v2 1/2] virtio_net: Introduce VIRTIO_NET_F_BACKUP feature bit

2018-01-23 Thread Michael S. Tsirkin
On Mon, Jan 22, 2018 at 07:36:32PM -0800, Alexander Duyck wrote: > On Mon, Jan 22, 2018 at 6:04 PM, Michael S. Tsirkin wrote: > > On Mon, Jan 22, 2018 at 05:34:37PM -0800, Samudrala, Sridhar wrote: > >> On 1/22/2018 4:05 PM, Michael S. Tsirkin wrote: > >> > On Mon, Jan 22, 2018 at 03:27:40PM -0800

Re: [RFC PATCH net-next v2 2/2] virtio_net: Extend virtio to use VF datapath when available

2018-01-23 Thread Michael S. Tsirkin
On Tue, Jan 23, 2018 at 12:24:47PM -0800, Siwei Liu wrote: > On Mon, Jan 22, 2018 at 1:41 PM, Michael S. Tsirkin wrote: > > On Mon, Jan 22, 2018 at 12:27:14PM -0800, Siwei Liu wrote: > >> First off, as mentioned in another thread, the model of stacking up > >> virt-bond functionality over virtio s

Re: [PATCH iproute2 0/4] ip/tunnel: Minor cleanups and improvements

2018-01-23 Thread Stephen Hemminger
On Fri, 19 Jan 2018 18:43:59 +0200 Serhey Popovych wrote: > It is small series of fixes and code cleanups: > > 1) Add space after encap-[ds]port parameter value > in tunnel encapsulation options output. > > 2) Unify ttl/hoplimit parsing routines by using > get_u8(), handling "inhe

Re: [iproute PATCH] ip-route: Propagate errors from parse_one_nh()

2018-01-23 Thread Stephen Hemminger
On Tue, 23 Jan 2018 17:40:47 +0100 Phil Sutter wrote: > The following command segfaults if enp0s31f6 does not exist: > > | # ip -6 route add default proto ra metric 20100 \ > | nexthop via fe80:52:0:2040::1fc dev enp0s31f6 weight 1 \ > | nexthop via fe80:52:0:2040::1fe dev enp0s31f6 weig

[PATCH] net: make sure skb_dst is valid before using

2018-01-23 Thread Roman Kapl
Tunnel devices often use skb_dst(skb)->ops, but ops are not implemented for metadata tunnel destinations. Use skb_valid_dst to check if skb_dst is a real (non-metadata) destination. Such packets can easily be crafted using tc tunnel_key actions or BPF and will crash the tunnels, as observed at lea

Re: TCP many-connection regression (bisected to 4.5.0-rc2+)

2018-01-23 Thread Eric Dumazet
On Tue, 2018-01-23 at 14:09 -0800, Ben Greear wrote: > On 01/23/2018 02:07 PM, Eric Dumazet wrote: > > On Tue, 2018-01-23 at 13:49 -0800, Ben Greear wrote: > > > On 01/22/2018 10:16 AM, Eric Dumazet wrote: > > > > On Mon, 2018-01-22 at 09:28 -0800, Ben Greear wrote: > > > > > My test case is to hav

Re: Memory corruption with r8169 across several device revisions and kernels

2018-01-23 Thread Francois Romieu
Oliver Freyermuth : [...] > This looks like it could very well match the structure found in memory, > so something would be broken related to rtl8169_do_counters, in the DMA > transfer. > > Does this help - can I provide more info? I get the feeling this affects > many tens of thousands of syste

Re: TCP many-connection regression (bisected to 4.5.0-rc2+)

2018-01-23 Thread Ben Greear
On 01/23/2018 02:07 PM, Eric Dumazet wrote: On Tue, 2018-01-23 at 13:49 -0800, Ben Greear wrote: On 01/22/2018 10:16 AM, Eric Dumazet wrote: On Mon, 2018-01-22 at 09:28 -0800, Ben Greear wrote: My test case is to have 6 processes each create 5000 TCP IPv4 connections to each other on a system

  1   2   3   4   >