Re: [PATCH] rsi: Remove stack VLA usage

2018-03-11 Thread Tobin C. Harding
On Fri, Mar 09, 2018 at 12:37:06PM +0200, Kalle Valo wrote: > "Tobin C. Harding" writes: > > > The kernel would like to have all stack VLA usage removed[1]. rsi uses > > a VLA based on 'blksize'. Elsewhere in the SDIO code maximum block size > > is defined using a magic number.

[PATCH] net: llc: drop VLA in llc_sap_mcast()

2018-03-11 Thread Salvatore Mesoraca
Avoid a VLA[1] by using a real constant expression instead of a variable. The compiler should be able to optimize the original code and avoid using an actual VLA. Anyway this change is useful because it will avoid a false positive with -Wvla, it might also help the compiler generating better code.

[PATCH 2/2] net: rds: drop VLA in rds_walk_conn_path_info()

2018-03-11 Thread Salvatore Mesoraca
Avoid VLA[1] by using an already allocated buffer passed by the caller. [1] https://lkml.org/lkml/2018/3/7/621 Signed-off-by: Salvatore Mesoraca --- net/rds/connection.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/net/rds/connection.c

Re: [RFC] netfilter: cttimeout: remove VLA in ctnl_timeout_parse_policy

2018-03-11 Thread Pablo Neira Ayuso
On Sun, Mar 11, 2018 at 05:12:09PM -0500, Gustavo A. R. Silva wrote: > Hi Pablo, > > On 03/11/2018 05:04 PM, Pablo Neira Ayuso wrote: > > On Tue, Mar 06, 2018 at 12:47:55PM -0600, Gustavo A. R. Silva wrote: > > > In preparation to enabling -Wvla, remove VLA and replace it > > > with dynamic

Re: [PATCH v2] net: netfilter: Replace printk() with appropriate pr_*() macro

2018-03-11 Thread Pablo Neira Ayuso
On Mon, Mar 12, 2018 at 03:56:15AM +0530, Arushi Singhal wrote: > On Mon, Mar 12, 2018 at 2:17 AM, Pablo Neira Ayuso > wrote: > > > Hi Joe, > > > > On Sun, Mar 11, 2018 at 12:52:41PM -0700, Joe Perches wrote: > > > On Mon, 2018-03-12 at 01:11 +0530, Arushi Singhal wrote: > >

[PATCH 0/1] net: avoid a kernel panic during sk_busy_loop

2018-03-11 Thread Josh Elsasser
Hi Dave, I stumbled across a reproducible kernel panic while playing around with busy_poll on a Linux 4.9.86 kernel. There's an unfortunate interaction between init_dummy_netdev, which doesn't bother to fill in netdev_ops, and sk_busy_loop, which assumes netdev_ops is a valid pointer. To

[PATCH v2] net: netfilter: Replace printk() with appropriate pr_*() macro

2018-03-11 Thread Arushi Singhal
Using pr_() is more concise than printk(KERN_). Replace printks having a log level with the appropriate pr_*() macros. Signed-off-by: Arushi Singhal --- changes in v2 *in v1 printk() were replaced with netdev_*() net/netfilter/nf_conntrack_acct.c | 2 +-

Re: [PATCH v2] net: netfilter: Replace printk() with appropriate pr_*() macro

2018-03-11 Thread Pablo Neira Ayuso
Hi Joe, On Sun, Mar 11, 2018 at 12:52:41PM -0700, Joe Perches wrote: > On Mon, 2018-03-12 at 01:11 +0530, Arushi Singhal wrote: > > Using pr_() is more concise than > > printk(KERN_). > > Replace printks having a log level with the appropriate > > pr_*() macros. > > > > Signed-off-by: Arushi

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

2018-03-11 Thread Tom Herbert
On Sun, Mar 11, 2018 at 2:34 PM, Eric Biggers wrote: > On Wed, Feb 14, 2018 at 02:45:05PM +0100, 'Dmitry Vyukov' via syzkaller-bugs > wrote: >> On Wed, Dec 6, 2017 at 1:50 PM, Dmitry Vyukov wrote: >> > On Fri, Oct 27, 2017 at 11:18 PM, Cong Wang

Re: [PATCH iproute2-next v4 0/4] iplink: Improve iplink_parse()

2018-03-11 Thread David Ahern
On 3/7/18 1:40 AM, Serhey Popovych wrote: > This is main routine to parse ip-link(8) configuration parameters. > > Move all code related to command line parsing and validation to it from > iptables_modify(). As benefit we reduce number of arguments as well as > checking for most of weired cases

Re: [PATCH net-next 1/3] net: ipv6: Introduce ip6_multipath_hash_policy()

2018-03-11 Thread David Ahern
On 3/11/18 12:45 AM, Ido Schimmel wrote: > From: Petr Machata > > In order to abstract away access to the > ipv6.sysctl.multipath_hash_policy variable, which is not available on > systems compiled without IPv6 support, introduce a wrapper function >

Re: [PATCH net-next 0/4] selftests: forwarding: Tweaks and a new test

2018-03-11 Thread David Miller
From: Ido Schimmel Date: Sun, 11 Mar 2018 09:57:21 +0200 > First patch adds a new test for VLAN-unaware bridges. > > Next two patches make the tests fail in case they are missing interfaces > or dependencies. > > Last patch allows one to create the veth interfaces even

Re: [PATCH net-next] modules: allow modprobe load regular elf binaries

2018-03-11 Thread Luis R. Rodriguez
Also, Alexei you never answered my questions out aliases with the umh modules. Long term this important to consider. Luis

Re: [RFC] netfilter: cttimeout: remove VLA in ctnl_timeout_parse_policy

2018-03-11 Thread Gustavo A. R. Silva
Hi Pablo, On 03/11/2018 05:04 PM, Pablo Neira Ayuso wrote: On Tue, Mar 06, 2018 at 12:47:55PM -0600, Gustavo A. R. Silva wrote: In preparation to enabling -Wvla, remove VLA and replace it with dynamic memory allocation. Looks good but... Signed-off-by: Gustavo A. R. Silva

[RESEND PATCH] rsi: Remove stack VLA usage

2018-03-11 Thread Tobin C. Harding
The kernel would like to have all stack VLA usage removed[1]. rsi uses a VLA based on 'blksize'. Elsewhere in the SDIO code maximum block size is defined using a magic number. We can use a pre-processor defined constant and declare the array to maximum size. We add a check before accessing the

Re: [RESEND PATCH] rsi: Remove stack VLA usage

2018-03-11 Thread Larry Finger
On 03/11/2018 08:43 PM, Tobin C. Harding wrote: The kernel would like to have all stack VLA usage removed[1]. rsi uses a VLA based on 'blksize'. Elsewhere in the SDIO code maximum block size is defined using a magic number. We can use a pre-processor defined constant and declare the array to

Re: [PATCH net] macvlan: filter out unsupported feature flags

2018-03-11 Thread David Miller
From: Shannon Nelson Date: Thu, 8 Mar 2018 16:17:23 -0800 > Adding a macvlan device on top of a lowerdev that supports > the xfrm offloads fails with a new regression: > # ip link add link ens1f0 mv0 type macvlan > RTNETLINK answers: Operation not permitted > >

Re: [PATCH 3/4 net-next] ibmvnic: Pad small packets to minimum MTU size

2018-03-11 Thread David Miller
From: Thomas Falcon Date: Fri, 9 Mar 2018 13:23:56 -0600 > + /* For some backing devices, mishandling of small packets > + * can result in a loss of connection or TX stall. Device > + * architects recommend that no packet should be smaller > + *

Re: [PATCH 3/3] wlcore: Use common error handling code in wl1271_acx_sta_rate_policies()

2018-03-11 Thread Arend van Spriel
On 3/10/2018 10:33 PM, SF Markus Elfring wrote: From: Markus Elfring Date: Sat, 10 Mar 2018 22:18:45 +0100 Add a jump target so that a bit of exception handling can be better reused at the end of this function. This issue was detected by using the Coccinelle

Re: [PATCH iproute2-next 0/3] ip: multicast commands JSON

2018-03-11 Thread David Ahern
On 3/8/18 7:02 PM, Stephen Hemminger wrote: > From: Stephen Hemminger > > Some more JSON support and report better error if kernel > is configured without multicast. > > Stephen Hemminger (3): > ipmaddr: json and color support > ipmroute: convert to output JSON >

[PATCH 1/1] net: check dev->reg_state before deref of napi netdev_ops

2018-03-11 Thread Josh Elsasser
init_dummy_netdev() leaves its netdev_ops pointer zeroed. This leads to a NULL pointer dereference when sk_busy_loop fires against an iwlwifi wireless adapter and checks napi->dev->netdev_ops->ndo_busy_poll. Avoid this by ensuring that napi->dev is not a dummy device before dereferencing napi

[PATCH] net/mlx4_en: Fix a memory leak in case of error in 'mlx4_en_init_netdev()'

2018-03-11 Thread Christophe JAILLET
If 'kzalloc' fails, we must free some memory before returning. Fixes: 67f8b1dcb9ee ("net/mlx4_en: Refactor the XDP forwarding rings scheme") Signed-off-by: Christophe JAILLET --- drivers/net/ethernet/mellanox/mlx4/en_netdev.c | 2 +- 1 file changed, 1

Re: [PATCH] net/9p: avoid -ERESTARTSYS leak to userspace

2018-03-11 Thread jiangyiwen
On 2018/3/10 4:41, Greg Kurz wrote: > If it was interrupted by a signal, the 9p client may need to send some > more requests to the server for cleanup before returning to userspace. > > To avoid such a last minute request to be interrupted right away, the > client memorizes if a signal is

Re: [PATCH net-next] modules: allow modprobe load regular elf binaries

2018-03-11 Thread Luis R. Rodriguez
On Sat, Mar 10, 2018 at 02:08:43PM +, Luis R. Rodriguez wrote: > The alternative to this would be a simple equivalent of > try_then_request_module() > for UMH modules: try_umhm_then_request_umh_module() or whatever. So just as I > argued earlier over UMH limitations, this is not the end of

Re: [RFC] netfilter: cttimeout: remove VLA in ctnl_timeout_parse_policy

2018-03-11 Thread Pablo Neira Ayuso
On Tue, Mar 06, 2018 at 12:47:55PM -0600, Gustavo A. R. Silva wrote: > In preparation to enabling -Wvla, remove VLA and replace it > with dynamic memory allocation. Looks good but... > Signed-off-by: Gustavo A. R. Silva > --- > net/netfilter/nfnetlink_cttimeout.c | 12

Re: [RFC] netfilter: cttimeout: remove VLA in ctnl_timeout_parse_policy

2018-03-11 Thread Gustavo A. R. Silva
On 03/11/2018 05:21 PM, Pablo Neira Ayuso wrote: On Sun, Mar 11, 2018 at 05:12:09PM -0500, Gustavo A. R. Silva wrote: Hi Pablo, On 03/11/2018 05:04 PM, Pablo Neira Ayuso wrote: On Tue, Mar 06, 2018 at 12:47:55PM -0600, Gustavo A. R. Silva wrote: In preparation to enabling -Wvla, remove VLA

Re: [PATCH v2] net: netfilter: Replace printk() with appropriate pr_*() macro

2018-03-11 Thread Joe Perches
On Mon, 2018-03-12 at 01:11 +0530, Arushi Singhal wrote: > Using pr_() is more concise than > printk(KERN_). > Replace printks having a log level with the appropriate > pr_*() macros. > > Signed-off-by: Arushi Singhal > --- > changes in v2 > *in v1 printk() were

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

2018-03-11 Thread Eric Biggers
On Wed, Feb 14, 2018 at 02:45:05PM +0100, 'Dmitry Vyukov' via syzkaller-bugs wrote: > On Wed, Dec 6, 2017 at 1:50 PM, Dmitry Vyukov wrote: > > On Fri, Oct 27, 2017 at 11:18 PM, Cong Wang > > wrote: > >> On Thu, Oct 26, 2017 at 11:00 PM, Dmitry

Re: [PATCH net-next 3/4] selftests: forwarding: Exit with error when missing interfaces

2018-03-11 Thread David Ahern
On 3/11/18 12:57 AM, Ido Schimmel wrote: > Returning 0 gives a false sense of success when the required modules did > not even manage to be initialized and register the required net devices. > > Signed-off-by: Ido Schimmel > Reviewed-by: Jiri Pirko > ---

Re: [PATCH net-next 4/4] selftests: forwarding: Allow creation of interfaces without a config file

2018-03-11 Thread David Ahern
On 3/11/18 12:57 AM, Ido Schimmel wrote: > Some users want to be able to run the tests without a configuration file > which is useful when one needs to test both virtual and physical > interfaces on the same machine. > > Move the defines that set the type of interface to create and whether to >

Re: [PATCH net-next 2/4] selftests: forwarding: Exit with error when missing dependencies

2018-03-11 Thread David Ahern
On 3/11/18 12:57 AM, Ido Schimmel wrote: > We already return an error when some dependencies (e.g., 'jq') are > missing so lets be consistent and do that for all. > > Signed-off-by: Ido Schimmel > Reviewed-by: Jiri Pirko > --- >

Re: [PATCH net-next 1/4] selftests: forwarding: Add a test for VLAN-unaware bridge

2018-03-11 Thread David Ahern
On 3/11/18 12:57 AM, Ido Schimmel wrote: > Similar to the VLAN-aware bridge test, test the VLAN-unaware bridge and > make sure that ping, FDB learning and flooding work as expected. > > Signed-off-by: Ido Schimmel > Reviewed-by: Jiri Pirko > --- >

Re: [PATCH net-next 00/12] fix some bugs for HNS3 driver

2018-03-11 Thread David Miller
From: Peng Li Date: Sat, 10 Mar 2018 11:29:21 +0800 > This patchset fixes some bugs for HNS3 driver: > [Patch 1/12 - Patch 8/12] fix various bugs for PF driver. > [Patch 9/12 - Patch 12/12] fix issues when change the us mac address of > PF/VF device to an existent one in

[PATCH 1/2] net: rds: drop VLA in rds_for_each_conn_info()

2018-03-11 Thread Salvatore Mesoraca
Avoid VLA[1] by using an already allocated buffer passed by the caller. [1] https://lkml.org/lkml/2018/3/7/621 Signed-off-by: Salvatore Mesoraca --- net/rds/connection.c | 2 +- net/rds/ib.c | 3 +++ net/rds/rds.h| 1 + 3 files changed, 5 insertions(+),

Re: [PATCH v3] kernel.h: Skip single-eval logic on literals in min()/max()

2018-03-11 Thread Tobin C. Harding
On Fri, Mar 09, 2018 at 01:10:30PM -0800, Linus Torvalds wrote: > On Fri, Mar 9, 2018 at 12:05 PM, Kees Cook wrote: > > When max() is used in stack array size calculations from literal values > > (e.g. "char foo[max(sizeof(struct1), sizeof(struct2))]", the compiler > >

Re: [PATCH net v4 0/2] rhashtable: Fix rhltable duplicates insertion

2018-03-11 Thread David Miller
From: Or Gerlitz Date: Sun, 11 Mar 2018 11:16:44 +0200 > On 3/7/2018 6:23 PM, David Miller wrote: >> From: Paul Blakey >> Date: Wed, 7 Mar 2018 16:00:11 +0200 >> >>> On our mlx5 driver fs_core.c, we use the rhltable interface to store >>> flow

Re: [PATCH net v2] openvswitch: meter: fix the incorrect calculation of max delta_t

2018-03-11 Thread David Miller
From: zhangliping Date: Fri, 9 Mar 2018 10:08:50 +0800 > From: zhangliping > > Max delat_t should be the full_bucket/rate instead of the full_bucket. > Also report EINVAL if the rate is zero. > > Fixes: 96fbc13d7e77 ("openvswitch: Add meter

Re: [PATCH bpf-next v8 01/11] fs,security: Add a security blob to nameidata

2018-03-11 Thread Mickaël Salaün
On 02/27/2018 02:23 AM, Al Viro wrote: > On Tue, Feb 27, 2018 at 12:57:21AM +, Al Viro wrote: >> On Tue, Feb 27, 2018 at 01:41:11AM +0100, Mickaël Salaün wrote: >>> The function current_nameidata_security(struct inode *) can be used to >>> retrieve a blob's pointer address tied to the inode

Re: [PATCH v2] net: netfilter: Replace printk() with appropriate pr_*() macro

2018-03-11 Thread Florian Westphal
Arushi Singhal wrote: > On Mon, Mar 12, 2018 at 2:17 AM, Pablo Neira Ayuso > wrote: > > > Hi Joe, > > > > On Sun, Mar 11, 2018 at 12:52:41PM -0700, Joe Perches wrote: > > > On Mon, 2018-03-12 at 01:11 +0530, Arushi Singhal wrote: > > > >

[PATCH v2] ss: introduce switch to print exact value of data rates

2018-03-11 Thread Tomasz Torcz
Introduce -X/--exact switch to disable human-friendly printing of datarates. With the switch, data is not presented as MBps/Kbps. Changes in v2: - change variable name into to show_human_readable

[PATCH] ss: introduce switch to print exact value of data rates

2018-03-11 Thread Tomasz Torcz
Introduce -X/--exact switch to disable human-friendly printing of datarates. With the switch, data is not presented as MBps/Kbps. Signed-off-by: Tomasz Torcz --- misc/ss.c | 12 ++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/misc/ss.c

Re: [PATCH v3] kernel.h: Skip single-eval logic on literals in min()/max()

2018-03-11 Thread Linus Torvalds
On Sun, Mar 11, 2018 at 4:05 AM, Ingo Molnar wrote: > > BTW., while I fully agree with everything you said, it's not entirely correct > to > claim that if a C compiler can generate VLA code it is necessarily able to > parse > and evaluate constant array sizes "just fine". > >

[PATCH net-next] net: phy: set link state to down when creating the phy_device

2018-03-11 Thread Heiner Kallweit
Currently the link state is initialized to "up" when the phy_device is being created. This is not consistent with the phy state being initialized to PHY_DOWN. Usually this doen't do any harm because the link state is updated once the PHY reaches state PHY_AN. However e.g. if a LAN port isn't used

[PATCH][next] lan743x: make functions lan743x_csr_read and lan743x_csr_read static

2018-03-11 Thread Colin King
From: Colin Ian King Functions lan743x_csr_read and lan743x_csr_read are local to the source and do not need to be in global scope, so make them static. Cleans up sparse warning: drivers/net/ethernet/microchip/lan743x_main.c:56:5: warning: symbol lan743x_csr_read' was

Re: [PATCH] net/mlx4_en: fix potential use-after-free with dma_unmap_page

2018-03-11 Thread Tariq Toukan
On 06/03/2018 10:16 PM, Sarah Newman wrote: On 03/06/2018 08:13 AM, Tariq Toukan wrote: I have a general question about the process. I don't totally get what branch this patch is targeted to. It touches critical areas in datapath and should go through regression tests before it is accepted

Re: [rds-devel] [PATCH][rds-next] rds: remove redundant variable 'sg_off'

2018-03-11 Thread Sowmini Varadhan
On (03/11/18 17:27), Colin King wrote: > Variable sg_off is assigned a value but it is never read, hence it is > redundant and can be removed. > Acked-by: Sowmini Varadhan

[PATCH][next] lan743x: remove some redundant variables and assignments

2018-03-11 Thread Colin King
From: Colin Ian King Function lan743x_phy_init assigns pointer 'netdev' but this is never read and hence it can be removed. The return error code handling can also be cleaned up to remove the variable 'ret'. Function lan743x_phy_link_status_change assigns pointer 'phy'

[PATCH][rds-next] rds: remove redundant variable 'sg_off'

2018-03-11 Thread Colin King
From: Colin Ian King Variable sg_off is assigned a value but it is never read, hence it is redundant and can be removed. Cleans up clang warning: net/rds/message.c:373:2: warning: Value stored to 'sg_off' is never read Signed-off-by: Colin Ian King

Re: [PATCH][rds-next] rds: make functions rds_info_from_znotifier and rds_message_zcopy_from_user static

2018-03-11 Thread Sowmini Varadhan
On (03/11/18 18:03), Colin King wrote: > From: Colin Ian King > > Functions rds_info_from_znotifier and rds_message_zcopy_from_user are > local to the source and do not need to be in global scope, so make them > static. the rds_message_zcopy_from_user warning was

Re: [PATCH v3] kernel.h: Skip single-eval logic on literals in min()/max()

2018-03-11 Thread Ingo Molnar
* Linus Torvalds wrote: > So an error message like > >warning: ISO C90 requires array sizes to be constant-expressions > > would be technically correct and useful from a portability angle. It > tells you when you're doing something non-portable, and should

[PATCH][rds-next] rds: make functions rds_info_from_znotifier and rds_message_zcopy_from_user static

2018-03-11 Thread Colin King
From: Colin Ian King Functions rds_info_from_znotifier and rds_message_zcopy_from_user are local to the source and do not need to be in global scope, so make them static. Cleans up sparse warnins: net/rds/message.c:70:27: warning: symbol 'rds_info_from_znotifier' was

question about bpf.test_progs.fail

2018-03-11 Thread lst
hi, I have a question need your help. I get failure "libbpf: incorrect bpf_call opcode" when running below two cases on v4.16-rc3: - test_l4lb_all();     const char *file2 = "./test_l4lb_noinline.o"; test_xdp_noinline(); - and from the file

Re: [pci PATCH v4 1/4] pci-iov: Add support for unmanaged SR-IOV

2018-03-11 Thread Alex Williamson
On Thu, 08 Mar 2018 11:02:29 -0800 Alexander Duyck wrote: > From: Alexander Duyck > > This patch is meant to add some basic functionality to support for SR-IOV > on devices when the VFs are not managed by some other entity in the device >

Re: [PATCH net v4 0/2] rhashtable: Fix rhltable duplicates insertion

2018-03-11 Thread Or Gerlitz
On 3/7/2018 6:23 PM, David Miller wrote: > From: Paul Blakey > Date: Wed, 7 Mar 2018 16:00:11 +0200 > >> On our mlx5 driver fs_core.c, we use the rhltable interface to store >> flow groups. We noticed that sometimes we get a warning that flow group isn't >> found at removal.