[PATCH 5/9] bpf: Add CONFIG_BUILDID_H option

2018-04-05 Thread Jiri Olsa
Adding CONFIG_BUILDID_H option that forces build to generate file with GNU build id value: include/linux/buildid.h It contains following macros: #define LINUX_BUILDID_DATA "\x6c\x41\x0f\xea\xa9\x5d ... #define LINUX_BUILDID_SIZE 20 Those macros will be used in following patches to identif

[PATCH 7/9] libbpf: Synchronize uapi bpf.h header

2018-04-05 Thread Jiri Olsa
Synchronize include/uapi/linux/bpf.h with tools version. Link: http://lkml.kernel.org/n/tip-gaja0nnet6oku657642nx...@git.kernel.org Signed-off-by: Jiri Olsa --- tools/include/uapi/linux/bpf.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/include/uapi/linux/bpf.h b/tools/include/ua

[PATCH 6/9] bpf: Add CONFIG_BPF_BUILDID_CHECK option

2018-04-05 Thread Jiri Olsa
Adding CONFIG_BPF_BUILDID_CHECK option that forces kernel to check on provided build id when loading eBPF program. If the build id does not match the one in kernel the program fails to load. Adding new field into struct bpf_attr. The kern_buildid points to the user memory that contains the buildid

[PATCH 8/9] libbpf: Add support to attach buildid to program load

2018-04-05 Thread Jiri Olsa
Adding support to retrieve buildid from elf's "buildid" section and passing it through to the load_program function to kernel bpf syscall. Fixing perf use of the bpf_load_program function and linking in the vsprintf.o into bpftool to have the scnprintf function in. Link: http://lkml.kernel.org/n/

[PATCH 9/9] perf tools: The buildid usage in example eBPF program

2018-04-05 Thread Jiri Olsa
The bpf-samples/bpf-stdout-example.c demonstrates how to put the buildid data into eBPF program. Link: http://lkml.kernel.org/n/tip-dq97ddil7h3qbvphbbo8p...@git.kernel.org Signed-off-by: Jiri Olsa --- tools/perf/bpf-samples/bpf-stdout-example.c | 42 + 1 file changed,

Re: [PATCH] net: thunderx: rework mac addresses list to u64 array

2018-04-05 Thread Christoph Hellwig
> struct xcast_addr_list { > - struct list_head list; > int count; > + u64 mc[0]; Please use the standard C99 syntax here: u64 mc[]; > + mc_list = kmalloc(sizeof(*mc_list) + > +

Re: [PATCH] net: thunderx: rework mac addresses list to u64 array

2018-04-05 Thread Vadim Lomovtsev
[correct Roberts' address] On Thu, Apr 05, 2018 at 07:57:56AM -0700, Vadim Lomovtsev wrote: > From: Vadim Lomovtsev > > It is too expensive to pass u64 values via linked list, instead > allocate array for them by overall number of mac addresses from netdev. > > This eventually removes multiple

[PATCH] net: thunderx: rework mac addresses list to u64 array

2018-04-05 Thread Vadim Lomovtsev
From: Vadim Lomovtsev It is too expensive to pass u64 values via linked list, instead allocate array for them by overall number of mac addresses from netdev. This eventually removes multiple kmalloc() calls, aviod memory fragmentation and allow to put single null check on kmalloc return value in

Re: [PATCH] net: phy: marvell: Enable interrupt function on LED2 pin

2018-04-05 Thread Andrew Lunn
> diff --git a/drivers/net/phy/marvell.c b/drivers/net/phy/marvell.c index > 0e0978d8a0eb..f03a510f1247 100644 > --- a/drivers/net/phy/marvell.c > +++ b/drivers/net/phy/marvell.c > @@ -457,6 +457,21 @@ static int marvell_of_reg_init(struct phy_device > *phydev) } #endif /* CONFIG_OF_MDIO */ >

Re: [PATCH v3 2/4] bus: fsl-mc: add restool userspace support

2018-04-05 Thread Laurentiu Tudor
Hi Andrew, On 04/05/2018 03:48 PM, Andrew Lunn wrote: >>> Hi Laurentiu >>> >>> So i can use switchdev without it? I can modprobe the switchdev >>> driver, all the physical interfaces will appear, and i can use ip addr >>> add etc. I do not need to use a user space tool at all in order to use >>> t

Re: [PATCH net-next] netns: filter uevents correctly

2018-04-05 Thread Christian Brauner
On Thu, Apr 05, 2018 at 05:26:59PM +0300, Kirill Tkhai wrote: > On 05.04.2018 17:07, Christian Brauner wrote: > > On Thu, Apr 05, 2018 at 04:01:03PM +0300, Kirill Tkhai wrote: > >> On 04.04.2018 22:48, Christian Brauner wrote: > >>> commit 07e98962fa77 ("kobject: Send hotplug events in all network

Re: [PATCH net] arp: fix arp_filter on l3slave devices

2018-04-05 Thread David Ahern
On 4/5/18 2:25 AM, Miguel Fadon Perlines wrote: > arp_filter performs an ip_route_output search for arp source address and > checks if output device is the same where the arp request was received, > if it is not, the arp request is not answered. > > This route lookup is always done on main route t

Re: [PATCH net-next] netns: filter uevents correctly

2018-04-05 Thread Kirill Tkhai
On 05.04.2018 17:07, Christian Brauner wrote: > On Thu, Apr 05, 2018 at 04:01:03PM +0300, Kirill Tkhai wrote: >> On 04.04.2018 22:48, Christian Brauner wrote: >>> commit 07e98962fa77 ("kobject: Send hotplug events in all network >>> namespaces") >>> >>> enabled sending hotplug events into all netw

Re: [PATCH v3 2/4] bus: fsl-mc: add restool userspace support

2018-04-05 Thread gregkh
On Thu, Apr 05, 2018 at 02:09:47PM +, Laurentiu Tudor wrote: > Hi Greg, > > On 04/05/2018 03:30 PM, gregkh wrote: > > On Thu, Apr 05, 2018 at 10:30:01AM +, Laurentiu Tudor wrote: > >> Hello, > >> > >> My 2c below. > >> > >> On 04/04/2018 03:42 PM, Andrew Lunn wrote: > I hear you. It

Re: [PATCH v3 2/4] bus: fsl-mc: add restool userspace support

2018-04-05 Thread Laurentiu Tudor
Hi Greg, On 04/05/2018 03:30 PM, gregkh wrote: > On Thu, Apr 05, 2018 at 10:30:01AM +, Laurentiu Tudor wrote: >> Hello, >> >> My 2c below. >> >> On 04/04/2018 03:42 PM, Andrew Lunn wrote: I hear you. It is more complicated this way...having all these individual objects vs just a sin

Re: [PATCH net-next] netns: filter uevents correctly

2018-04-05 Thread Christian Brauner
On Thu, Apr 05, 2018 at 04:01:03PM +0300, Kirill Tkhai wrote: > On 04.04.2018 22:48, Christian Brauner wrote: > > commit 07e98962fa77 ("kobject: Send hotplug events in all network > > namespaces") > > > > enabled sending hotplug events into all network namespaces back in 2010. > > Over time the s

Re: [PATCH 00/12] Ethernet: Add and use ether__addr globals

2018-04-05 Thread Felix Fietkau
On 2018-04-05 15:51, Joe Perches wrote: >> You have to factor in >> not just the .text size, but the fact that referencing an exported >> symbol needs a .reloc entry as well, which also eats up some space (at >> least when the code is being built as module). > > Thanks, the modules I built got sm

RE: [PATCH] net: phy: marvell: Enable interrupt function on LED2 pin

2018-04-05 Thread Bhadram Varka
Hi Esben, -Original Message- From: netdev-ow...@vger.kernel.org On Behalf Of Esben Haabendal Sent: Thursday, April 05, 2018 7:05 PM To: netdev@vger.kernel.org Cc: Esben Haabendal ; Rasmus Villemoes ; Andrew Lunn ; Florian Fainelli ; open list Subject: [PATCH] net: phy: marvell: Enable

Re: [PATCH 00/12] Ethernet: Add and use ether__addr globals

2018-04-05 Thread Joe Perches
On Thu, 2018-04-05 at 15:27 +0200, Felix Fietkau wrote: > On 2018-03-31 09:05, Joe Perches wrote: > > There are many local static and non-static arrays that are used for > > Ethernet broadcast address output or comparison. > > > > Centralize the array into a single separate file and remove the loc

[PATCH net 6/6] vti6: better validate user provided tunnel names

2018-04-05 Thread Eric Dumazet
Use valid_name() to make sure user does not provide illegal device name. Fixes: ed1efb2aefbb ("ipv6: Add support for IPsec virtual tunnel interfaces") Signed-off-by: Eric Dumazet Cc: Steffen Klassert --- net/ipv6/ip6_vti.c | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git

[PATCH net 4/6] ip6_gre: better validate user provided tunnel names

2018-04-05 Thread Eric Dumazet
Use dev_valid_name() to make sure user does not provide illegal device name. syzbot caught the following bug : BUG: KASAN: stack-out-of-bounds in strlcpy include/linux/string.h:300 [inline] BUG: KASAN: stack-out-of-bounds in ip6gre_tunnel_locate+0x334/0x860 net/ipv6/ip6_gre.c:339 Write of size 2

[PATCH net 5/6] ip6_tunnel: better validate user provided tunnel names

2018-04-05 Thread Eric Dumazet
Use valid_name() to make sure user does not provide illegal device name. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Signed-off-by: Eric Dumazet --- net/ipv6/ip6_tunnel.c | 11 +++ 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/net/ipv6/ip6_tunnel.c b/net/ipv6/ip6_tunnel.c in

[PATCH net 2/6] ip_tunnel: better validate user provided tunnel names

2018-04-05 Thread Eric Dumazet
Use dev_valid_name() to make sure user does not provide illegal device name. syzbot caught the following bug : BUG: KASAN: stack-out-of-bounds in strlcpy include/linux/string.h:300 [inline] BUG: KASAN: stack-out-of-bounds in __ip_tunnel_create+0xca/0x6b0 net/ipv4/ip_tunnel.c:257 Write of size 20

[PATCH net 3/6] ipv6: sit: better validate user provided tunnel names

2018-04-05 Thread Eric Dumazet
Use dev_valid_name() to make sure user does not provide illegal device name. syzbot caught the following bug : BUG: KASAN: stack-out-of-bounds in strlcpy include/linux/string.h:300 [inline] BUG: KASAN: stack-out-of-bounds in ipip6_tunnel_locate+0x63b/0xaa0 net/ipv6/sit.c:254 Write of size 33 at

[PATCH net 0/6] net: better validate user provided tunnel names

2018-04-05 Thread Eric Dumazet
This series changes dev_valid_name() to not attempt reading a possibly too long user-provided device name, then use this helper in five different tunnel providers. Eric Dumazet (6): net: fool proof dev_valid_name() ip_tunnel: better validate user provided tunnel names ipv6: sit: better valid

[PATCH net 1/6] net: fool proof dev_valid_name()

2018-04-05 Thread Eric Dumazet
We want to use dev_valid_name() to validate tunnel names, so better use strnlen(name, IFNAMSIZ) than strlen(name) to make sure to not upset KASAN. Signed-off-by: Eric Dumazet --- net/core/dev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/core/dev.c b/net/core/dev.c in

[PATCH] net: phy: marvell: Enable interrupt function on LED2 pin

2018-04-05 Thread Esben Haabendal
From: Esben Haabendal The LED2[2]/INTn pin on Marvell 88E1318S as well as 88E1510/12/14/18 needs to be configured to be usable as interrupt not only when WOL is enabled, but whenever we rely on interrupts from the PHY. Signed-off-by: Esben Haabendal Cc: Rasmus Villemoes --- drivers/net/phy/ma

Re: [PATCH 00/12] Ethernet: Add and use ether__addr globals

2018-04-05 Thread Felix Fietkau
On 2018-03-31 09:05, Joe Perches wrote: > There are many local static and non-static arrays that are used for > Ethernet broadcast address output or comparison. > > Centralize the array into a single separate file and remove the local > arrays. I suspect that for many targets and configurations, t

net_dim() may use uninitialized data

2018-04-05 Thread Geert Uytterhoeven
Hi Tal, With gcc-4.1.2: drivers/net/ethernet/broadcom/bcmsysport.c: In function ‘bcm_sysport_poll’: include/linux/net_dim.h:354: warning: ‘curr_stats.ppms’ may be used uninitialized in this function include/linux/net_dim.h:354: warning: ‘curr_stats.bpms’ may be used uninitialized in t

Re: [PATCH net-next v2 2/2] dt: bindings: add new dt entries for brcmfmac

2018-04-05 Thread Kalle Valo
Ulf Hansson writes: > On 20 March 2018 at 10:55, Kalle Valo wrote: >> Arend van Spriel writes: >> > If I get it right, you mean something like this: > > mmc3: mmc@1c12000 { > ... > broken-sg-support; > sd-head-align = 4; > sd-sgentry-align

Re: [PATCH net-next] netns: filter uevents correctly

2018-04-05 Thread Kirill Tkhai
On 04.04.2018 22:48, Christian Brauner wrote: > commit 07e98962fa77 ("kobject: Send hotplug events in all network namespaces") > > enabled sending hotplug events into all network namespaces back in 2010. > Over time the set of uevents that get sent into all network namespaces has > shrunk. We have

Re: [PATCH v3 2/4] bus: fsl-mc: add restool userspace support

2018-04-05 Thread Andrew Lunn
> > Hi Laurentiu > > > > So i can use switchdev without it? I can modprobe the switchdev > > driver, all the physical interfaces will appear, and i can use ip addr > > add etc. I do not need to use a user space tool at all in order to use > > the network functionality? > > Absolutely! Great. The

Re: [PATCH 06/12] wireless: Convert simple uses of a static const Ethernet broadcast address

2018-04-05 Thread Kalle Valo
Kalle Valo writes: > Joe Perches writes: > >> Use the new ether_broadcast_addr global instead to save some object code. >> >> Signed-off-by: Joe Perches >> --- >> drivers/net/wireless/admtek/adm8211.c | 3 +-- >> drivers/net/wireless/ath/carl9170/mac.c | 4 +--- >> drivers/ne

Re: [PATCH 06/12] wireless: Convert simple uses of a static const Ethernet broadcast address

2018-04-05 Thread Kalle Valo
Joe Perches writes: > Use the new ether_broadcast_addr global instead to save some object code. > > Signed-off-by: Joe Perches > --- > drivers/net/wireless/admtek/adm8211.c | 3 +-- > drivers/net/wireless/ath/carl9170/mac.c | 4 +--- > drivers/net/wireless/broadcom/b43/main.c

Re: [v2] net: thunderx: nicvf_main: Fix potential NULL pointer dereferences

2018-04-05 Thread Vadim Lomovtsev
Hi guys, Please give me couple days to workout solution for this. I'll post patch for this as soon as I done with my testing. WBR, Vadim On Tue, Apr 03, 2018 at 05:04:23PM -0500, Gustavo A. R. Silva wrote: > Add null check on kmalloc() return value in order to prevent > a null pointer dereferenc

Re: [PATCH ethtool] ethtool: Add register dump support for MICROCHIP LAN78xx

2018-04-05 Thread Andrew Lunn
On Thu, Apr 05, 2018 at 11:41:28AM +0530, Raghuram Chary J wrote: Hi Raghuram > + fprintf(stdout, "PHY Registers:\n"); > + fprintf(stdout, "--\n"); > + fprintf(stdout, "Mode Control = 0x%04X\n", *lan78xx_reg++); > + fprintf(stdout, "Mode Status = 0x%04X\n", *lan78xx_re

Re: [PATCH v3 2/4] bus: fsl-mc: add restool userspace support

2018-04-05 Thread gregkh
On Thu, Apr 05, 2018 at 10:30:01AM +, Laurentiu Tudor wrote: > Hello, > > My 2c below. > > On 04/04/2018 03:42 PM, Andrew Lunn wrote: > >> I hear you. It is more complicated this way...having all these individual > >> objects vs just a single "bundle" of them that represents a NIC. But, >

Re: marvell switch

2018-04-05 Thread Andrew Lunn
On Thu, Apr 05, 2018 at 05:47:24AM +0300, Ran Shalit wrote: > Hello, > > I am trying to use marvell switch in linux, > Is it that the kernel drivers from marvell switch are used just to > enable all ports, or do they also provide APIs to userspace to enable > specific ports only. > I have not find

Re: [PATCH v3 2/4] bus: fsl-mc: add restool userspace support

2018-04-05 Thread Laurentiu Tudor
On 04/05/2018 02:47 PM, Andrew Lunn wrote: > On Thu, Apr 05, 2018 at 10:30:01AM +, Laurentiu Tudor wrote: >> Hello, >> >> My 2c below. >> >> On 04/04/2018 03:42 PM, Andrew Lunn wrote: I hear you. It is more complicated this way...having all these individual objects vs just a single

Re: [PATCH v3 2/4] bus: fsl-mc: add restool userspace support

2018-04-05 Thread Andrew Lunn
On Thu, Apr 05, 2018 at 10:30:01AM +, Laurentiu Tudor wrote: > Hello, > > My 2c below. > > On 04/04/2018 03:42 PM, Andrew Lunn wrote: > >> I hear you. It is more complicated this way...having all these individual > >> objects vs just a single "bundle" of them that represents a NIC. But, >

[PATCH 1/2] net: phy: Helper function for reading strapped configuration values

2018-04-05 Thread esben . haabendal
From: Esben Haabendal Add a function for use in PHY driver probe functions, reading current autoneg, speed and duplex configuration from BMCR register. Useful for PHY that supports hardware strapped configuration, enabling Linux to respect that configuration (i.e. strapped non-autoneg configurat

[PATCH 2/2] net: phy: dp83640: Read strapped configuration settings

2018-04-05 Thread esben . haabendal
From: Esben Haabendal Read configration settings, to allow automatic forced speed/duplex setup by hardware strapping. Signed-off-by: Esben Haabendal Cc: Rasmus Villemoes --- drivers/net/phy/dp83640.c | 5 + 1 file changed, 5 insertions(+) diff --git a/drivers/net/phy/dp83640.c b/drivers/

[RFC] ethtool: Support for driver private ioctl's

2018-04-05 Thread Jose Abreu
Hi All, I would like to know your opinion regarding adding support for driver private ioctl's in ethtool. Background: Synopsys Ethernet IP's have a certain number of features which can be reconfigured at runtime. Giving you two examples: One of the most recent one is the safety features, which ca

Re: [iovisor-dev] Best userspace programming API for XDP features query to kernel?

2018-04-05 Thread Daniel Borkmann
On 04/04/2018 02:28 PM, Jesper Dangaard Brouer via iovisor-dev wrote: > Hi Suricata people, > > When Eric Leblond (and I helped) integrated XDP in Suricata, we ran > into the issue, that at Suricata load/start time, we cannot determine > if the chosen XDP config options, like xdp-cpu-redirect[1],

Re: [PATCH v3 2/4] bus: fsl-mc: add restool userspace support

2018-04-05 Thread Laurentiu Tudor
Hello, My 2c below. On 04/04/2018 03:42 PM, Andrew Lunn wrote: >> I hear you. It is more complicated this way...having all these individual >> objects vs just a single "bundle" of them that represents a NIC. But, that's >> the way the DPAA2 hardware is, and we're implementing kernel support for

[PATCH net] net: mvpp2: Fix parser entry init boundary check

2018-04-05 Thread Maxime Chevallier
Boundary check in mvpp2_prs_init_from_hw must be done according to the passed "tid" parameter, not the mvpp2_prs_entry index, which is not yet initialized at the time of the check. Fixes: 47e0e14eb1a6 ("net: mvpp2: Make mvpp2_prs_hw_read a parser entry init function") Signed-off-by: Maxime Cheval

Re: [PATCH v2] Bluetooth: Remove VLA usage in aes_cmac

2018-04-05 Thread Gustavo A. R. Silva
On 04/05/2018 03:46 AM, Marcel Holtmann wrote: By the way, what is you opinion on replacing crypto_shash_descsize(ctx) with PAGE_SIZE / 8 in SHASH_DESC_ON_STACK? Does it work for you? isn’t that just waste? Agree. The macro itself is this. #define SHASH_DESC_ON_STACK(shash, ctx)

Re: [PATCH v2] Bluetooth: Remove VLA usage in aes_cmac

2018-04-05 Thread Gustavo A. R. Silva
Hi Marcel, On 04/05/2018 02:23 AM, Marcel Holtmann wrote: so I took this patch back out of bluetooth-next before sending the pull request. I think the discussion on how to fix SHASH_DESC_ON_STACK macro needs to complete first. Once that has concluded we can revisit if this patch is still nee

Re: [PATCH v2 bpf-next 0/3] bpf/verifier: subprog/func_call simplifications

2018-04-05 Thread Edward Cree
On 05/04/18 06:28, Alexei Starovoitov wrote: > On Thu, Apr 05, 2018 at 12:58:46AM +0100, Edward Cree wrote: >> On 04/04/18 00:37, Alexei Starovoitov wrote: >>> hmm. that doesn't fail for me and any other bots didn't complain. >>> Are you sure you're running the latest kernel and tests? >> Ah, test_

Re: [PATCH v2] Bluetooth: Remove VLA usage in aes_cmac

2018-04-05 Thread Marcel Holtmann
Hi Gustavo, >> so I took this patch back out of bluetooth-next before sending the pull >> request. I think the discussion on how to fix SHASH_DESC_ON_STACK macro >> needs to complete first. Once that has concluded we can revisit if this >> patch is still needed or if another solution has been f

[PATCH net] arp: fix arp_filter on l3slave devices

2018-04-05 Thread Miguel Fadon Perlines
arp_filter performs an ip_route_output search for arp source address and checks if output device is the same where the arp request was received, if it is not, the arp request is not answered. This route lookup is always done on main route table so l3slave devices never find the proper route and ar

Re: [PATCH v2] Bluetooth: Remove VLA usage in aes_cmac

2018-04-05 Thread Marcel Holtmann
Hi Gustavo, > In preparation to enabling -Wvla, remove VLA and replace it > with dynamic memory allocation instead. > > The use of stack Variable Length Arrays needs to be avoided, as they > can be a vector for stack exhaustion, which can be both a runtime bug > or a security flaw. Also, in gener

<    1   2