Re: [bpf-next PATCH v3 7/7] bpf: sockmap set rlimit

2018-01-12 Thread Martin KaFai Lau
On Thu, Jan 11, 2018 at 09:08:02PM -0800, John Fastabend wrote: > Avoid extra step of setting limit from cmdline and do it directly in > the program. > > Signed-off-by: John Fastabend Acked-by: Martin KaFai Lau

Re: [bpf-next PATCH v3 4/7] bpf: sockmap sample, report bytes/sec

2018-01-12 Thread Martin KaFai Lau
On Thu, Jan 11, 2018 at 09:07:10PM -0800, John Fastabend wrote: > Report bytes/sec sent as well as total bytes. Useful to get rough > idea how different configurations and usage patterns perform with > sockmap. > > Signed-off-by: John Fastabend Acked-by: Martin KaFai

Re: [bpf-next PATCH v3 3/7] bpf: sockmap sample, use fork() for send and recv

2018-01-12 Thread Martin KaFai Lau
On Thu, Jan 11, 2018 at 09:06:54PM -0800, John Fastabend wrote: > Currently for SENDMSG tests first send completes then recv runs. This > does not work well for large data sizes and/or many iterations. So > fork the recv and send handler so that we run both send and recv. In > the future we can

Re: [bpf-next PATCH v3 5/7] bpf: sockmap sample add base test without any BPF for comparison

2018-01-12 Thread Martin KaFai Lau
On Thu, Jan 11, 2018 at 09:07:29PM -0800, John Fastabend wrote: > Add a base test that does not use BPF hooks to test baseline case. > > Signed-off-by: John Fastabend Acked-by: Martin KaFai Lau

Re: [bpf-next PATCH v3 6/7] bpf: sockmap put client sockets in blocking mode

2018-01-12 Thread Martin KaFai Lau
On Thu, Jan 11, 2018 at 09:07:45PM -0800, John Fastabend wrote: > Put client sockets in blocking mode otherwise with sendmsg tests > its easy to overrun the socket buffers which results in the test > being aborted. > > The original non-blocking was added to handle listen/accept with > a single

Re: [bpf-next PATCH v3 3/7] bpf: sockmap sample, use fork() for send and recv

2018-01-12 Thread Martin KaFai Lau
On Thu, Jan 11, 2018 at 09:06:54PM -0800, John Fastabend wrote: > Currently for SENDMSG tests first send completes then recv runs. This > does not work well for large data sizes and/or many iterations. So > fork the recv and send handler so that we run both send and recv. In > the future we can

Re: [bpf-next PATCH v3 2/7] bpf: add sendmsg option for testing BPF programs

2018-01-12 Thread Martin KaFai Lau
On Thu, Jan 11, 2018 at 09:06:34PM -0800, John Fastabend wrote: > When testing BPF programs using sockmap I often want to have more > control over how sendmsg is exercised. This becomes even more useful > as new sockmap program types are added. > > This adds a test type option to select type of

Re: BUG: unable to handle kernel paging request in check_memory_region

2018-01-12 Thread Dmitry Vyukov
On Fri, Jan 12, 2018 at 11:58 PM, syzbot wrote: > Hello, > > syzkaller hit the following crash on > c92a9a461dff6140c539c61e457aa97df29517d6 > git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/master > compiler: gcc (GCC) 7.1.1

Re: [bpf-next PATCH v3 1/7] bpf: refactor sockmap sample program update for arg parsing

2018-01-12 Thread Martin KaFai Lau
On Thu, Jan 11, 2018 at 09:06:17PM -0800, John Fastabend wrote: > sockmap sample program takes arguments from cmd line but it reads them > in using offsets into the array. Because we want to add more arguments > in the future lets do proper argument handling. > > Also refactor code to pull apart

Re: general protection fault in __bpf_map_put

2018-01-12 Thread Dmitry Vyukov
On Wed, Jan 10, 2018 at 1:58 PM, syzbot wrote: > Hello, > > syzkaller hit the following crash on > b4464bcab38d3f7fe995a7cb960eeac6889bec08 > git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/master > compiler: gcc (GCC) 7.1.1

Re: [PATCH net] sctp: removed unused var from sctp_make_auth

2018-01-12 Thread Xin Long
On Fri, Jan 12, 2018 at 12:22 AM, Marcelo Ricardo Leitner wrote: > Signed-off-by: Marcelo Ricardo Leitner > --- > net/sctp/sm_make_chunk.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/net/sctp/sm_make_chunk.c

Re: [PATCH net] sctp: avoid compiler warning on implicit fallthru

2018-01-12 Thread Xin Long
On Fri, Jan 12, 2018 at 12:22 AM, Marcelo Ricardo Leitner wrote: > These fall-through are expected. > > Signed-off-by: Marcelo Ricardo Leitner > --- > net/sctp/ipv6.c | 1 + > net/sctp/outqueue.c | 4 ++-- > 2 files changed, 3

[PATCH bpf] bpf: fix 32-bit divide by zero

2018-01-12 Thread Alexei Starovoitov
due to some JITs doing if (src_reg == 0) check in 64-bit mode for div/mod opreations mask upper 32-bits of src register before doing the check Fixes: 622582786c9e ("net: filter: x86: internal BPF JIT") Fixes: 7a12b5031c6b ("sparc64: Add eBPF JIT.") Reported-by:

Re: [PATCH net] Revert "openvswitch: Add erspan tunnel support."

2018-01-12 Thread Pravin Shelar
On Fri, Jan 12, 2018 at 12:29 PM, William Tu wrote: > This reverts commit ceaa001a170e43608854d5290a48064f57b565ed. > > The OVS_TUNNEL_KEY_ATTR_ERSPAN_OPTS attr should be designed > as a nested attribute to support all ERSPAN v1 and v2's fields. > The current attr is a be32

Re: [PATCH bpf-next v5 0/5] Separate error injection table from kprobes

2018-01-12 Thread Alexei Starovoitov
On Sat, Jan 13, 2018 at 02:53:33AM +0900, Masami Hiramatsu wrote: > Hi, > > Here are the 5th version of patches to moving error injection > table from kprobes. This version fixes a bug and update > fail-function to support multiple function error injection. > > Here is the previous version: > >

[PATCH v2] bpf: fix divides by zero

2018-01-12 Thread Eric Dumazet
From: Eric Dumazet Divides by zero are not nice, lets avoid them if possible. Also do_div() seems not needed when dealing with 32bit operands, but this seems a minor detail. Fixes: bd4cf0ed331a ("net: filter: rework/optimize internal BPF interpreter's instruction set")

Re: [PATCH] bpf: fix divides by zero

2018-01-12 Thread Alexei Starovoitov
On Fri, Jan 12, 2018 at 05:33:26PM -0800, Eric Dumazet wrote: > From: Eric Dumazet > > Divides by zero are not nice, lets avoid them if possible. > > Also do_div() seems not needed when dealing with 32bit operands, > but this seems a minor detail. > > Fixes: bd4cf0ed331a

Re: [PATCH] bpf: fix divides by zero

2018-01-12 Thread Eric Dumazet
On Fri, 2018-01-12 at 17:33 -0800, Eric Dumazet wrote: > From: Eric Dumazet > Sorry for the mangled patch. Will send V2

[PATCH] bpf: fix divides by zero

2018-01-12 Thread Eric Dumazet
From: Eric Dumazet Divides by zero are not nice, lets avoid them if possible. Also do_div() seems not needed when dealing with 32bit operands, but this seems a minor detail. Fixes: bd4cf0ed331a ("net: filter: rework/optimize internal BPF interpreter's instruction set")

[PATCH 2/2] ixgbe: use compiler constants in Rx path

2018-01-12 Thread Shannon Nelson
Rather than swapping runtime bytes to compare to constants, let the compiler swap the constants and save a couple of runtuime cycles. Signed-off-by: Shannon Nelson --- drivers/net/ethernet/intel/ixgbe/ixgbe_ipsec.c | 10 +- 1 file changed, 5 insertions(+), 5

[PATCH 1/2] ixgbe: ipsec offload for sparc

2018-01-12 Thread Shannon Nelson
Add a couple of byteswaps needed to make the ipsec offload work on big-endian SPARC platforms. Signed-off-by: Shannon Nelson --- drivers/net/ethernet/intel/ixgbe/ixgbe_ipsec.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git

Re: [PATCH bpf] bpf: do not modify min/max bounds on scalars with constant values

2018-01-12 Thread Daniel Borkmann
On 01/12/2018 08:52 PM, Edward Cree wrote: > On 12/01/18 19:23, Daniel Borkmann wrote: >> syzkaller generated a BPF proglet and triggered a warning with >> the following: >> >> 0: (b7) r0 = 0 >> 1: (d5) if r0 s<= 0x0 goto pc+0 >>R0=inv0 R1=ctx(id=0,off=0,imm=0) R10=fp0 >> 2: (1f) r0 -=

[patch 1/1] net/ipv6/route.c: work around gcc-4.4.4 anon union initializer issue

2018-01-12 Thread akpm
From: Andrew Morton Subject: net/ipv6/route.c: work around gcc-4.4.4 anon union initializer issue gcc-4.4.4 has problems with initializers of anonymous union fields. net/ipv6/route.c: In function 'rt6_sync_up': net/ipv6/route.c:3586: error: unknown field 'nh_flags'

Re: [PATCH v2 00/19] prevent bounds-check bypass via speculative execution

2018-01-12 Thread Tony Luck
On Thu, Jan 11, 2018 at 5:19 PM, Linus Torvalds wrote: > Should the array access in entry_SYSCALL_64_fastpath be made to use > the masking approach? That one has a bounds check for an inline constant. cmpq$__NR_syscall_max, %rax so should be safe. The

pull-request: bpf 2018-01-13

2018-01-12 Thread Daniel Borkmann
Hi David, The following pull-request contains BPF updates for your *net* tree. The main changes are: 1) Follow-up fix to the recent BPF out-of-bounds speculation fix that prevents max_entries overflows and an undefined behavior on 32 bit archs on index_mask calculation, from Daniel.

Re: [bpf-next PATCH] bpf: simplify xdp_convert_ctx_access for xdp_rxq_info

2018-01-12 Thread Daniel Borkmann
On 01/11/2018 05:39 PM, Jesper Dangaard Brouer wrote: > As pointed out by Daniel Borkmann, using bpf_target_off() is not > necessary for xdp_rxq_info when extracting queue_index and > ifindex, as these members are u32 like BPF_W. > > Also fix trivial spelling mistake introduced in same commit. >

Re: [PATCH v2 15/19] carl9170: prevent bounds-check bypass via speculative execution

2018-01-12 Thread Dan Williams
On Fri, Jan 12, 2018 at 12:01 PM, Christian Lamparter wrote: > On Friday, January 12, 2018 7:39:50 PM CET Dan Williams wrote: >> On Fri, Jan 12, 2018 at 6:42 AM, Christian Lamparter >> wrote: >> > On Friday, January 12, 2018 1:47:46 AM CET Dan Williams

Re: [PATCH][next] bnxt_en: ensure len is ininitialized to zero

2018-01-12 Thread Andy Gospodarek
On Fri, Jan 12, 2018 at 10:11:17AM -0800, Michael Chan wrote: > On Fri, Jan 12, 2018 at 9:46 AM, Colin King wrote: > > From: Colin Ian King > > > > In the case where cmp_type == CMP_TYPE_RX_L2_TPA_START_CMP the > > exit return path is via label

Re: [RFC bpf-next] bpf: add new jited info fields in bpf_dev_offload and bpf_prog_info

2018-01-12 Thread Jakub Kicinski
On Fri, 12 Jan 2018 12:31:15 +0100, Daniel Borkmann wrote: > On 01/12/2018 03:17 AM, Jakub Kicinski wrote: > > On Thu, 11 Jan 2018 16:47:47 -0800, Jakub Kicinski wrote: > >> Hi! > >> > >> Jiong is working on dumping JITed NFP image via bpftool, Francois will be > >> submitting support for NFP in

[PATCH v2] phy: realtek: use new helpers for paged register access

2018-01-12 Thread Heiner Kallweit
Make use of the new helpers for paged register access. Signed-off-by: Heiner Kallweit --- v2: - use accessor versions w/o locking in the read/write_page callbacks --- drivers/net/phy/realtek.c | 59 +++ 1 file changed, 14

Re: [PATCH] phy: realtek: use new helpers for paged register access

2018-01-12 Thread Heiner Kallweit
Am 12.01.2018 um 22:01 schrieb Andrew Lunn: > On Fri, Jan 12, 2018 at 09:30:08PM +0100, Heiner Kallweit wrote: >> Make use of the new helpers for paged register access. >> >> Signed-off-by: Heiner Kallweit >> --- >> drivers/net/phy/realtek.c | 59 >>

[RFC bpf-next 2/2] tools: bpftool: improve architecture detection by using offload arch info

2018-01-12 Thread Jakub Kicinski
From: Jiong Wang The current architecture detection method in bpftool is designed for host case. For offload case, we can't use the architecture of "bpftool" itself. We use the new arch name field in bpf_prog_info and use bfd_scan_arch to return the correct bfd arch.

[RFC bpf-next 1/2] nfp: bpf: set new jit info fields

2018-01-12 Thread Jakub Kicinski
From: Jiong Wang This patch set those new jit info fields introduced in previous patch for NFP. Signed-off-by: Jiong Wang --- drivers/net/ethernet/netronome/nfp/bpf/main.h| 2 ++ drivers/net/ethernet/netronome/nfp/bpf/offload.c | 12

Re: dvb usb issues since kernel 4.9

2018-01-12 Thread Eric Dumazet
On Fri, 2018-01-12 at 19:13 -0200, Mauro Carvalho Chehab wrote: > > > The .config file used to build the Kernel is at: > https://pastebin.com/wpZghann > Hi Mauro Any chance you can try CONFIG_HZ_1000=y, CONFIG_HZ=1000 ? Thanks.

[PATCH net-next 2/2 v11] net: ethernet: Add a driver for Gemini gigabit ethernet

2018-01-12 Thread Linus Walleij
The Gemini ethernet has been around for years as an out-of-tree patch used with the NAS boxen and routers built on StorLink SL3512 and SL3516, later Storm Semiconductor, later Cortina Systems. These ASICs are still being deployed and brand new off-the-shelf systems using it can easily be acquired.

[PATCH net-next 1/2 v11] net: ethernet: Add DT bindings for the Gemini ethernet

2018-01-12 Thread Linus Walleij
This adds the device tree bindings for the Gemini ethernet controller. It is pretty straight-forward, using standard bindings and modelling the two child ports as child devices under the parent ethernet controller device. Cc: devicet...@vger.kernel.org Cc: Tobias Waldvogel

Re: [PATCH] net/mlx4_en: ensure rx_desc updating reaches HW before prod db updating

2018-01-12 Thread Eric Dumazet
On Fri, 2018-01-12 at 13:01 -0800, Saeed Mahameed wrote: > which is better to grasp ?: > > update_doorbell() { > dma_wmb(); > ring->db = prod; > } This one is IMO the most secure one (least surprise) Considering the time it took to discover this bug, I would really play safe. But

Re: dvb usb issues since kernel 4.9

2018-01-12 Thread Mauro Carvalho Chehab
Em Tue, 9 Jan 2018 09:48:47 -0800 Linus Torvalds escreveu: > On Tue, Jan 9, 2018 at 9:27 AM, Eric Dumazet wrote: > > > > So yes, commit 4cd13c21b207 ("softirq: Let ksoftirqd do its job") has > > shown up multiple times in various 'regressions'

Re: [bpf-next PATCH 4/7] net: do_tcp_sendpages flag to avoid SKBTX_SHARED_FRAG

2018-01-12 Thread John Fastabend
On 01/12/2018 12:46 PM, Eric Dumazet wrote: > On Fri, 2018-01-12 at 12:26 -0800, John Fastabend wrote: >> On 01/12/2018 12:10 PM, Eric Dumazet wrote: >>> On Fri, 2018-01-12 at 10:10 -0800, John Fastabend wrote: When calling do_tcp_sendpages() from in kernel and we know the data has no

Re: NOARP devices and NOARP arp_cache entires

2018-01-12 Thread Jim Westfall
Jim Westfall wrote [01.11.18]: > Hi > > I'm seeing some weird behavior related to NOARP devices and NOARP > entries in the arp cache. > > I have a couple gre tunnels between a linux box and a upstream router that > send/recv a large amount of packets with unique

Re: [PATCH] net/mlx4_en: ensure rx_desc updating reaches HW before prod db updating

2018-01-12 Thread Saeed Mahameed
On 01/12/2018 12:16 PM, Eric Dumazet wrote: > On Fri, 2018-01-12 at 11:53 -0800, Saeed Mahameed wrote: >> >> On 01/12/2018 08:46 AM, Eric Dumazet wrote: >>> On Fri, 2018-01-12 at 09:32 -0700, Jason Gunthorpe wrote: On Fri, Jan 12, 2018 at 11:42:22AM +0800, Jianchao Wang wrote: >

Re: [PATCH] phy: realtek: use new helpers for paged register access

2018-01-12 Thread Andrew Lunn
On Fri, Jan 12, 2018 at 09:30:08PM +0100, Heiner Kallweit wrote: > Make use of the new helpers for paged register access. > > Signed-off-by: Heiner Kallweit > --- > drivers/net/phy/realtek.c | 59 > +++ > 1 file changed, 14

Re: [bpf-next PATCH 4/7] net: do_tcp_sendpages flag to avoid SKBTX_SHARED_FRAG

2018-01-12 Thread Eric Dumazet
On Fri, 2018-01-12 at 12:26 -0800, John Fastabend wrote: > On 01/12/2018 12:10 PM, Eric Dumazet wrote: > > On Fri, 2018-01-12 at 10:10 -0800, John Fastabend wrote: > > > When calling do_tcp_sendpages() from in kernel and we know the data > > > has no references from user side we can omit

Re: [PATCH net] Revert "openvswitch: Add erspan tunnel support."

2018-01-12 Thread Jiri Benc
On Fri, 12 Jan 2018 12:29:22 -0800, William Tu wrote: > This reverts commit ceaa001a170e43608854d5290a48064f57b565ed. > > The OVS_TUNNEL_KEY_ATTR_ERSPAN_OPTS attr should be designed > as a nested attribute to support all ERSPAN v1 and v2's fields. > The current attr is a be32 supporting only one

Re: [PATCH 32/32] aio: implement io_pgetevents

2018-01-12 Thread Jeff Moyer
Christoph Hellwig writes: > This is the io_getevents equivalent of ppoll/pselect and allows to > properly mix signals and aio completions (especially with IOCB_CMD_POLL) > and atomically executes the following sequence: > > sigset_t origmask; > >

[PATCH] phy: realtek: use new helpers for paged register access

2018-01-12 Thread Heiner Kallweit
Make use of the new helpers for paged register access. Signed-off-by: Heiner Kallweit --- drivers/net/phy/realtek.c | 59 +++ 1 file changed, 14 insertions(+), 45 deletions(-) diff --git a/drivers/net/phy/realtek.c

[PATCH net] Revert "openvswitch: Add erspan tunnel support."

2018-01-12 Thread William Tu
This reverts commit ceaa001a170e43608854d5290a48064f57b565ed. The OVS_TUNNEL_KEY_ATTR_ERSPAN_OPTS attr should be designed as a nested attribute to support all ERSPAN v1 and v2's fields. The current attr is a be32 supporting only one field. Thus, this patch reverts it and later patch will redo it

Re: [bpf-next PATCH 4/7] net: do_tcp_sendpages flag to avoid SKBTX_SHARED_FRAG

2018-01-12 Thread John Fastabend
On 01/12/2018 12:10 PM, Eric Dumazet wrote: > On Fri, 2018-01-12 at 10:10 -0800, John Fastabend wrote: >> When calling do_tcp_sendpages() from in kernel and we know the data >> has no references from user side we can omit SKBTX_SHARED_FRAG flag. >> This patch adds an internal flag,

[PATCH net-next 1/2] phy: add helpers for setting/clearing bits in PHY registers

2018-01-12 Thread Heiner Kallweit
Based on the recent introduction of phy_modify add helpers for setting and clearing bits in PHY registers. Signed-off-by: Heiner Kallweit --- include/linux/phy.h | 49 + 1 file changed, 49 insertions(+) diff --git

[PATCH net-next 2/2] phy: use new helpers phy_set_bits/phy_clear_bits in phylib

2018-01-12 Thread Heiner Kallweit
Use new helpers phy_set_bits / phy_clear_bits in phylib. Signed-off-by: Heiner Kallweit --- drivers/net/phy/phy_device.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c index

Re: [PATCH] net/mlx4_en: ensure rx_desc updating reaches HW before prod db updating

2018-01-12 Thread Eric Dumazet
On Fri, 2018-01-12 at 11:53 -0800, Saeed Mahameed wrote: > > On 01/12/2018 08:46 AM, Eric Dumazet wrote: > > On Fri, 2018-01-12 at 09:32 -0700, Jason Gunthorpe wrote: > > > On Fri, Jan 12, 2018 at 11:42:22AM +0800, Jianchao Wang wrote: > > > > Customer reported memory corruption issue on previous

[PATCH net-next 0/2] phy: add helpers for setting/clearing bits in PHY registers

2018-01-12 Thread Heiner Kallweit
Based on the recent introduction of phy_modify add helpers for setting and clearing bits in PHY registers. First user is phylib. Heiner Kallweit (2): phy: add helpers for setting/clearing bits in PHY registers phy: use new helpers phy_set_bits/phy_clear_bits in phylib

Re: [PATCH net] sctp: removed unused var from sctp_make_auth

2018-01-12 Thread Neil Horman
On Thu, Jan 11, 2018 at 02:22:07PM -0200, Marcelo Ricardo Leitner wrote: > Signed-off-by: Marcelo Ricardo Leitner > --- > net/sctp/sm_make_chunk.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/net/sctp/sm_make_chunk.c

Re: [PATCH net] sctp: avoid compiler warning on implicit fallthru

2018-01-12 Thread Neil Horman
On Thu, Jan 11, 2018 at 02:22:06PM -0200, Marcelo Ricardo Leitner wrote: > These fall-through are expected. > > Signed-off-by: Marcelo Ricardo Leitner > --- > net/sctp/ipv6.c | 1 + > net/sctp/outqueue.c | 4 ++-- > 2 files changed, 3 insertions(+), 2 deletions(-)

Re: [bpf-next PATCH 4/7] net: do_tcp_sendpages flag to avoid SKBTX_SHARED_FRAG

2018-01-12 Thread Eric Dumazet
On Fri, 2018-01-12 at 10:10 -0800, John Fastabend wrote: > When calling do_tcp_sendpages() from in kernel and we know the data > has no references from user side we can omit SKBTX_SHARED_FRAG flag. > This patch adds an internal flag, NO_SKBTX_SHARED_FRAG that can be used > to omit setting

[PATCH net-next] ipv6: Fix build with gcc-4.4.5

2018-01-12 Thread Ido Schimmel
Emil reported the following compiler errors: net/ipv6/route.c: In function `rt6_sync_up`: net/ipv6/route.c:3586: error: unknown field `nh_flags` specified in initializer net/ipv6/route.c:3586: warning: missing braces around initializer net/ipv6/route.c:3586: warning: (near initialization for

Re: [PATCH v2 15/19] carl9170: prevent bounds-check bypass via speculative execution

2018-01-12 Thread Christian Lamparter
On Friday, January 12, 2018 7:39:50 PM CET Dan Williams wrote: > On Fri, Jan 12, 2018 at 6:42 AM, Christian Lamparter > wrote: > > On Friday, January 12, 2018 1:47:46 AM CET Dan Williams wrote: > >> Static analysis reports that 'queue' may be a user controlled value that > >>

[net-next 1/1] tipc: fix bug during lookup of multicast destination nodes

2018-01-12 Thread Jon Maloy
In commit 232d07b74a33 ("tipc: improve groupcast scope handling") we inadvertently broke non-group multicast transmission when changing the parameter 'domain' to 'scope' in the function tipc_nametbl_lookup_dst_nodes(). We missed to make the corresponding change in the calling function, with the

Re: [PATCH] net/mlx4_en: ensure rx_desc updating reaches HW before prod db updating

2018-01-12 Thread Saeed Mahameed
On 01/12/2018 08:46 AM, Eric Dumazet wrote: On Fri, 2018-01-12 at 09:32 -0700, Jason Gunthorpe wrote: On Fri, Jan 12, 2018 at 11:42:22AM +0800, Jianchao Wang wrote: Customer reported memory corruption issue on previous mlx4_en driver version where the order-3 pages and multiple page

Re: [PATCH bpf] bpf: do not modify min/max bounds on scalars with constant values

2018-01-12 Thread Edward Cree
On 12/01/18 19:23, Daniel Borkmann wrote: > syzkaller generated a BPF proglet and triggered a warning with > the following: > > 0: (b7) r0 = 0 > 1: (d5) if r0 s<= 0x0 goto pc+0 >R0=inv0 R1=ctx(id=0,off=0,imm=0) R10=fp0 > 2: (1f) r0 -= r1 >R0=inv0 R1=ctx(id=0,off=0,imm=0) R10=fp0 >

[PATCH bpf] bpf: do not modify min/max bounds on scalars with constant values

2018-01-12 Thread Daniel Borkmann
syzkaller generated a BPF proglet and triggered a warning with the following: 0: (b7) r0 = 0 1: (d5) if r0 s<= 0x0 goto pc+0 R0=inv0 R1=ctx(id=0,off=0,imm=0) R10=fp0 2: (1f) r0 -= r1 R0=inv0 R1=ctx(id=0,off=0,imm=0) R10=fp0 verifier internal error: known but bad sbounds What

Re: [PATCHv2 net-next 2/2] openvswitch: add erspan version II support

2018-01-12 Thread William Tu
On Fri, Jan 12, 2018 at 10:39 AM, Pravin Shelar wrote: > On Fri, Jan 12, 2018 at 12:27 AM, Jiri Benc wrote: >> On Thu, 11 Jan 2018 08:34:14 -0800, William Tu wrote: >>> I'd also prefer reverting ceaa001a170e since it's more clean but I >>> also hope to have

Re: [PATCH v2 10/19] ipv4: prevent bounds-check bypass via speculative execution

2018-01-12 Thread Dan Williams
On Thu, Jan 11, 2018 at 11:59 PM, Greg KH wrote: > On Thu, Jan 11, 2018 at 04:47:18PM -0800, Dan Williams wrote: >> Static analysis reports that 'offset' may be a user controlled value >> that is used as a data dependency reading from a raw_frag_vec buffer. >> In order

Re: [PATCH v2 15/19] carl9170: prevent bounds-check bypass via speculative execution

2018-01-12 Thread Dan Williams
On Fri, Jan 12, 2018 at 6:42 AM, Christian Lamparter wrote: > On Friday, January 12, 2018 1:47:46 AM CET Dan Williams wrote: >> Static analysis reports that 'queue' may be a user controlled value that >> is used as a data dependency to read from the 'ar9170_qmap' array. In >>

Re: [PATCHv2 net-next 2/2] openvswitch: add erspan version II support

2018-01-12 Thread Pravin Shelar
On Fri, Jan 12, 2018 at 12:27 AM, Jiri Benc wrote: > On Thu, 11 Jan 2018 08:34:14 -0800, William Tu wrote: >> I'd also prefer reverting ceaa001a170e since it's more clean but I >> also hope to have this feature in 4.15. >> How long does reverting take? Am I only able to submit

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

2018-01-12 Thread Sowmini Varadhan
On (01/11/18 21:29), syzbot wrote: > == > BUG: KASAN: use-after-free in rds_tcp_tune+0x491/0x520 net/rds/tcp.c:397 > Read of size 4 at addr 8801cd5f6c58 by task kworker/u4:4/4954 Just had an offline discussion with santosh around

RE: [PATCH net-next] i40evf: use GFP_ATOMIC under spin lock

2018-01-12 Thread Keller, Jacob E
> -Original Message- > From: Wei Yongjun [mailto:weiyongj...@huawei.com] > Sent: Thursday, January 11, 2018 6:27 PM > To: Kirsher, Jeffrey T ; Keller, Jacob E > > Cc: Wei Yongjun ;

[bpf-next PATCH 7/7] bpf: add verifier tests for BPF_PROG_TYPE_SK_MSG

2018-01-12 Thread John Fastabend
Test read and writes for BPF_PROG_TYPE_SK_MSG. Signed-off-by: John Fastabend --- tools/testing/selftests/bpf/test_verifier.c | 54 +++ 1 file changed, 54 insertions(+) diff --git a/tools/testing/selftests/bpf/test_verifier.c

[bpf-next PATCH 6/7] bpf: add map tests for BPF_PROG_TYPE_SK_MSG

2018-01-12 Thread John Fastabend
Add map tests to attach BPF_PROG_TYPE_SK_MSG types to a sockmap. Signed-off-by: John Fastabend --- tools/include/uapi/linux/bpf.h | 16 ++ tools/testing/selftests/bpf/Makefile |3 + tools/testing/selftests/bpf/bpf_helpers.h

[bpf-next PATCH 5/7] bpf: create tcp_bpf_ulp allowing BPF to monitor socket TX/RX data

2018-01-12 Thread John Fastabend
This implements a BPF ULP layer to allow policy enforcement and monitoring at the socket layer. In order to support this a new program type BPF_PROG_TYPE_SK_MSG is used to run the policy at the sendmsg/sendpage hook. To attach the policy to sockets a sockmap is used with a new program attach type

Re: [PATCH][next] bnxt_en: ensure len is ininitialized to zero

2018-01-12 Thread Michael Chan
On Fri, Jan 12, 2018 at 9:46 AM, Colin King wrote: > From: Colin Ian King > > In the case where cmp_type == CMP_TYPE_RX_L2_TPA_START_CMP the > exit return path is via label next_rx_no_prod and cpr->rx_bytes > is being updated by an

[bpf-next PATCH 4/7] net: do_tcp_sendpages flag to avoid SKBTX_SHARED_FRAG

2018-01-12 Thread John Fastabend
When calling do_tcp_sendpages() from in kernel and we know the data has no references from user side we can omit SKBTX_SHARED_FRAG flag. This patch adds an internal flag, NO_SKBTX_SHARED_FRAG that can be used to omit setting SKBTX_SHARED_FRAG. Signed-off-by: John Fastabend

[bpf-next PATCH 2/7] sock: make static tls function alloc_sg generic sock helper

2018-01-12 Thread John Fastabend
The TLS ULP module builds scatterlists from a sock using page_frag_refill(). This is going to be useful for other ULPs so move it into sock file for more general use. In the process remove useless goto at end of while loop. Signed-off-by: John Fastabend ---

[bpf-next PATCH 3/7] sockmap: convert refcnt to an atomic refcnt

2018-01-12 Thread John Fastabend
The sockmap refcnt up until now has been wrapped in the sk_callback_lock(). So its not actually needed any locking of its own. The counter itself tracks the lifetime of the psock object. Sockets in a sockmap have a lifetime that is independent of the map they are part of. This is possible because

Re: [PATCH V2] ipvlan: fix ipvlan MTU limits

2018-01-12 Thread Jiri Benc
On Fri, 12 Jan 2018 09:50:35 -0800, Mahesh Bandewar (महेश बंडेवार) wrote: > (Looks like you missed the last update I mentioned) I did not miss it. The proposed behavior is inconsistent and has no clear pattern (I used the word "magic" for that). I guess examples will help more. See below. > Here

[bpf-next PATCH 1/7] net: add a UID to use for ULP socket assignment

2018-01-12 Thread John Fastabend
Create a UID field and enum that can be used to assign ULPs to sockets. This saves a set of string comparisons if the ULP id is known. For sockmap, which is added in the next patches, a ULP is used as a TX hook for TCP sockets. In this case the ULP being added is done at map insert time and the

[bpf-next PATCH 0/7] Add BPF_PROG_TYPE_SK_MSG and attach pt

2018-01-12 Thread John Fastabend
This series include 4 setup patches (1-4) to allow ULP layer and sockmap refcounting to support another ULP type. There is one small change (5 lines!) on the TCP side in patch 4. This adds a flag so that the ULP layer can inform the TCP stack not to mark the frags as shared. When the ULP layer

[PATCH iproute2] ipaddress: Use family_name() for better code reuse

2018-01-12 Thread Serhey Popovych
Signed-off-by: Serhey Popovych --- ip/ipaddress.c | 23 +-- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/ip/ipaddress.c b/ip/ipaddress.c index f150d91..a3595c1 100644 --- a/ip/ipaddress.c +++ b/ip/ipaddress.c @@ -1558,6 +1558,8 @@

[PATCH bpf-next v5 3/5] error-injection: Separate error-injection from kprobe

2018-01-12 Thread Masami Hiramatsu
Since error-injection framework is not limited to be used by kprobes, nor bpf. Other kernel subsystems can use it freely for checking safeness of error-injection, e.g. livepatch, ftrace etc. So this separate error-injection framework from kprobes. Some differences has been made: - "kprobe" word

[PATCH bpf-next v5 5/5] error-injection: Support fault injection framework

2018-01-12 Thread Masami Hiramatsu
Support in-kernel fault-injection framework via debugfs. This allows you to inject a conditional error to specified function using debugfs interfaces. Here is the result of test script described in Documentation/fault-injection/fault-injection.txt === # ./test_fail_function.sh 1+0

[PATCH bpf-next v5 4/5] error-injection: Add injectable error types

2018-01-12 Thread Masami Hiramatsu
Add injectable error types for each error-injectable function. One motivation of error injection test is to find software flaws, mistakes or mis-handlings of expectable errors. If we find such flaws by the test, that is a program bug, so we need to fix it. But if the tester miss input the error

[PATCH bpf-next v5 2/5] tracing/kprobe: bpf: Compare instruction pointer with original one

2018-01-12 Thread Masami Hiramatsu
Compare instruction pointer with original one on the stack instead using per-cpu bpf_kprobe_override flag. This patch also consolidates reset_current_kprobe() and preempt_enable_no_resched() blocks. Those can be done in one place. Signed-off-by: Masami Hiramatsu

[PATCH bpf-next v5 1/5] tracing/kprobe: bpf: Check error injectable event is on function entry

2018-01-12 Thread Masami Hiramatsu
Check whether error injectable event is on function entry or not. Currently it checks the event is ftrace-based kprobes or not, but that is wrong. It should check if the event is on the entry of target function. Since error injection will override a function to just return with modified return

[PATCH bpf-next v5 0/5] Separate error injection table from kprobes

2018-01-12 Thread Masami Hiramatsu
Hi, Here are the 5th version of patches to moving error injection table from kprobes. This version fixes a bug and update fail-function to support multiple function error injection. Here is the previous version: https://patchwork.ozlabs.org/cover/858663/ Changes in v5: - [3/5] Fix a bug that

Re: [PATCH][next] ixgbe: fix comparison of offset with zero or NVM_INVALID_PTR

2018-01-12 Thread Jeff Kirsher
On Fri, 2018-01-12 at 17:13 +, Colin King wrote: > From: Colin Ian King > > The incorrect operator && is being used and will always return false > as offset can never be two different values at the same time. Fix > this > by using the || operator instead. > >

Re: [PATCH V2] ipvlan: fix ipvlan MTU limits

2018-01-12 Thread महेश बंडेवार
On Fri, Jan 12, 2018 at 12:48 AM, Jiri Benc wrote: > On Fri, 12 Jan 2018 09:34:13 +0100, Jiri Benc wrote: >> I don't think this works currently. When someone (does not have to be >> you, it can be a management software running in background) sets the >> MTU to the current value,

[PATCH iproute2] tunnel: Return constant string without copying it

2018-01-12 Thread Serhey Popovych
We return constant string from tnl_strproto(), no need to copy it to temporary buffer and then return such buffer as const: return constant string instead. Signed-off-by: Serhey Popovych --- ip/tunnel.c | 25 +++-- 1 file changed, 7 insertions(+),

[PATCH][next] bnxt_en: ensure len is ininitialized to zero

2018-01-12 Thread Colin King
From: Colin Ian King In the case where cmp_type == CMP_TYPE_RX_L2_TPA_START_CMP the exit return path is via label next_rx_no_prod and cpr->rx_bytes is being updated by an uninitialized value from len. Fix this by initializing len to zero. Detected by CoverityScan,

[PATCH iproute2 2/9] ip/tunnel: Correct and unify ttl/hoplimit printing

2018-01-12 Thread Serhey Popovych
Both ttl/hoplimit is from 1 to 255. Zero has special meaning: use encapsulated packet value. In ip-link(8) -d output this looks like "ttl/hoplimit inherit". In JSON we have "int" type for ttl and therefore values from 0 (inherit) to 255. To do the best in handling ttl/hoplimit we need to accept

[PATCH iproute2 9/9] vti6/tunnel: Unify and simplify link type help functions

2018-01-12 Thread Serhey Popovych
Both of these two changes are missing for link_vti6.c: o commit 8b47135474cd (ip: link: Unify link type help functions a bit) o commit 561e650eff67 (ip link: Shortify printing the usage of link type) Replay them on link_vti6.c to bring link type help functions inline with other tunneling

[PATCH iproute2 4/9] ip/tunnel: Use print_0xhex() instead of print_string()

2018-01-12 Thread Serhey Popovych
No need for custom SPRINT_BUF() and snprintf() 0x%x value to this buffer: we can use print_0xhex() instead of print_string(). In link_iptnl.c use s2 instead of s1 buffer and remove s1. While there adjust fwmark option print order in iptnl and ip6tnl to get it match each other. Signed-off-by:

[PATCH iproute2 5/9] ip/tunnel: Use print_string() and simplify encap option printing

2018-01-12 Thread Serhey Popovych
Use print_string() instead of fputs() and fprintf() to print encapsulation for !is_json_context(). Introduce and use tnl_encap_optstr() to format encapsulation option string according to tempate and given values to avoid code duplication and simplify it. Signed-off-by: Serhey Popovych

[PATCH iproute2 8/9] vti/tunnel: Unify ikey/okey printing

2018-01-12 Thread Serhey Popovych
For vti6 tunnel we print [io]key in dotted-quad notation (ipv4 address) while in vti we do that in hex format. For vti tunnel we print [io]key only if value is not zero while for vti6 we miss such check. Unify vti and vti6 tunnel [io]key output. While here enlarge s2 buffer to the same size as

[PATCH iproute2 6/9] gre/tunnel: Print erspan_index using print_uint()

2018-01-12 Thread Serhey Popovych
One is missing in JSON output because fprintf() is used instead of print_uint(). Signed-off-by: Serhey Popovych --- ip/link_gre.c |3 ++- ip/link_gre6.c |4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/ip/link_gre.c b/ip/link_gre.c index

[PATCH iproute2 3/9] ip/tunnel: Simplify and unify tos printing

2018-01-12 Thread Serhey Popovych
For ip tunnels tos can be 0 when not configured, 1 when inherited from encapsulated packet and rest specifying diffserv (rfc2474) or tos (rfc1349) bits. It is stored in packet tos/diffserv field and returned in tos netlink attribute to userspace. Simplify and unify tos printing by using

[PATCH iproute2 1/9] iplink: Use ll_index_to_name() instead of if_indextoname()

2018-01-12 Thread Serhey Popovych
There are two reasons for switching to cached variant: 1) ll_index_to_name() may return result from cache, eliminating expensive ioctl() to the kernel. Note that most of the code already switched from plain if_indextoname() to ll_index_to_name() to cached variant in print

[PATCH iproute2 0/9] ip/tunnel: Improve tunnel parameters printing

2018-01-12 Thread Serhey Popovych
Continue improvements to tunnel modules. Final goal is to make merge IP and IPv6 variants and make that transition as transparent as possible. Everything within this series is open for your comments, suggestions and criticism. See individual patch description message for details. Thanks, Serhii

[PATCH iproute2 7/9] ip/tunnel: Minor cleanups in print routines

2018-01-12 Thread Serhey Popovych
Print "unknown" parameter for "encap" type in PRINT_FP context using "%s " format specifier and benefit from complite time string merge. Unify encapsulation type check. Signed-off-by: Serhey Popovych --- ip/link_gre.c|5 +++-- ip/link_gre6.c |8

[net-next 02/10] ixgbe: Default to 1 pool always being allocated

2018-01-12 Thread Jeff Kirsher
From: Alexander Duyck We might as well configure the limit to default to 1 pool always for the interface. This accounts for the fact that the PF counts as 1 pool if SR-IOV is enabled, and in general we are always running in 1 pool mode when RSS or DCB is enabled as

[net-next 00/10][pull request] 10GbE Intel Wired LAN Driver Updates 2018-01-12

2018-01-12 Thread Jeff Kirsher
This series contains updates to ixgbe, fm10k and net core. Alex updates the driver to remove a duplicate MAC address check and verifies that we have not run out of resources to configure a MAC rule in our filter table. Also do not assume that dev->num_tc was populated and configured with the

  1   2   3   >