Re: [PATCH bpf-next 0/4] samples: bpf: fix build after move to full libbpf

2018-05-12 Thread Jesper Dangaard Brouer
On Fri, 11 May 2018 17:17:25 -0700 Jakub Kicinski wrote: > Following patches address build issues after recent move to libbpf. > For out-of-tree builds we would see the following error: > > gcc: error: samples/bpf/../../tools/lib/bpf/libbpf.a: No such file or >

[PATCH] 3c59x: convert to generic DMA API

2018-05-12 Thread Christoph Hellwig
This driver supports EISA devices in addition to PCI devices, and relied on the legacy behavior of the pci_dma* shims to pass on a NULL pointer to the DMA API, and the DMA API being able to handle that. When the NULL forwarding broke the EISA support got broken. Fix this by converting to the DMA

Re: rsi: fix spelling mistake: "thead" -> "thread"

2018-05-12 Thread Kalle Valo
Colin Ian King wrote: > From: Colin Ian King > > Trivial fix to spelling mistake in rsi_dbg debug message text > > Signed-off-by: Colin Ian King Patch applied to wireless-drivers-next.git, thanks. b41c39367669

[PATCH net] xfrm6: avoid potential infinite loop in _decode_session6()

2018-05-12 Thread Eric Dumazet
syzbot found a way to trigger an infinitie loop by overflowing @offset variable that has been forced to use u16 for some very obscure reason in the past. We probably want to look at NEXTHDR_FRAGMENT handling which looks wrong, in a separate patch. In net-next, we shall try to use

Re: [PATCH 14/32] net/tcp: convert to ->poll_mask

2018-05-12 Thread Christoph Hellwig
On Fri, May 11, 2018 at 06:13:11AM -0700, Eric Dumazet wrote: > > +struct wait_queue_head *tcp_get_poll_head(struct socket *sock, __poll_t > > events) > > +{ > > + sock_poll_busy_loop(sock, events); > > + sock_rps_record_flow(sock->sk); > > Why are you adding sock_rps_record_flow() ?

Re: possible deadlock in sk_diag_fill

2018-05-12 Thread Dmitry Vyukov
On Fri, May 11, 2018 at 8:33 PM, Andrei Vagin wrote: > On Sat, May 05, 2018 at 10:59:02AM -0700, syzbot wrote: >> Hello, >> >> syzbot found the following crash on: >> >> HEAD commit:c1c07416cdd4 Merge tag 'kbuild-fixes-v4.17' of git://git.k.. >> git tree: upstream

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

2018-05-12 Thread Dmitry Vyukov
On Mon, Jan 29, 2018 at 3:58 PM, syzbot wrote: > Hello, > > syzbot hit the following crash on upstream commit > 24b1cccf922914f3d6eeb84036dde8338bc03abb (Sun Jan 28 20:24:36 2018 +) > Merge branch 'x86-pti-for-linus' of >

Re: [PATCH bpf v3] x86/cpufeature: bpf hack for clang not supporting asm goto

2018-05-12 Thread Alexei Starovoitov
On Thu, May 10, 2018 at 10:58 AM, Alexei Starovoitov wrote: > I see no option, but to fix the kernel. > Regardless whether it's called user space breakage or kernel breakage. Peter, could you please ack the patch or better yet take it into tip tree and send to

Re: [PATCH net-next 3/8] sctp: move the flush of ctrl chunks into its own function

2018-05-12 Thread Marcelo Ricardo Leitner
On Fri, May 11, 2018 at 08:28:45PM -0300, Marcelo Ricardo Leitner wrote: > Named sctp_outq_flush_ctrl and, with that, keep the contexts contained. kbuild bot spotted some issues with this patch. They were corrected later on on the series, but I should fix them here. Will post a v2 later today.

[PATCH bpf-next v5 4/6] bpf: Split lwt inout verifier structures

2018-05-12 Thread Mathieu Xhonneux
The new bpf_lwt_push_encap helper should only be accessible within the LWT BPF IN hook, and not the OUT one, as this may lead to a skb under panic. At the moment, both LWT BPF IN and OUT share the same list of helpers, whose calls are authorized by the verifier. This patch separates the verifier

[PATCH bpf-next v5 5/6] ipv6: sr: Add seg6local action End.BPF

2018-05-12 Thread Mathieu Xhonneux
This patch adds the End.BPF action to the LWT seg6local infrastructure. This action works like any other seg6local End action, meaning that an IPv6 header with SRH is needed, whose DA has to be equal to the SID of the action. It will also advance the SRH to the next segment, the BPF program does

[PATCH bpf-next v5 2/6] ipv6: sr: export function lookup_nexthop

2018-05-12 Thread Mathieu Xhonneux
The function lookup_nexthop is essential to implement most of the seg6local actions. As we want to provide a BPF helper allowing to apply some of these actions on the packet being processed, the helper should be able to call this function, hence the need to make it public. Moreover, if one

[PATCH bpf-next v5 6/6] selftests/bpf: test for seg6local End.BPF action

2018-05-12 Thread Mathieu Xhonneux
Add a new test for the seg6local End.BPF action. The following helpers are also tested : - bpf_lwt_push_encap within the LWT BPF IN hook - bpf_lwt_seg6_action - bpf_lwt_seg6_adjust_srh - bpf_lwt_seg6_store_bytes A chain of End.BPF actions is built. The SRH is injected through a LWT BPF IN hook

[PATCH bpf-next v5 3/6] bpf: Add IPv6 Segment Routing helpers

2018-05-12 Thread Mathieu Xhonneux
The BPF seg6local hook should be powerful enough to enable users to implement most of the use-cases one could think of. After some thinking, we figured out that the following actions should be possible on a SRv6 packet, requiring 3 specific helpers : - bpf_lwt_seg6_store_bytes: Modify

[PATCH bpf-next v5 0/6] ipv6: sr: introduce seg6local End.BPF action

2018-05-12 Thread Mathieu Xhonneux
As of Linux 4.14, it is possible to define advanced local processing for IPv6 packets with a Segment Routing Header through the seg6local LWT infrastructure. This LWT implements the network programming principles defined in the IETF “SRv6 Network Programming” draft. The implemented operations are

[PATCH bpf-next v5 1/6] ipv6: sr: make seg6.h includable without IPv6

2018-05-12 Thread Mathieu Xhonneux
include/net/seg6.h cannot be included in a source file if CONFIG_IPV6 is not enabled: include/net/seg6.h: In function 'seg6_pernet': >> include/net/seg6.h:52:14: error: 'struct net' has no member named 'ipv6'; did you mean 'ipv4'? return

Re: iproute2 - modifying routes in place

2018-05-12 Thread David Ahern
On 5/11/18 4:42 AM, Ryan Whelan wrote: > `ip route` has 2 subcommands that don't seem to work as expected and i'm > not sure if its a bug, or if i'm misunderstanding the semantics. Can you try with ipv6/route-bugs branch in https://github.com/dsahern/linux

Re: [PATCH net-next] net:sched: add gkprio scheduler

2018-05-12 Thread Jamal Hadi Salim
Sorry for the latency.. On 09/05/18 01:37 PM, Michel Machado wrote: On 05/09/2018 10:43 AM, Jamal Hadi Salim wrote: On 08/05/18 10:27 PM, Cong Wang wrote: On Tue, May 8, 2018 at 6:29 AM, Jamal Hadi Salim wrote: I like the suggestion of extending skbmod to mark skbprio

[PATCH] net/mlx5: Use 'kvfree()' for memory allocated by 'kvzalloc()'

2018-05-12 Thread Christophe JAILLET
'out' is allocated with 'kvzalloc()'. 'kvfree()' must be used to free it. Signed-off-by: Christophe JAILLET --- drivers/net/ethernet/mellanox/mlx5/core/vport.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

Re: [PATCH bpf-next v5 0/6] ipv6: sr: introduce seg6local End.BPF action

2018-05-12 Thread Mathieu Xhonneux
Sorry for the v4 still throwing warnings from the kbuild bot, this version should be OK. 2018-05-12 18:25 GMT+01:00 Mathieu Xhonneux : > As of Linux 4.14, it is possible to define advanced local processing for > IPv6 packets with a Segment Routing Header through the

Re: [PATCH bpf-next 3/4] samples: bpf: fix build after move to compiling full libbpf.a

2018-05-12 Thread Jakub Kicinski
On Fri, 11 May 2018 17:17:28 -0700, Jakub Kicinski wrote: > There are many ways users may compile samples, some of them got > broken by commit 5f9380572b4b ("samples: bpf: compile and link > against full libbpf"). Improve path resolution and make libbpf > building a dependency of source files to

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

2018-05-12 Thread Eric Biggers
On Thu, Feb 15, 2018 at 04:22:28PM -0800, Cong Wang wrote: > On Tue, Feb 13, 2018 at 10:48 AM, Dmitry Vyukov wrote: > > On Mon, Oct 30, 2017 at 7:41 PM, Cong Wang wrote: > >> On Mon, Oct 30, 2017 at 8:34 AM, syzbot > >>

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

2018-05-12 Thread Eric Biggers
On Fri, Jan 05, 2018 at 02:07:01PM -0800, syzbot wrote: > Hello, > > syzkaller hit the following crash on > 8a4816cad00bf14642f0ed6043b32d29a05006ce > git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git/master > compiler: gcc (GCC) 7.1.1 20170620 > .config is attached > Raw console

Re: [PATCH bpf] tools: bpf: fix NULL return handling in bpf__prepare_load

2018-05-12 Thread Daniel Borkmann
[ +Arnaldo ] On 05/11/2018 01:21 PM, YueHaibing wrote: > bpf_object__open()/bpf_object__open_buffer can return error pointer or NULL, > check the return values with IS_ERR_OR_NULL() in bpf__prepare_load and > bpf__prepare_load_buffer > > Signed-off-by: YueHaibing > --- >

Re: [PATCH bpf-next 3/4] samples: bpf: fix build after move to compiling full libbpf.a

2018-05-12 Thread Daniel Borkmann
On 05/12/2018 09:38 PM, Jakub Kicinski wrote: > On Fri, 11 May 2018 17:17:28 -0700, Jakub Kicinski wrote: >> There are many ways users may compile samples, some of them got >> broken by commit 5f9380572b4b ("samples: bpf: compile and link >> against full libbpf"). Improve path resolution and make

Re: [PATCH bpf v3] x86/cpufeature: bpf hack for clang not supporting asm goto

2018-05-12 Thread Thomas Gleixner
On Sat, 12 May 2018, Alexei Starovoitov wrote: > On Thu, May 10, 2018 at 10:58 AM, Alexei Starovoitov > wrote: > > I see no option, but to fix the kernel. > > Regardless whether it's called user space breakage or kernel breakage. There is a big difference. If you

[PATCH net-next v2 2/8] sctp: factor out sctp_outq_select_transport

2018-05-12 Thread Marcelo Ricardo Leitner
We had two spots doing such complex operation and they were very close to each other, a bit more tailored to here or there. This patch unifies these under the same function, sctp_outq_select_transport, which knows how to handle control chunks and original transmissions (but not retransmissions).

[PATCH net-next v2 5/8] sctp: move flushing of data chunks out of sctp_outq_flush

2018-05-12 Thread Marcelo Ricardo Leitner
To the new sctp_outq_flush_data. Again, smaller functions and with well defined objectives. Signed-off-by: Marcelo Ricardo Leitner --- net/sctp/outqueue.c | 148 ++-- 1 file changed, 75 insertions(+), 73 deletions(-)

[PATCH net-next v2 3/8] sctp: move the flush of ctrl chunks into its own function

2018-05-12 Thread Marcelo Ricardo Leitner
Named sctp_outq_flush_ctrl and, with that, keep the contexts contained. One small fix embedded is the reset of one_packet at every iteration. This allows bundling of some control chunks in case they were preceded by another control chunk that cannot be bundled. Other than this, it has the same

[PATCH net-next v2 6/8] sctp: move transport flush code out of sctp_outq_flush

2018-05-12 Thread Marcelo Ricardo Leitner
To the new sctp_outq_flush_transports. Comment on Nagle is outdated and removed. Nagle is performed earlier, while checking if the chunk fits the packet: if the outq length is not enough to fill the packet, it returns SCTP_XMIT_DELAY. So by when it gets to sctp_outq_flush_transports, it has to

[PATCH net-next v2 3/3] sctp: checkpatch fixups

2018-05-12 Thread Marcelo Ricardo Leitner
A collection of fixups from previous patches, left for later to not introduce unnecessary changes while moving code around. Signed-off-by: Marcelo Ricardo Leitner --- net/sctp/outqueue.c | 20 +++- 1 file changed, 7 insertions(+), 13 deletions(-) diff

[PATCH net-next v2 2/3] sctp: add asoc and packet to sctp_flush_ctx

2018-05-12 Thread Marcelo Ricardo Leitner
Pre-compute these so the compiler won't reload them (due to no-strict-aliasing). Signed-off-by: Marcelo Ricardo Leitner --- net/sctp/outqueue.c | 99 - 1 file changed, 45 insertions(+), 54 deletions(-) diff --git

[PATCH net-next v2 1/3] sctp: add sctp_flush_ctx, a context struct on outq_flush routines

2018-05-12 Thread Marcelo Ricardo Leitner
With this struct we avoid passing lots of variables around and taking care of updating the current transport/packet. Signed-off-by: Marcelo Ricardo Leitner --- net/sctp/outqueue.c | 182 +--- 1 file changed, 88

[PATCH net-next v2 0/3] sctp: Introduce sctp_flush_ctx

2018-05-12 Thread Marcelo Ricardo Leitner
This struct will hold all the context used during the outq flush, so we don't have to pass lots of pointers all around. Checked on x86_64, the compiler inlines all these functions and there is no derreference added because of the struct. This patchset depends on 'sctp: refactor sctp_outq_flush'

[PATCH net-next v2 1/8] sctp: add sctp_packet_singleton

2018-05-12 Thread Marcelo Ricardo Leitner
Factor out the code for generating singletons. It's used only once, but helps to keep the context contained. The const variables are to ease the reading of subsequent calls in there. Signed-off-by: Marcelo Ricardo Leitner --- net/sctp/outqueue.c | 22

[PATCH net-next v2 7/8] sctp: make use of gfp on retransmissions

2018-05-12 Thread Marcelo Ricardo Leitner
Retransmissions may be triggered when in user context, so lets make use of gfp. Signed-off-by: Marcelo Ricardo Leitner --- net/sctp/outqueue.c | 17 + 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/net/sctp/outqueue.c

[PATCH net-next v2 4/8] sctp: move outq data rtx code out of sctp_outq_flush

2018-05-12 Thread Marcelo Ricardo Leitner
This patch renames current sctp_outq_flush_rtx to __sctp_outq_flush_rtx and create a new sctp_outq_flush_rtx, with the code that was on sctp_outq_flush. Again, the idea is to have functions with small and defined objectives. Yes, there is an open-coded path selection in the now

[PATCH net-next v2 8/8] sctp: rework switch cases in sctp_outq_flush_data

2018-05-12 Thread Marcelo Ricardo Leitner
Remove an inner one, which tended to be error prone due to the cascading and it can be replaced by a simple if (). Rework the outer one so that the actual flush code is not inside it. Now we first validate if we can or cannot send data, return if not, and then the flush code. Suggested-by: Xin

[PATCH net-next v2 0/8] sctp: refactor sctp_outq_flush

2018-05-12 Thread Marcelo Ricardo Leitner
Currently sctp_outq_flush does many different things and arguably unrelated, such as doing transport selection and outq dequeueing. This patchset refactors it into smaller and more dedicated functions. The end behavior should be the same. The next patchset will rework the function parameters.

Re: [PATCH v6 1/6] net: phy: at803x: Export at803x_debug_reg_mask()

2018-05-12 Thread Andrew Lunn
On Fri, May 11, 2018 at 03:22:39PM -0700, Paul Burton wrote: > Hi Andrew, > > On Fri, May 11, 2018 at 09:24:46PM +0200, Andrew Lunn wrote: > > > I could reorder the probe function a little to initialize the PHY before > > > performing the MAC reset, drop this patch and the AR803X hibernation > >

[PATCH] ipvlan: flush arp table when mac address changed

2018-05-12 Thread liuqifa
From: Keefe Liu When master device's mac has been changed, the commit <32c10bbfe914> "ipvlan: always use the current L2 addr of the master" makes the IPVlan devices's mac changed also, but it doesn't flush the IPVlan's arp table. Signed-off-by: Keefe Liu

Re: [RFC] net: Add new LoRaWAN subsystem

2018-05-12 Thread Jian-Hong Pan
Hi Jiri and Marcel, 2018-05-11 23:39 GMT+08:00 Marcel Holtmann : > Hi Jian-Hong, > >> A Low-Power Wide-Area Network (LPWAN) is a type of wireless >> telecommunication wide area network designed to allow long range >> communications at a low bit rate among things (connected

[PATCH ghak81 RFC V2 2/5] audit: convert sessionid unset to a macro

2018-05-12 Thread Richard Guy Briggs
Use a macro, "AUDIT_SID_UNSET", to replace each instance of initialization and comparison to an audit session ID. Signed-off-by: Richard Guy Briggs --- include/linux/audit.h | 2 +- include/net/xfrm.h | 2 +- include/uapi/linux/audit.h | 1 + init/init_task.c

[PATCH ghak81 RFC V2 4/5] audit: use inline function to set audit context

2018-05-12 Thread Richard Guy Briggs
Recognizing that the audit context is an internal audit value, use an access function to set the audit context pointer for the task rather than reaching directly into the task struct to set it. Signed-off-by: Richard Guy Briggs --- include/linux/audit.h | 6 ++

[PATCH ghak81 RFC V2 3/5] audit: use inline function to get audit context

2018-05-12 Thread Richard Guy Briggs
Recognizing that the audit context is an internal audit value, use an access function to retrieve the audit context pointer for the task rather than reaching directly into the task struct to get it. Signed-off-by: Richard Guy Briggs --- include/linux/audit.h| 14

[PATCH ghak81 RFC V2 5/5] audit: collect audit task parameters

2018-05-12 Thread Richard Guy Briggs
The audit-related parameters in struct task_struct should ideally be collected together and accessed through a standard audit API. Collect the existing loginuid, sessionid and audit_context together in a new struct audit_task_info called "audit" in struct task_struct. See:

[PATCH ghak81 RFC V2 1/5] audit: normalize loginuid read access

2018-05-12 Thread Richard Guy Briggs
Recognizing that the loginuid is an internal audit value, use an access function to retrieve the audit loginuid value for the task rather than reaching directly into the task struct to get it. Signed-off-by: Richard Guy Briggs --- kernel/auditsc.c | 18 +- 1

[PATCH ghak81 RFC V2 0/5] audit: group task params

2018-05-12 Thread Richard Guy Briggs
Group the audit parameters for each task into one structure. In particular, remove the loginuid and sessionid values and the audit context pointer from the task structure, replacing them with an audit task information structure to contain them. Use access functions to access audit values. Note: