Re: [PATCH v2] netfilter: Clean up tests if NULL returned on failure

2017-03-28 Thread Jan Engelhardt
On Tuesday 2017-03-28 18:23, SIMRAN SINGHAL wrote: >On Tue, Mar 28, 2017 at 7:24 PM, Jan Engelhardt wrote: >> On Tuesday 2017-03-28 15:13, simran singhal wrote: >> >>>Some functions like kmalloc/kzalloc return NULL on failure. When NULL >>>represents failure, !x is commonly used. >>> >>>@@ -910,7

[PATCH net] l2tp: hold tunnel socket when handling control frames in l2tp_ip and l2tp_ip6

2017-03-28 Thread Guillaume Nault
The code following l2tp_tunnel_find() expects that a new reference is held on sk. Either sk_receive_skb() or the discard_put error path will drop a reference from the tunnel's socket. This issue exists in both l2tp_ip and l2tp_ip6. Fixes: a3c18422a4b4 ("l2tp: hold socket before dropping lock in l

[PATCH net] l2tp: purge socket queues in the .destruct() callback

2017-03-28 Thread Guillaume Nault
The Rx path may grab the socket right before pppol2tp_release(), but nothing guarantees that it will enqueue packets before skb_queue_purge(). Therefore, the socket can be destroyed without its queues fully purged. Fix this by purging queues in pppol2tp_session_destruct() where we're guaranteed no

[PATCH] net: netfilter: replace explicit NULL comparison with ! operator

2017-03-28 Thread Arushi Singhal
Replace explicit NULL comparison with ! operator to simplify code. Signed-off-by: Arushi Singhal --- net/netfilter/ipvs/ip_vs_ctl.c | 8 ++--- net/netfilter/ipvs/ip_vs_proto.c | 8 ++--- net/netfilter/nf_conntrack_broadcast.c | 2 +- net/netfilter/nf_conntrack_core.c | 2 +

Re: [PATCH net] l2tp: purge socket queues in the .destruct() callback

2017-03-28 Thread Guillaume Nault
On Tue, Mar 28, 2017 at 09:39:50PM -0700, David Miller wrote: > As a quick guess, I'm thinking this problem might have been introduced > by: > > > commit 9e9cb6221aa7cb04765484fe87cc2d1b92edce64 > Author: Guillaume Nault > Date: Thu Mar 6 11:15:10 2014 +0100 > > l2tp:

Re: [PATCH net] l2tp: hold tunnel socket when handling control frames in l2tp_ip and l2tp_ip6

2017-03-28 Thread Guillaume Nault
On Tue, Mar 28, 2017 at 09:34:16PM -0700, David Miller wrote: > You introduced this bug in commit: > > > commit a3c18422a4b4e108bcf6a2328f48867e1003fd95 > Author: Guillaume Nault > Date: Tue Nov 29 13:09:45 2016 +0100 > > l2tp: hold socket before dropping lock in l2tp_

[PATCH] net: bridge: netfilter: Comparison to NULL could be written

2017-03-28 Thread Arushi Singhal
Fixed coding style for null comparisons to be more consistant with the rest of the kernel coding style. Signed-off-by: Arushi Singhal --- net/bridge/netfilter/ebt_among.c | 12 ++-- net/bridge/netfilter/ebt_arp.c | 10 +- net/bridge/netfilter/ebt_arpreply.c

Re: [PATCH] Revert "net: stmmac: enable multiple buffers"

2017-03-28 Thread Corentin Labbe
On Tue, Mar 28, 2017 at 10:11:23PM -0700, David Miller wrote: > > Did you even test all 3 of Thierry's patches? > > I want you to do that before we revert. > Yes I tested all 3, dwmac-sunxi is still broken with them

Re: [RFC PATCH tip/master 2/3] kprobes: Allocate kretprobe instance if its free list is empty

2017-03-28 Thread Ingo Molnar
* Masami Hiramatsu wrote: > @@ -1824,6 +1823,30 @@ void unregister_jprobes(struct jprobe **jps, int num) > EXPORT_SYMBOL_GPL(unregister_jprobes); > > #ifdef CONFIG_KRETPROBES > + > +/* Try to use free instance first, if failed, try to allocate new instance */ > +struct kretprobe_instance *kr

[PATCH v2] net: veth: use new api ethtool_{get|set}_link_ksettings

2017-03-28 Thread Philippe Reynes
The ethtool api {get|set}_settings is deprecated. We move this driver to new api {get|set}_link_ksettings. Signed-off-by: Philippe Reynes --- Changelog: v2: - avoid useless initiazation to zero (thanks Xin Long) drivers/net/veth.c | 19 +++ 1 files changed, 7 insertions(+), 12

[PATCH] bluetooth: 6lowpan: fix use after free in chan_suspend/resume

2017-03-28 Thread Michael Scott
A status field in the skb_cb struct was storing a channel status based on channel suspend/resume events. This stored status was then used to return EAGAIN if there were packet sending issues in snd_pkt(). The issue is that the skb has been freed by the time the callback to 6lowpan's suspend/resum

[PATCH] bluetooth: 6lowpan: fix delay work init in add_peer_chan()

2017-03-28 Thread Michael Scott
When adding 6lowpan devices very rapidly we sometimes see a crash: [23122.306615] CPU: 2 PID: 0 Comm: swapper/2 Not tainted 4.9.0-43-arm64 #1 Debian 4.9.9.linaro.43-1 [23122.315400] Hardware name: HiKey Development Board (DT) [23122.320623] task: 800075443080 task.stack: 800075484000 [2312

[PATCH] net: ipv6: netfilter: replace explicit NULL comparison with ! operator

2017-03-28 Thread Arushi Singhal
Replace explicit NULL comparison with ! operator to simplify code. Signed-off-by: Arushi Singhal --- net/ipv6/netfilter/ip6_tables.c| 4 ++-- net/ipv6/netfilter/ip6t_SYNPROXY.c | 16 net/ipv6/netfilter/ip6t_ah.c | 2 +- net/ipv6/ne

Re: [PATCH net-next 0/2] break include loop and dsa devlink support

2017-03-28 Thread David Miller
From: Andrew Lunn Date: Tue, 28 Mar 2017 23:45:05 +0200 > These two patches add very basic support for devlink to DSA, in > preparation for playing with dpipe. > > The first patch is needed to break an include loop between > netdevice.h, dsa.h and devlink.h. We need to remove dsa.h from > netdev

[PATCH] net: netfilter: Use list_{next/prev}_entry instead of list_entry

2017-03-28 Thread simran singhal
This patch replace list_entry with list_prev_entry as it makes the code more clear to read. Signed-off-by: simran singhal --- net/netfilter/nf_tables_api.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/netfilter/nf_tables_api.c b/net/netfilter/nf_tables_api.c index b764

[PATCH] tcp: possible race between tcp_done() and tcp_poll()

2017-03-28 Thread Seiichi Ikarashi
Similar to commit a4d258036ed9b2a1811. Between receiving a packet and tcp_poll(), sk->sk_err is protected by memory barriers but sk->sk_shutdown and sk->sk_state are not. So possibly, POLLIN|POLLRDNORM|POLLRDHUP might not be set even when receiving a RST packet. Signed-off-by: Seiichi Ikarashi

Re: [PATCH net-next 0/7] netconf: Add support for RTM_DELNETCONF

2017-03-28 Thread David Miller
From: David Ahern Date: Tue, 28 Mar 2017 14:28:00 -0700 > netconf notifications are sent as devices register but not when they > are deleted leaving userspace caches out of sync. Add support for > RTM_DELNETCONF to ipv4, ipv6 and mpls. > > MPLS is missing RTM_NEWNETCONF as devices are created, s

[RFC PATCH tip/master 3/3] kprobes: Limit kretprobe maximum instances

2017-03-28 Thread Masami Hiramatsu
Limit kretprobe maximum instance up to MAXACTIVE_ALLOC. Without this limit, kretprobe user can specify huge number (e.g. forget to zero-fill struct kretprobe) to maxactive and may cause out-of-memory. Signed-off-by: Masami Hiramatsu --- kernel/kprobes.c |3 +++ 1 file changed, 3 insertions(+

[RFC PATCH tip/master 2/3] kprobes: Allocate kretprobe instance if its free list is empty

2017-03-28 Thread Masami Hiramatsu
Try to allocate kretprobe instance by GFP_ATOMIC if kretprobe's free list is empty. This can prevent kretprobe miss-hit on the function which can be heavily invoked and slept inside (like locking syscall entries.) NOTE: This may easily cause nested kprobe call which will be just skipped (but nmiss

[RFC PATCH tip/master 1/3] trace: kprobes: Show sum of probe/retprobe nmissed count

2017-03-28 Thread Masami Hiramatsu
Show sum of probe and retprobe nmissed count in kprobe_profile, since retprobe can be missed even if the kprobe itself succeeeded. This explains user why their return probe didn't hit sometimes. Signed-off-by: Masami Hiramatsu --- kernel/trace/trace_kprobe.c |2 +- 1 file changed, 1 insertio

Re: [PATCH net-next] liquidio: refactor interrupt moderation code

2017-03-28 Thread David Miller
From: Felix Manlunas Date: Tue, 28 Mar 2017 12:14:06 -0700 > From: Prasad Kanneganti > > Refactor interrupt moderation code for flexibility because parameters are > different for 10G and 25G cards. Currently parameters (for 10G only) come > from macros compiled-in to the PF and VF drivers; fix

[RFC PATCH tip/master 0/3] kprobes: tracing: kretprobe_instance dynamic allocation

2017-03-28 Thread Masami Hiramatsu
Here is a correction of patches to introduce kretprobe_instance dynamic allocation for avoiding kretprobe silently miss-hits. Original issue was reported by Lukasz on linux-trace ml. https://www.spinics.net/lists/linux-trace/msg00448.html Also Alban is working on kprobe-tracer side because of io

Re: [PATCH net-next] liquidio: add automatic packet steering support

2017-03-28 Thread David Miller
From: Felix Manlunas Date: Tue, 28 Mar 2017 12:40:02 -0700 > Packet steering can be enabled or disabled via ethtool like this: > > ethtool --set-priv-flags ethX pkt_steering on|off Do not create private ethtool flags for something which is so fundamental. We have the ethtool rxfh controls

Re: [PATCH net] ftgmac100: Mostly rewrite the driver

2017-03-28 Thread Benjamin Herrenschmidt
On Tue, 2017-03-28 at 22:10 -0700, David Miller wrote: >  Do you prefer that I submit it as a new driver for that IP block > > instead and take out the old one later ? > > You've decided to do this work in a way that makes it nearly > impossible to audit the individual changes for regressions and

Re: [PATCH] Revert "net: stmmac: enable multiple buffers"

2017-03-28 Thread David Miller
Did you even test all 3 of Thierry's patches? I want you to do that before we revert.

Re: [PATCH net] ftgmac100: Mostly rewrite the driver

2017-03-28 Thread David Miller
From: Benjamin Herrenschmidt Date: Wed, 29 Mar 2017 16:03:07 +1100 > On Tue, 2017-03-28 at 21:57 -0700, David Miller wrote: >> This is unreviewable. >> >> You must break this up into small, reviewable pieces. >> >> If you didn't save the steps of your work in that way, that isn't >> our problem

[PATCH] Revert "net: stmmac: enable multiple buffers"

2017-03-28 Thread Corentin Labbe
The commit aff3d9eff843 ("net: stmmac: enable multiple buffers") breaks numerous boards. while some patch exists for fixing some of it, dwmac-sunxi is still broken with it. Since this patch is very huge, it will be better to split it in smaller part. Signed-off-by: Corentin Labbe --- drivers/net

Re: [PATCH net-next] net: dsa: fix copyright holder

2017-03-28 Thread David Miller
From: Vivien Didelot Date: Tue, 28 Mar 2017 15:10:36 -0400 > I do not hold the copyright of the DSA core and drivers source files, > since these changes have been written as an initiative of my day job. > Fix this. > > Signed-off-by: Vivien Didelot Applied.

Re: [PATCH net-next] net: dsa: mv88e6xxx: unconditionally set ATU trunk

2017-03-28 Thread David Miller
From: Vivien Didelot Date: Tue, 28 Mar 2017 15:09:43 -0400 > Set the trunk member of the mv88e6xxx_atu_entry structure regardless its > value, so that uninitialized structures gets the correct boolean value. > > Note that no mainline code is affected by the current behavior. > > Signed-off-by:

Re: [PATCH net-next] ipv6: add support for NETDEV_RESEND_IGMP event

2017-03-28 Thread David Miller
From: Vladislav Yasevich Date: Tue, 28 Mar 2017 14:49:16 -0400 > This patch adds support for NETDEV_RESEND_IGMP event similar > to how it works for IPv4. > > Signed-off-by: Vladislav Yasevich Applied, but: > +void igmp6_late_cleanup(void) > +{ > + unregister_netdevice_notifier(&igmp6_netd

Re: [PATCH net] ftgmac100: Mostly rewrite the driver

2017-03-28 Thread Benjamin Herrenschmidt
On Tue, 2017-03-28 at 21:57 -0700, David Miller wrote: > This is unreviewable. > > You must break this up into small, reviewable pieces. > > If you didn't save the steps of your work in that way, that isn't > our problem. That's not realistic, it would probably not improve the readability much.

Re: [PATCH net] ftgmac100: Mostly rewrite the driver

2017-03-28 Thread David Miller
This is unreviewable. You must break this up into small, reviewable pieces. If you didn't save the steps of your work in that way, that isn't our problem.

Re: [PATCH net] openvswitch: Fix refcount leak on force commit.

2017-03-28 Thread David Miller
From: Jarno Rajahalme Date: Tue, 28 Mar 2017 11:25:26 -0700 > The reference count held for skb needs to be released when the skb's > nfct pointer is cleared regardless of if nf_ct_delete() is called or > not. > > Failing to release the skb's reference cound led to deferred conntrack > cleanup sp

Re: [PATCH net-next] net: dsa: mv88e6xxx: debug ATU Age Time

2017-03-28 Thread David Miller
From: Vivien Didelot Date: Tue, 28 Mar 2017 14:13:53 -0400 > Hi David, > > Vivien Didelot writes: > >> The ATU ageing time value programmed in the switch is rounded up to the >> nearest multiple of its coefficient (variable depending on the model.) >> >> Add a debug message to inform the user

Re: [PATCH net-next 0/4] net: dsa: fix chip definitions

2017-03-28 Thread David Miller
From: Vivien Didelot Date: Tue, 28 Mar 2017 13:50:31 -0400 > The definitions of some of the mv88e6xxx_ops and mv88e6xxx_info > structures are misordered and erroneous for 88E6191 and 88E6391. > > This patch series cleans that up. Series applied.

Re: [PATCH] VSOCK: remove unnecessary ternary operator on return value

2017-03-28 Thread David Miller
From: Colin King Date: Tue, 28 Mar 2017 16:54:24 +0100 > From: Colin Ian King > > Rather than assign the positive errno values to ret and then > checking if it is positive and flip the sign, just set ret to > be the -ve errno value. > > Detected by CoverityScan, CID#986649 ("Logically Dead Cod

Re: [PATCH] rocker: fix Wmaybe-uninitialized false-positive

2017-03-28 Thread David Miller
From: Arnd Bergmann Date: Tue, 28 Mar 2017 16:11:18 +0200 > gcc-7 reports a warning that earlier versions did not have: > > drivers/net/ethernet/rocker/rocker_ofdpa.c: In function > 'ofdpa_port_stp_update': > arch/x86/include/asm/string_32.h:79:22: error: '*((void *)&prev_ctrls+4)' may > be us

[PATCH net] ftgmac100: Mostly rewrite the driver

2017-03-28 Thread Benjamin Herrenschmidt
This is an almost complete rewrite of this driver. The patch overall multiplies the performance of the driver on an AST2500 eval board with a gigabit link by 3 to 4. I get arounnd 400Mbit/s with this vs. about 80Mbit/s with the current driver using iperf3. I've done some tests on NC-SI machines a

Re: [PATCH net] l2tp: purge socket queues in the .destruct() callback

2017-03-28 Thread David Miller
From: Guillaume Nault Date: Tue, 28 Mar 2017 15:32:41 +0200 > The Rx path may grab the socket right before pppol2tp_release(), but > nothing guarantees that it will enqueue packets before > skb_queue_purge(). Therefore, the socket can be destroyed without its > queues fully purged. > > Fix this

Re: [PATCH net] l2tp: hold tunnel socket when handling control frames in l2tp_ip and l2tp_ip6

2017-03-28 Thread David Miller
From: Guillaume Nault Date: Tue, 28 Mar 2017 15:32:35 +0200 > The code following l2tp_tunnel_find() expects that a new reference is > held on sk. Either sk_receive_skb() or the discard_put error path will > drop a reference from the tunnel's socket. > > This issue exists in both l2tp_ip and l2tp

Re: [net-next 09/14] net/mlx5e: Minimize mlx5e_{open/close}_locked

2017-03-28 Thread Jakub Kicinski
On Mon, 27 Mar 2017 23:49:05 +0300, Saeed Mahameed wrote: > mlx5e_redirect_rqts_to_{channels,drop} and mlx5e_{add,del}_sqs_fwd_rules > and Set real num tx/rx queues belong to > mlx5e_{activate,deactivate}_priv_channels, for that we move those functions > and minimize mlx5e_open/close flows. > > Th

Re: [PATCH net-next 2/2] net: dsa: dsa2: Add basic support of devlink

2017-03-28 Thread Andrew Lunn
On Tue, Mar 28, 2017 at 05:33:18PM -0700, Florian Fainelli wrote: > On 03/28/2017 02:45 PM, Andrew Lunn wrote: > > Register the switch and its ports with devlink. > > > > Signed-off-by: Andrew Lunn > > Reviewed-by: Florian Fainelli > Tested-by: Florian Fainelli > > root@net-vm:~# devlink -p p

Re: [E1000-devel] jitter / latency reduction

2017-03-28 Thread Jesse Brandeburg
On Mon, 6 Mar 2017 08:09:42 -0800 Mahmood Qazen wrote: > greetings Leonardo > this is the slide / pdf I found and towards the end it asks if we > could help. > enjoy > Mahmood - Hi developers, thanks for your interest, we’d love to have help, but the good/bad news is that this is implemented alr

Re: [PATCH net 1/1] net/mlx5: Avoid dereferencing uninitialized pointer

2017-03-28 Thread David Miller
From: Saeed Mahameed Date: Tue, 28 Mar 2017 16:13:41 +0300 > From: Talat Batheesh > > In NETDEV_CHANGEUPPER event the upper_info field is valid > only when linking is true. Otherwise it should be ignored. > > Fixes: 7907f23adc18 (net/mlx5: Implement RoCE LAG feature) > Signed-off-by: Talat Bat

Re: [PATCH net-next 0/7] qed: load/unload mfw series

2017-03-28 Thread David Miller
From: Yuval Mintz Date: Tue, 28 Mar 2017 15:12:49 +0300 > This series correct the unload flow and greatly enhances its > initialization flow in regard to interactions between driver > and management firmware. > > Patch #1 makes sure unloading is done under management-firmware's > 'criticial sect

Re: [PATCH net-next v1 0/2] tipc: subscription refcount simplifications

2017-03-28 Thread David Miller
From: Parthasarathy Bhuvaragan Date: Tue, 28 Mar 2017 12:28:26 +0200 > The first patch makes the subscription refcount cleanup lockless and > the second updates the subscription refcount policy. Series applied, thanks.

Re: [PATCH v3] net: moxa: fix TX overrun memory leak

2017-03-28 Thread David Miller
From: Jonas Jensen Date: Tue, 28 Mar 2017 12:12:38 +0200 > moxart_mac_start_xmit() doesn't care where tx_tail is, tx_head can > catch and pass tx_tail, which is bad because moxart_tx_finished() > isn't guaranteed to catch up on freeing resources from tx_tail. > > Add a check in moxart_mac_start_

Re: [PATCH] [net-next] stmmac: use netif_set_real_num_{rx,tx}_queues

2017-03-28 Thread David Miller
From: Arnd Bergmann Date: Tue, 28 Mar 2017 11:48:21 +0200 > A driver must not access the two fields directly but should instead use > the helper functions to set the values and keep a consistent internal > state: > > ethernet/stmicro/stmmac/stmmac_main.c: In function 'stmmac_dvr_probe': > ethern

Re: [PATCH, net] isdn: kcapi: avoid uninitialized data

2017-03-28 Thread David Miller
From: Arnd Bergmann Date: Tue, 28 Mar 2017 12:11:07 +0200 > gcc-7 points out that the AVMB1_ADDCARD ioctl results in an unintialized > value ending up in the cardnr parameter: > > drivers/isdn/capi/kcapi.c: In function 'old_capi_manufacturer': > drivers/isdn/capi/kcapi.c:1042:24: error: 'cdef.ca

Re: [PATCH 1/3] soc: qcom: smd: Transition client drivers from smd to rpmsg

2017-03-28 Thread David Miller
From: Bjorn Andersson Date: Mon, 27 Mar 2017 22:49:22 -0700 > On Mon 27 Mar 16:04 PDT 2017, David Miller wrote: > >> From: Bjorn Andersson >> Date: Mon, 27 Mar 2017 15:58:37 -0700 >> >> > I'm sorry, but I can't figure out how to reproduce this. >> >> All of my builds are "make allmodconfig" s

Re: [PATCH net-next] vxlan: don't age NTF_EXT_LEARNED fdb entries

2017-03-28 Thread David Miller
From: Roopa Prabhu Date: Mon, 27 Mar 2017 15:46:41 -0700 > From: Roopa Prabhu > > vxlan driver already implicitly supports installing > of external fdb entries with NTF_EXT_LEARNED. This > patch just makes sure these entries are not aged > by the vxlan driver. An external entity managing these

Re: [PATCHv2 net] sctp: change to save MSG_MORE flag into assoc

2017-03-28 Thread David Miller
From: Xin Long Date: Mon, 27 Mar 2017 00:21:15 +0800 > David Laight noticed the support for MSG_MORE with datamsg->force_delay > didn't really work as we expected, as the first msg with MSG_MORE set > would always block the following chunks' dequeuing. > > This Patch is to rewrite it by saving t

Re: EINVAL when using connect() for udp sockets

2017-03-28 Thread Eric Dumazet
On Tue, 2017-03-28 at 16:11 -0700, Eric Dumazet wrote: > Yes, this looks better. > > Although you probably need to change a bit later this part : > > if (!inet->inet_saddr) > inet->inet_saddr = fl4->saddr; /* Update source address */ > I came up with the following tested patch for IPv4

Re: [PATCH net-next 2/2] net: dsa: dsa2: Add basic support of devlink

2017-03-28 Thread Florian Fainelli
On 03/28/2017 02:45 PM, Andrew Lunn wrote: > Register the switch and its ports with devlink. > > Signed-off-by: Andrew Lunn Reviewed-by: Florian Fainelli Tested-by: Florian Fainelli root@net-vm:~# devlink -p port mdio_bus/fixed-0:1f/0: type eth netdev lan1 mdio_bus/fixed-0:1f/1: type eth netd

Re: [patch net-next v2 0/8] Add support for pipeline debug (dpipe)

2017-03-28 Thread David Miller
From: Jiri Pirko Date: Tue, 28 Mar 2017 17:24:09 +0200 > From: Jiri Pirko > > Arkadi says: > > While doing the hardware offloading process much of the hardware > specifics cannot be presented. An example for such is the routing > LPM algorithm which differ in hardware implementation from the >

Re: arch: arm: bpf: Converting cBPF to eBPF for arm 32 bit

2017-03-28 Thread Daniel Borkmann
Hi Shubham, On 03/28/2017 10:49 PM, Shubham Bansal wrote: [...] Do you have any document to understand the working of tail calls? I looked at your presentations but it seemed confusing to me. Anything simple would be great, just about the tail calls. I don't think I need examples, I can get them

[PATCH net-next v6 03/11] bpf: Define handle_fs and add a new helper bpf_handle_fs_get_mode()

2017-03-28 Thread Mickaël Salaün
Add an eBPF function bpf_handle_fs_get_mode(handle_fs) to get the mode of a an abstract object wrapping either a file, a dentry, a path, or an inode. Changes since v5: * cosmetic fixes and rebase Changes since v4: * use a file abstraction (handle) to wrap inode, dentry, path and file structs *

[PATCH net-next v6 00/11] Landlock LSM: Toward unprivileged sandboxing

2017-03-28 Thread Mickaël Salaün
Hi, This sixth series add some changes to the previous one [1], including a simpler rule inheritance hierarchy (similar to seccomp-bpf), a ptrace scope protection, some file renaming (better feature identification per file), a future-proof eBPF subtype and miscellaneous cosmetic fixes. This is th

[PATCH net 3/3] bnxt_en: Fix DMA unmapping of the RX buffers in XDP mode during shutdown.

2017-03-28 Thread Michael Chan
In bnxt_free_rx_skbs(), which is called to free up all RX buffers during shutdown, we need to unmap the page if we are running in XDP mode. Fixes: c61fb99cae51 ("bnxt_en: Add RX page mode support.") Signed-off-by: Michael Chan --- drivers/net/ethernet/broadcom/bnxt/bnxt.c | 15 ++- 1

[PATCH net-next v6 01/11] bpf: Add eBPF program subtype and is_valid_subtype() verifier

2017-03-28 Thread Mickaël Salaün
The goal of the program subtype is to be able to have different static fine-grained verifications for a unique program type. The struct bpf_verifier_ops gets a new optional function: is_valid_subtype(). This new verifier is called at the beginning of the eBPF program verification to check if the (

Re: [PATCH v1] tracing/kprobes: expose maxactive for kretprobe in kprobe_events

2017-03-28 Thread Masami Hiramatsu
On Tue, 28 Mar 2017 11:34:07 -0400 Steven Rostedt wrote: > On Wed, 29 Mar 2017 00:23:35 +0900 > Masami Hiramatsu wrote: > > > > @@ -598,8 +601,10 @@ static int create_trace_kprobe(int argc, char **argv) > > > { > > > /* > > >* Argument syntax: > > > - * - Add kprobe: p[:[GRP/]EVENT] [M

[PATCH net-next v6 06/11] seccomp,landlock: Handle Landlock events per process hierarchy

2017-03-28 Thread Mickaël Salaün
The seccomp(2) syscall can be used by a task to apply a Landlock rule to itself. As a seccomp filter, a Landlock rule is enforced for the current task and all its future children. A rule is immutable and a task can only add new restricting rules to itself, forming a chain of rules. A Landlock rule

Re: [PATCH v1] tracing/kprobes: expose maxactive for kretprobe in kprobe_events

2017-03-28 Thread Masami Hiramatsu
On Tue, 28 Mar 2017 18:08:16 +0200 Alban Crequy wrote: > Thanks for the review, > > On Tue, Mar 28, 2017 at 5:23 PM, Masami Hiramatsu wrote: > > On Tue, 28 Mar 2017 15:52:22 +0200 > > Alban Crequy wrote: > > > >> When a kretprobe is installed on a kernel function, there is a maximum > >> limit

[PATCH net-next v6 11/11] landlock: Add user and kernel documentation for Landlock

2017-03-28 Thread Mickaël Salaün
This documentation can be built with the Sphinx framework. Changes since v5: * update the rule hierarchy inheritance explanation * briefly explain ctx->arg2 * add ptrace restrictions * explain EPERM * update example (subtype) * use ":manpage:" Signed-off-by: Mickaël Salaün Cc: Alexei Starovoitov

[PATCH net-next v6 02/11] bpf,landlock: Define an eBPF program type for Landlock

2017-03-28 Thread Mickaël Salaün
Add a new type of eBPF program used by Landlock rules. This new BPF program type will be registered with the Landlock LSM initialization. Add an initial Landlock Kconfig. Changes since v5: * rename file hooks.c to init.c * fix spelling Changes since v4: * merge a minimal (not enabled) LSM code

[PATCH net-next v6 10/11] bpf,landlock: Add tests for Landlock

2017-03-28 Thread Mickaël Salaün
Test basic context access, ptrace protection and filesystem event with multiple cases. Changes since v5: * add subtype test * add ptrace tests * split and rename files * cleanup and rebase Signed-off-by: Mickaël Salaün Cc: Alexei Starovoitov Cc: Andy Lutomirski Cc: Daniel Borkmann Cc: David S

[PATCH net-next v6 09/11] seccomp: Enhance test_harness with an assert step mechanism

2017-03-28 Thread Mickaël Salaün
This is useful to return an information about the error without being able to write to TH_LOG_STREAM. Helpers from test_harness.h may be useful outside of the seccomp directory. Signed-off-by: Mickaël Salaün Cc: Andy Lutomirski Cc: Arnaldo Carvalho de Melo Cc: Kees Cook Cc: Shuah Khan Cc: Wi

[PATCH net-next v6 08/11] bpf: Add a Landlock sandbox example

2017-03-28 Thread Mickaël Salaün
Add a basic sandbox tool to create a process isolated from some part of the system. This sandbox create a read-only environment. It is only allowed to write to a character device such as a TTY: # :> X # echo $? 0 # ./samples/bpf/landlock1 /bin/sh -i Launching a new sandboxed process. #

[PATCH net-next v6 05/11] seccomp: Split put_seccomp_filter() with put_seccomp()

2017-03-28 Thread Mickaël Salaün
The semantic is unchanged. This will be useful for the Landlock integration with seccomp (next commit). Signed-off-by: Mickaël Salaün Cc: Kees Cook Cc: Andy Lutomirski Cc: Will Drewry --- include/linux/seccomp.h | 4 ++-- kernel/fork.c | 2 +- kernel/seccomp.c| 18

Re: EINVAL when using connect() for udp sockets

2017-03-28 Thread Daurnimator
On 29 March 2017 at 10:11, Eric Dumazet wrote: > Should we also fix IPv6 or is this bug only about IPv4 ? In IPv6 the second connect() returns ENETUNREACH (rather than failing yet returning 0 as it does in IPv4). This should probably incorrect behaviour and should the operation should succeed.

[PATCH net 2/3] bnxt_en: Correct the order of arguments to netdev_err() in bnxt_set_tpa()

2017-03-28 Thread Michael Chan
From: Sankar Patchineelam Signed-off-by: Sankar Patchineelam Signed-off-by: Michael Chan --- drivers/net/ethernet/broadcom/bnxt/bnxt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c inde

[PATCH net-next v6 07/11] landlock: Add ptrace restrictions

2017-03-28 Thread Mickaël Salaün
A landlocked process has less privileges than a non-landlocked process and must then be subject to additional restrictions when manipulating processes. To be allowed to use ptrace(2) and related syscalls on a target process, a landlocked process must have a subset of the target process' rules. New

[PATCH net-next v6 04/11] landlock: Add LSM hooks related to filesystem

2017-03-28 Thread Mickaël Salaün
Handle 33 filesystem-related LSM hooks for the Landlock filesystem event: LANDLOCK_SUBTYPE_EVENT_FS. A Landlock event wrap LSM hooks for similar kernel object types (e.g. struct file, struct path...). Multiple LSM hooks can trigger the same Landlock event. Landlock handle nine coarse-grained acti

[PATCH net 1/3] bnxt_en: Fix NULL pointer dereference in reopen failure path

2017-03-28 Thread Michael Chan
From: Sankar Patchineelam Net device reset can fail when the h/w or f/w is in a bad state. Subsequent netdevice open fails in bnxt_hwrm_stat_ctx_alloc(). The cleanup invokes bnxt_hwrm_resource_free() which inturn calls bnxt_disable_int(). In this routine, the code segment if (ring->fw_ring_id !

[PATCH net 0/3] bnxt_en: Small misc. fixes.

2017-03-28 Thread Michael Chan
Fix a NULL pointer crash in open failure path, wrong arguments when printing error messages, and a DMA unmap bug in XDP shutdown path. Michael Chan (1): bnxt_en: Fix DMA unmapping of the RX buffers in XDP mode during shutdown. Sankar Patchineelam (2): bnxt_en: Fix NULL pointer dereference

Re: EINVAL when using connect() for udp sockets

2017-03-28 Thread Daurnimator
On 29 March 2017 at 10:44, Daurnimator wrote: > This should probably incorrect behaviour and should the operation > should succeed. Uh, not sure why there are so many "should"s in that message. This is probably incorrect behaviour and the operation should succeed.

[net-next 10/12] net/mlx5e: Add parsing of TC pedit actions to HW format

2017-03-28 Thread Saeed Mahameed
From: Or Gerlitz Parse/translate a set of TC pedit actions to be formed in the HW API format. User-space provides set of keys where each one of them is made of: command (add or set), header-type, byte offset within that header along with a 32 bit mask and value. The mask dictates what bits in

[net-next 01/12] net/mlx5e: Add prefix for e-switch offloaded TC flow attributes

2017-03-28 Thread Saeed Mahameed
From: Or Gerlitz Add esw_ prefix to the flow attributes attached to offloaded e-switch TC flows. This is a pre-step to add attributes to offloaded NIC TC flows. Also, save one pointer space by using gcc's zero size array, this would be beneficial for environments where 100Ks (or Ms) of flows are

[net-next 11/12] net/mlx5e: Add offloading of NIC TC pedit (header re-write) actions

2017-03-28 Thread Saeed Mahameed
From: Or Gerlitz This includes calling the parsing code that translates from pedit speak to the HW API, allocation (deallocation) of a modify header context and setting the modify header id associated with this context to the FTE of that flow. Signed-off-by: Or Gerlitz Reviewed-by: Hadar Hen Zi

[net-next 02/12] net/mlx5e: Add NIC attributes for offloaded TC flows

2017-03-28 Thread Saeed Mahameed
From: Or Gerlitz Add structure that contains the attributes related to offloaded NIC flows. Currently it has the actions and flow tag. While here, do xmas tree cleanup of the TC configure function. This patch doesn't change any functionality. Signed-off-by: Or Gerlitz Reviewed-by: Hadar Hen Z

[net-next 06/12] net/mlx5: Reorder few command cases to reflect their natural order

2017-03-28 Thread Saeed Mahameed
From: Or Gerlitz Move the commands related to scheduling elements and vport qos to a suitable location (according to the MLX5_CMD_OP enum values) in the command string and internal error helpers. This patch doesn't change any functionality. Signed-off-by: Or Gerlitz Reviewed-by: Hadar Hen Zion

[net-next 09/12] net/sched: Add accessor functions to pedit keys for offloading drivers

2017-03-28 Thread Saeed Mahameed
From: Or Gerlitz HW drivers will use the header-type and command fields from the extended keys, and some fields (e.g mask, val, offset) from the legacy keys. Signed-off-by: Or Gerlitz Reviewed-by: Hadar Hen Zion Signed-off-by: Saeed Mahameed --- include/net/tc_act/tc_pedit.h | 45 +++

[net-next 05/12] net/mlx5: Add helper to initialize a flow steering actions struct instance

2017-03-28 Thread Saeed Mahameed
From: Or Gerlitz There are bunch of places in the code where the intermediate struct that keeps the elements related to flow actions is initialized with the same default values. Put that into a small DECLARE type helper. This patch doesn't change any functionality. Signed-off-by: Or Gerlitz Re

[net-next 12/12] net/mlx5e: Add offloading of E-Switch TC pedit (header re-write) actions

2017-03-28 Thread Saeed Mahameed
From: Or Gerlitz This includes calling the parsing code that translates from pedit speak to the HW API, allocation (deallocation) of a modify header context and setting the modify header id associated with this context to the FTE of that flow. Signed-off-by: Or Gerlitz Reviewed-by: Hadar Hen Zi

[net-next 07/12] net/mlx5: Introduce modify header structures, commands and steering action definitions

2017-03-28 Thread Saeed Mahameed
From: Or Gerlitz Add the definitions related to creation/deletion of a modify header context and the modify header steering action which are used for HW packet header modify (re-write) as part of steering. Add as well the modify header id into two intermediate structs and set it to the FTE. Note

[net-next 04/12] net/mlx5e: Properly deal with resource cleanup when adding TC flow fails

2017-03-28 Thread Saeed Mahameed
From: Or Gerlitz The code for adding tc fdb flows leaves things half set when it fails in the middle. Currently we are not leaking things (e.g eswitch vlan reference, encap reference and HW resources) since the main code to add flower rules does a cleanup by calling mlx5e_tc_del_flow(). This cle

[net-next 08/12] net/mlx5: Introduce alloc/dealloc modify header context commands

2017-03-28 Thread Saeed Mahameed
From: Or Gerlitz Implement the low-level commands to support packet header re-write. Signed-off-by: Or Gerlitz Reviewed-by: Hadar Hen Zion Signed-off-by: Saeed Mahameed --- drivers/net/ethernet/mellanox/mlx5/core/cmd.c | 4 ++ drivers/net/ethernet/mellanox/mlx5/core/fs_cmd.c | 66 +++

[pull request][net-next 00/12] Mellanox mlx5 offloading of TC pedit (header re-write) action

2017-03-28 Thread Saeed Mahameed
Hi Dave, The following changes from Or Gerlitz provide mlx5 offloading support of TC pedit (header re-write) action. For more information please see below. Please pull and let me know if there's any problem. Thanks, Saeed. --- The following changes since commit cc628c9680c212d9dbf68785fbf5d45

[net-next 03/12] net/mlx5e: Add intermediate struct for TC flow parsing attributes

2017-03-28 Thread Saeed Mahameed
From: Or Gerlitz Add intermediate structure to store attributes parsed from TC filter matching/actions parts which are soon to be configured into the HW. Currently put there the flow matching spec after being parsed. More content to be added in down-stream patch. This patch doesn't change any f

Re: [PATCH net-next] net: mpls: Update lfib_nlmsg_size to skip deleted nexthops

2017-03-28 Thread Roopa Prabhu
On 3/28/17, 3:19 PM, David Ahern wrote: > A recent commit skips nexthops in a route if the device has been > deleted. Update lfib_nlmsg_size accordingly. > > Reported-by: Roopa Prabhu > Signed-off-by: David Ahern > --- > Acked-by: Roopa Prabhu

Re: EINVAL when using connect() for udp sockets

2017-03-28 Thread Eric Dumazet
On Mon, 2017-03-27 at 21:22 -0700, Cong Wang wrote: > On Fri, Mar 24, 2017 at 4:19 PM, Eric Dumazet wrote: > > On Fri, 2017-03-24 at 15:34 -0700, Cong Wang wrote: > >> (Cc'ing Michael Kerrisk) > >> > >> On Wed, Mar 22, 2017 at 10:18 PM, Eric Dumazet > >> wrote: > >> > On Thu, 2017-03-23 at 13:22

ANNOUNCE: netdev 2.1 conference Schedule out!

2017-03-28 Thread Jamal Hadi Salim
The tech committee would like to announce the schedule. There is a lot of great great content which we hope you are going to enjoy. There were also many other fantastic submissions which we were unfortunately unable to accommodate. We appreciate everyone that took the time to make a submission.

[PATCH net-next] net: mpls: Update lfib_nlmsg_size to skip deleted nexthops

2017-03-28 Thread David Ahern
A recent commit skips nexthops in a route if the device has been deleted. Update lfib_nlmsg_size accordingly. Reported-by: Roopa Prabhu Signed-off-by: David Ahern --- net/mpls/af_mpls.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/net/mpls/af_mpls.c b/net/mpls/af_mpls.c index 74755920c

Re: [PATCH net-next] net: dsa: Mock-up driver

2017-03-28 Thread Florian Fainelli
On 03/28/2017 02:56 PM, Florian Fainelli wrote: > This patch adds support for a DSA mock-up driver which essentially does > the following: > > - registers/unregisters 4 fixed PHYs to the slave network devices > - uses eth0 (configurable) as the master netdev > - registers the switch as a fixed MDI

Re: Null pointer dereference in tg3_poll_work running linux-3.4

2017-03-28 Thread Salam Noureddine
On Tue, Mar 28, 2017 at 11:53 AM, Michael Chan wrote: > I don't remember any bug fixes related to this logic. One possibility > is that there is DMA corruption and we are getting a bad opaque value. > If you have the core dump, it will be useful to look at the receive > completion ring. These

Re: [PATCH net-next 1/2] net: break include loop netdevice.h, dsa.h, devlink.h

2017-03-28 Thread Florian Fainelli
On 03/28/2017 02:45 PM, Andrew Lunn wrote: > There is an include loop between netdevice.h, dsa.h, devlink.h because > of NETDEV_ALIGN, making it impossible to use devlink structures in > dsa.h. > > Break this loop by taking dsa.h out of netdevice.h, add a forward > declaration of dsa_switch_tree a

[PATCH net-next] net: dsa: Mock-up driver

2017-03-28 Thread Florian Fainelli
This patch adds support for a DSA mock-up driver which essentially does the following: - registers/unregisters 4 fixed PHYs to the slave network devices - uses eth0 (configurable) as the master netdev - registers the switch as a fixed MDIO device against the fixed MDIO bus at address 31 - includ

[PATCH] net: netfilter: Use seq_puts()/seq_putc() where possible

2017-03-28 Thread simran singhal
For string without format specifiers, use seq_puts(). For seq_printf("\n"), use seq_putc('\n'). Signed-off-by: simran singhal --- net/netfilter/ipvs/ip_vs_ctl.c | 8 net/netfilter/nf_conntrack_expect.c | 4 ++-- net/netfilter/nf_conntrack_standalone.c | 6 +++--- net/netfil

[PATCH net-next 0/2] break include loop and dsa devlink support

2017-03-28 Thread Andrew Lunn
These two patches add very basic support for devlink to DSA, in preparation for playing with dpipe. The first patch is needed to break an include loop between netdevice.h, dsa.h and devlink.h. We need to remove dsa.h from netdevice.h. As a result, some files fail to compile, because they require i

[PATCH net-next 2/2] net: dsa: dsa2: Add basic support of devlink

2017-03-28 Thread Andrew Lunn
Register the switch and its ports with devlink. Signed-off-by: Andrew Lunn --- include/net/dsa.h | 5 + net/dsa/dsa2.c| 47 +-- 2 files changed, 50 insertions(+), 2 deletions(-) diff --git a/include/net/dsa.h b/include/net/dsa.h index f80e819

  1   2   3   4   >