Re: KASAN: use-after-free Read in sctp_association_free (2)

2018-03-09 Thread Xin Long
On Sat, Mar 10, 2018 at 6:08 AM, Neil Horman wrote: > On Fri, Mar 09, 2018 at 12:59:06PM -0800, syzbot wrote: >> Hello, >> >> syzbot hit the following crash on net-next commit >> fd372a7a9e5e9d8011a0222d10edd3523abcd3b1 (Thu Mar 8 19:43:48 2018 +) >> Merge tag 'mlx5-updates-2018-02-28-2' of >>

[PATCH v2] net: ipv6: xfrm6_state: remove VLA usage

2018-03-09 Thread Andreas Christoforou
The kernel would like to have all stack VLA usage removed[1]. Instead of dynamic allocation, just use XFRM_MAX_DEPTH as already done for the "class" array, but as per feedback, I will not drop maxclass because that changes the behavior. In one case, it'll do this loop up to 5, the other caller up t

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

2018-03-09 Thread Miguel Ojeda
On Sat, Mar 10, 2018 at 7:10 AM, Miguel Ojeda wrote: > On Sat, Mar 10, 2018 at 4:11 AM, Randy Dunlap wrote: >> On 03/09/2018 04:07 PM, Andrew Morton wrote: >>> On Fri, 9 Mar 2018 12:05:36 -0800 Kees Cook wrote: >>> When max() is used in stack array size calculations from literal values

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

2018-03-09 Thread Miguel Ojeda
On Sat, Mar 10, 2018 at 4:11 AM, Randy Dunlap wrote: > On 03/09/2018 04:07 PM, Andrew Morton wrote: >> On Fri, 9 Mar 2018 12:05:36 -0800 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

RE: [PATCH 2/2] e1000e: Fix link check race condition

2018-03-09 Thread Brown, Aaron F
> From: netdev-ow...@vger.kernel.org [mailto:netdev- > ow...@vger.kernel.org] On Behalf Of Benjamin Poirier > Sent: Monday, March 5, 2018 5:56 PM > To: Kirsher, Jeffrey T > Cc: Alexander Duyck ; Lennart Sorensen > ; intel-wired-...@lists.osuosl.org; > netdev@vger.kernel.org; linux-ker...@vger.kern

RE: [Intel-wired-lan] [PATCH 1/2] Revert "e1000e: Separate signaling for link check/link up"

2018-03-09 Thread Brown, Aaron F
> From: Intel-wired-lan [mailto:intel-wired-lan-boun...@osuosl.org] On > Behalf Of Benjamin Poirier > Sent: Monday, March 5, 2018 5:56 PM > To: Kirsher, Jeffrey T > Cc: netdev@vger.kernel.org; intel-wired-...@lists.osuosl.org; linux- > ker...@vger.kernel.org; Lennart Sorensen > Subject: [Intel-wi

[PATCH net 2/8] bnxt_en: Fix vnic accounting in the bnxt_check_rings() path.

2018-03-09 Thread Michael Chan
From: Eddie Wai The number of vnics to check must be determined ahead of time because only standard RX rings require vnics to support RFS. The logic is similar to the ring reservation logic and we can now use the refactored common functions to do most of the work in setting up the firmware messa

[PATCH net 4/8] bnxt_en: Pass complete VLAN TCI to the stack.

2018-03-09 Thread Michael Chan
When receiving a packet with VLAN tag, pass the entire 16-bit TCI to the stack when calling __vlan_hwaccel_put_tag(). The current code is only passing the 12-bit tag and it is missing the priority bits. Signed-off-by: Michael Chan --- drivers/net/ethernet/broadcom/bnxt/bnxt.c | 4 ++-- drivers/

[PATCH net 6/8] bnxt_en: Return standard Linux error codes for hwrm flow cmds.

2018-03-09 Thread Michael Chan
From: Venkat Duvvuru Currently, internal error value is returned by the driver, when hwrm_cfa_flow_alloc() fails due lack of resources. We should be returning Linux errno value -ENOSPC instead. This patch also converts other similar command errors to standard Linux errno code (-EIO) in bnxt_tc.

[PATCH net 3/8] bnxt_en: Remove unwanted ovs-offload messages in some conditions

2018-03-09 Thread Michael Chan
From: Sriharsha Basavapatna In some conditions when the driver fails to add a flow in HW and returns an error back to the stack, the stack continues to invoke get_flow_stats() and/or del_flow() on it. The driver fails these APIs with an error message "no flow_node for cookie". The message gets lo

[PATCH net 1/8] bnxt_en: Refactor the functions to reserve hardware rings.

2018-03-09 Thread Michael Chan
The bnxt_hwrm_reserve_{pf|vf}_rings() functions are very similar to the bnxt_hwrm_check_{pf|vf}_rings() functions. Refactor the former so that the latter can make use of common code in the next patch. Signed-off-by: Michael Chan --- drivers/net/ethernet/broadcom/bnxt/bnxt.c | 85 +++

[PATCH net 0/8] bnxt_en: Bug fixes.

2018-03-09 Thread Michael Chan
There are 3 bug fixes in this series to fix regressions recently introduced when adding the new ring reservations scheme. 2 minor fixes in the TC Flower code to return standard errno values and to elide some unnecessary warning dmesg. One Fixes the VLAN TCI value passed to the stack by including

[PATCH net 5/8] bnxt_en: Fix regressions when setting up MQPRIO TX rings.

2018-03-09 Thread Michael Chan
Recent changes added the bnxt_init_int_mode() call in the driver's open path whenever ring reservations are changed. This call was previously only called in the probe path. In the open path, if MQPRIO TC has been setup, the bnxt_init_int_mode() call would reset and mess up the MQPRIO per TC rings

[PATCH net 7/8] bnxt_en: close & open NIC, only when the interface is in running state.

2018-03-09 Thread Michael Chan
From: Venkat Duvvuru bnxt_restore_pf_fw_resources routine frees PF resources by calling close_nic and allocates the resources back, by doing open_nic. However, this is not needed, if the PF is already in closed state. This bug causes the driver to call open the device and call request_irq() when

[PATCH net 8/8] bnxt_en: Check valid VNIC ID in bnxt_hwrm_vnic_set_tpa().

2018-03-09 Thread Michael Chan
During initialization, if we encounter errors, there is a code path that calls bnxt_hwrm_vnic_set_tpa() with invalid VNIC ID. This may cause a warning in firmware logs. Fixes: c0c050c58d84 ("bnxt_en: New Broadcom ethernet driver.") Signed-off-by: Michael Chan --- drivers/net/ethernet/broadcom/b

[RFC PATCH net-next 5/5] bridge: verify "HW only" flags can't be set without HW support

2018-03-09 Thread Igor Mitsyanko
Setting bridge flag BR_FLOOD_OFFLOAD only makes sense if underlying port hardware advertises support for it. Make sure kernel checks that condition before allowing to update the flag value. Signed-off-by: Igor Mitsyanko --- net/bridge/br_private.h | 5 - 1 file changed, 4 insertions(+), 1 de

[PATCH net-next 1/5] bridge: initialize port flags with switchdev defaults

2018-03-09 Thread Igor Mitsyanko
Default bridge port flags for switchdev devices can be different from what is used in bridging core. Get default value from switchdev itself on port initialization. Signed-off-by: Igor Mitsyanko --- net/bridge/br_if.c | 17 - 1 file changed, 16 insertions(+), 1 deletion(-) diff

[RFC PATCH net-next 4/5] bridge: provide sysfs and netlink interface to set BR_FLOOD_OFFLOAD

2018-03-09 Thread Igor Mitsyanko
Allow to modify BR_FLOOD_OFFLOAD flag value through both sysfs and netlink interface. Signed-off-by: Igor Mitsyanko --- include/uapi/linux/if_link.h | 1 + net/bridge/br_netlink.c | 8 +++- net/bridge/br_sysfs_if.c | 2 ++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git

[RFC PATCH net-next 3/5] bridge: allow switchdev port to handle flooding by itself

2018-03-09 Thread Igor Mitsyanko
Introduce BR_FLOOD_OFFLOAD bridge port flag that can be used by switchdev-capable hardware to advertize that it wants to handle all flooding by itself. In that case there is no need for a driver to set skb::offload_fwd_mark on each offloaded packet as it is implied by BR_FLOOD_OFFLOAD bridge port f

[PATCH net-next 2/5] bridge: propagate BR_ flags updates through sysfs to switchdev

2018-03-09 Thread Igor Mitsyanko
sysfs interface to configure bridge flags only updates SW copy but does not notify hardware through switchdev interface. Make sure it is. Signed-off-by: Igor Mitsyanko --- net/bridge/br_sysfs_if.c | 15 +++ 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/net/bridge/br_

[PATCH net-next 0/5] Switchdev: flooding offload option

2018-03-09 Thread Igor Mitsyanko
Main goal of the patchset is to allow for flooding offload to switchdev in scenarios when HW switchdev ports and SW ports are operating in a single bridge. In case a data frame that needs to be flooded is ingressed on a SW port, it needs to be flooded to a single HW port of any given switc

Re: [PATCH 3/3] tracing: Rewrite filter logic to be simpler and faster

2018-03-09 Thread Steven Rostedt
On Fri, 9 Mar 2018 22:15:23 -0500 Steven Rostedt wrote: > Sorry for the spam. A little more spam ;-) I know what happened, as I'm able to recreate it. For those that use claws-mail, be careful. I clicked on the email I wanted to reply to. Then I must have hit the down arrow key, as it moved th

Re: [PATCH 3/3] tracing: Rewrite filter logic to be simpler and faster

2018-03-09 Thread Steven Rostedt
I don't know what the hell happened, but claws mail just inserted a ton of people into the Cc (I didn't add you). I noticed it just after I hit send. The added Cc looks like it came from the email right after the email I was replying to "Subject: Re: [PATCH v3] kernel.h: Skip single-eval logic on

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

2018-03-09 Thread Randy Dunlap
On 03/09/2018 04:07 PM, Andrew Morton wrote: > On Fri, 9 Mar 2018 12:05:36 -0800 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 >> thinks this is a dynamic calculation due to th

Re: [PATCH 3/3] tracing: Rewrite filter logic to be simpler and faster

2018-03-09 Thread Steven Rostedt
On Fri, 09 Mar 2018 21:34:45 -0500 Steven Rostedt wrote: > 2 files changed, 1050 insertions(+), 1273 deletions(-) BTW, it's a bit bigger impact than 223 deletions. As I added a lot of comments to explain the logic better. Removing comments and white space from the modifications we have: 649 i

[PATCH net-next 01/12] net: hns3: add existence check when remove old uc mac address

2018-03-09 Thread Peng Li
From: Fuyun Liang When driver is in initial state, the mac_vlan table table is empty. So the delete operation for mac address must fail. Existence check is needed here. Otherwise, the error message will make user confused. Fixes: 46a3df9f9718 ("net: hns3: Add HNS3 Acceleration Engine & Compatibi

[PATCH net-next 02/12] net: hns3: fix for netdev not running problem after calling net_stop and net_open

2018-03-09 Thread Peng Li
From: Fuyun Liang The link status update function is called by timer every second. But net_stop and net_open may be called with very short intervals. The link status update function can not detect the link state has changed. It causes the netdev not running problem. This patch fixes it by updati

[PATCH net-next 04/12] net: hns3: unify the pause params setup function

2018-03-09 Thread Peng Li
From: Fuyun Liang Since the firmware cmd to setup mac pause params is the same as the firmware cmd to pfc pause params, this patch unifies the pause params setup function. Signed-off-by: Fuyun Liang Signed-off-by: Peng Li --- .../ethernet/hisilicon/hns3/hns3pf/hclge_main.c| 2 +- .../net

[PATCH net-next 07/12] net: hns3: fix for loopback failure when vlan filter is enable

2018-03-09 Thread Peng Li
From: Yunsheng Lin When vlan ctag filter is enabled, the loopback selftest fails because loopback selftest does not support vlan. This patch fixes it by disabling the vlan ctag filter when runnig loopback selftest. Signed-off-by: Yunsheng Lin Signed-off-by: Peng Li --- drivers/net/ethernet/h

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

2018-03-09 Thread Peng Li
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 the mac_vlan table. Fuyun Liang (4): net: hns3: add existence check when remove old

[PATCH net-next 03/12] net: hns3: fix for ipv6 address loss problem after setting channels

2018-03-09 Thread Peng Li
From: Fuyun Liang The function of dev_close and dev_open is just likes ifconfig down and ifconfig up. The ipv6 address will be lost after dev_close and dev_open are called. This patch uses hns3_nic_net_stop to replace dev_close and uses hns3_nic_net_open to replace dev_open. Signed-off-by: Fuy

[PATCH net-next 06/12] net: hns3: add support for querying pfc puase packets statistic

2018-03-09 Thread Peng Li
This patch add support for querying pfc puase packets statistic in hclge_ieee_getpfc, which is used to tell user how many pfc puase packets have been sent and received by this mac port. Signed-off-by: Yunsheng Lin Signed-off-by: Peng Li --- .../net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c | 1

[PATCH net-next 10/12] net: hns3: fix return value error of hclge_get_mac_vlan_cmd_status()

2018-03-09 Thread Peng Li
From: Jian Shen Error code -EIO was used to indicate mutilple errors in function hclge_get_mac_vlan_cmd_status().This patch fixes it by using error code depending on the error type. For no space error, return -ENOSPC. For entry not found, return -ENOENT. For command send fail, return -EIO. For i

[PATCH net-next 12/12] net: hns3: add result checking for VF when modify unicast mac address

2018-03-09 Thread Peng Li
From: Jian Shen VF changes unicast mac address by sending mailbox msg to PF, then PF completes the mac address modification. It may fail when the target uc mac address is already in the mac_vlan table. VF should be aware of it by reading the message result. Signed-off-by: Jian Shen Signed-off-b

[PATCH net-next 09/12] net: hns3: fix error type definition of return value

2018-03-09 Thread Peng Li
From: Jian Shen An enum type variable was used to store an "int" type return value. This patch fixes it. Fixes: 46a3df9f9718 ("net: hns3: Add HNS3 Acceleration Engine & Compatibility Layer Support") Signed-off-by: Jian Shen Signed-off-by: Peng Li --- drivers/net/ethernet/hisilicon/hns3/hns3p

[PATCH net-next 08/12] net: hns3: fix for buffer overflow smatch warning

2018-03-09 Thread Peng Li
From: Yunsheng Lin This patch fixes the buffer overflow warning by refactoring hclgevf_bind_ring_to_vector and hclge_get_ring_chain_from_mbx. Fixes: e2cb1dec9779 ("net: hns3: Add HNS3 VF HCL(Hardware Compatibility Layer) Support") Fixes: dde1a86e93ca ("net: hns3: Add mailbox support to PF drive

[PATCH net-next 11/12] net: hns3: add existence checking before adding unicast mac address

2018-03-09 Thread Peng Li
From: Jian Shen It's not allowed to add two same unicast mac address entries to the mac_vlan table. When modify the uc mac address of a VF device to the same value with the PF device's, the PF device will lose its entry of the mac_vlan table. Lookup the mac address in the mac_vlan table, and add

[PATCH net-next 05/12] net: hns3: fix rx path skb->truesize reporting bug

2018-03-09 Thread Peng Li
Original skb->truesize reports the received packet size, not the actual buffer size NIC driver allocated(1 Page). The linux net protocol will misjudge the true size of rx queue. Signed-off-by: Peng Li --- drivers/net/ethernet/hisilicon/hns3/hns3_enet.c | 10 -- 1 file changed, 4 insertio

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

2018-03-09 Thread Linus Torvalds
On Fri, Mar 9, 2018 at 5:31 PM, Kees Cook wrote: > > WTF, gmail just blasted HTML into my explicitly plain-text email?! > Apologies... There's more now in your email, I think maybe it's triggered by your signature file and some gmail web interface bug. Or it just tries to force quote using html.

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

2018-03-09 Thread Alexei Starovoitov
On 3/9/18 11:38 AM, Linus Torvalds wrote: On Fri, Mar 9, 2018 at 11:12 AM, Linus Torvalds wrote: How are you going to handle five processes doing the same setup concurrently? Side note: it's not just serialization. It's also "is it actually up and running". The rule for "request_module()" (

Re: [PATCH 12/15] ice: Add stats and ethtool support

2018-03-09 Thread David Miller
From: Jakub Kicinski Date: Fri, 9 Mar 2018 15:14:28 -0800 > On Fri, 9 Mar 2018 09:21:33 -0800, Anirudh Venkataramanan wrote: >> +static const struct ice_stats ice_net_stats[] = { >> +ICE_NETDEV_STAT(rx_packets), >> +ICE_NETDEV_STAT(tx_packets), >> +ICE_NETDEV_STAT(rx_bytes), >> +

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

2018-03-09 Thread Alexei Starovoitov
On 3/9/18 11:37 AM, Andy Lutomirski wrote: On Fri, Mar 9, 2018 at 6:55 PM, David Miller wrote: From: Alexei Starovoitov Date: Fri, 9 Mar 2018 10:50:49 -0800 On 3/9/18 10:23 AM, Andy Lutomirski wrote: It might not be totally crazy to back it by tmpfs. interesting. how do you propose to do

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

2018-03-09 Thread Kees Cook
On Fri, Mar 9, 2018 at 5:30 PM, Kees Cook wrote: > -- > Kees Cook > Pixel SecurityOn > [...] WTF, gmail just blasted HTML into my explicitly plain-text email?! Apologies... -- Kees Cook Pixel SecurityOn Fri, Mar 9, 2018 at 5:30 PM, Kees Cook keesc

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

2018-03-09 Thread Kees Cook
On Fri, Mar 9, 2018 at 4:38 PM, Linus Torvalds wrote: > On Fri, Mar 9, 2018 at 4:32 PM, Andrew Morton > wrote: >> >> I wonder which gcc versions actually accept Kees's addition. Ah, my old nemesis, gcc 4.4.4. *sob* > Note that we already do have this pattern, as seen by: > > git grep -2 __b

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

2018-03-09 Thread Linus Torvalds
On Fri, Mar 9, 2018 at 4:32 PM, Andrew Morton wrote: > > I wonder which gcc versions actually accept Kees's addition. Note that we already do have this pattern, as seen by: git grep -2 __builtin_choose_expr | grep -2 __builtin_constant_p which show drivers/pinctrl/intel/pinctrl-intel.h, so t

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

2018-03-09 Thread Andrew Morton
On Fri, 9 Mar 2018 16:28:51 -0800 Linus Torvalds wrote: > On Fri, Mar 9, 2018 at 4:07 PM, Andrew Morton > wrote: > > > > A brief poke failed to reveal a workaround - gcc-4.4.4 doesn't appear > > to know that __builtin_constant_p(x) is a constant. Or something. > > LOL. > > I suspect it migh

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

2018-03-09 Thread Linus Torvalds
On Fri, Mar 9, 2018 at 4:07 PM, Andrew Morton wrote: > > A brief poke failed to reveal a workaround - gcc-4.4.4 doesn't appear > to know that __builtin_constant_p(x) is a constant. Or something. LOL. I suspect it might be that it wants to evaluate __builtin_choose_expr() at an earlier stage tha

ip6tables - last base chain position %u doesn't match underflow %u (hook %u

2018-03-09 Thread valdis . kletnieks
Am hitting an issue with this commit: commit 0d7df906a0e78079a02108b06d32c3ef2238ad25 Author: Florian Westphal Date: Tue Feb 27 19:42:37 2018 +0100 netfilter: x_tables: ensure last rule in base chain matches underflow/policy This trips on my system: [ 64.402790] ip6_tables: last ba

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

2018-03-09 Thread Andrew Morton
On Fri, 9 Mar 2018 12:05:36 -0800 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 > thinks this is a dynamic calculation due to the single-eval logic, which > is not needed in the li

Re: WARNING in __proc_create

2018-03-09 Thread Eric Dumazet
On 03/09/2018 03:32 PM, Cong Wang wrote: On Fri, Mar 9, 2018 at 3:21 PM, Eric Dumazet wrote: On 03/09/2018 03:05 PM, Cong Wang wrote: BTW, the warning itself is all about empty names, so perhaps it's better to fix them separately. Huh ? You want more syzbot reports ? I do not. I alw

Re: [PATCH v3 1/2] bpf: extend stackmap to save binary_build_id+offset instead of address

2018-03-09 Thread Daniel Borkmann
On 03/10/2018 12:34 AM, Song Liu wrote: [...] > Thanks Daniel! I will fix these. > > I also chatted with Teng about this, that we may miss some cases. I will > also include that fix in the next version. Okay, thanks Song!

Re: [PATCH v3 1/2] bpf: extend stackmap to save binary_build_id+offset instead of address

2018-03-09 Thread Song Liu
> On Mar 9, 2018, at 3:25 PM, Daniel Borkmann wrote: > > Hi Song, > > On 03/06/2018 08:42 PM, Song Liu wrote: > [...]> +/* >> + * Parse build id from the note segment. This logic can be shared between >> + * 32-bit and 64-bit system, because Elf32_Nhdr and Elf64_Nhdr are >> + * identical. >> +

Re: WARNING in __proc_create

2018-03-09 Thread Cong Wang
On Fri, Mar 9, 2018 at 3:21 PM, Eric Dumazet wrote: > > > On 03/09/2018 03:05 PM, Cong Wang wrote: >> >> >> BTW, the warning itself is all about empty names, so perhaps >> it's better to fix them separately. > > > Huh ? You want more syzbot reports ? I do not. I always prefer one patch to fix one

Re: [PATCH v3 1/2] bpf: extend stackmap to save binary_build_id+offset instead of address

2018-03-09 Thread Daniel Borkmann
Hi Song, On 03/06/2018 08:42 PM, Song Liu wrote: [...]> +/* > + * Parse build id from the note segment. This logic can be shared between > + * 32-bit and 64-bit system, because Elf32_Nhdr and Elf64_Nhdr are > + * identical. > + */ > +static inline int stack_map_parse_build_id(void *vm_start, > +

Re: WARNING in __proc_create

2018-03-09 Thread Eric Dumazet
On 03/09/2018 03:05 PM, Cong Wang wrote: BTW, the warning itself is all about empty names, so perhaps it's better to fix them separately. Huh ? You want more syzbot reports ? I do not. I unblocked this report today [1], you can be sure that as soon as syzbot gets the correct tag (Reported-b

Re: WARNING in __proc_create

2018-03-09 Thread Florian Westphal
Cong Wang wrote: > On Fri, Mar 9, 2018 at 2:58 PM, Eric Dumazet wrote: > > > > > > On 03/09/2018 02:56 PM, Eric Dumazet wrote: > > > >> > >> I sent a patch a while back, but Pablo/Florian wanted more than that > >> simple fix. > >> > >> We also need to filter special characters like '/' > > proc

Re: [PATCH 12/15] ice: Add stats and ethtool support

2018-03-09 Thread Jakub Kicinski
On Fri, 9 Mar 2018 09:21:33 -0800, Anirudh Venkataramanan wrote: > +static const struct ice_stats ice_net_stats[] = { > + ICE_NETDEV_STAT(rx_packets), > + ICE_NETDEV_STAT(tx_packets), > + ICE_NETDEV_STAT(rx_bytes), > + ICE_NETDEV_STAT(tx_bytes), > + ICE_NETDEV_STAT(rx_errors),

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

2018-03-09 Thread Greg Kurz
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 pending, clears TIF_SIGPENDING, handles the request an

Re: WARNING in __proc_create

2018-03-09 Thread Cong Wang
On Fri, Mar 9, 2018 at 2:58 PM, Eric Dumazet wrote: > > > On 03/09/2018 02:56 PM, Eric Dumazet wrote: > >> >> I sent a patch a while back, but Pablo/Florian wanted more than that >> simple fix. >> >> We also need to filter special characters like '/' proc_create_data() itself accepts '/', so it m

Re: WARNING in __proc_create

2018-03-09 Thread Florian Westphal
Eric Dumazet wrote: > >>fs/proc/generic.c:354 > > > >We need to reject empty names. > > > > I sent a patch a while back, but Pablo/Florian wanted more than that simple > fix. > > We also need to filter special characters like '/' > > Or maybe I am mixing with something else. Argh, sorry, this

Re: WARNING in __proc_create

2018-03-09 Thread Eric Dumazet
On 03/09/2018 02:56 PM, Eric Dumazet wrote: I sent a patch a while back, but Pablo/Florian wanted more than that simple fix. We also need to filter special characters like '/' Or maybe I am mixing with something else. Yes, Florian mentioned that we also had to reject "." and ".."

Re: WARNING in __proc_create

2018-03-09 Thread Eric Dumazet
On 03/09/2018 02:48 PM, Cong Wang wrote: On Fri, Mar 9, 2018 at 1:59 PM, syzbot wrote: Hello, syzbot hit the following crash on net-next commit 617aebe6a97efa539cc4b8a52adccd89596e6be0 (Sun Feb 4 00:25:42 2018 +) Merge tag 'usercopy-v4.16-rc1' of git://git.kernel.org/pub/scm/linux/kernel

Re: WARNING in __proc_create

2018-03-09 Thread Cong Wang
On Fri, Mar 9, 2018 at 1:59 PM, syzbot wrote: > Hello, > > syzbot hit the following crash on net-next commit > 617aebe6a97efa539cc4b8a52adccd89596e6be0 (Sun Feb 4 00:25:42 2018 +) > Merge tag 'usercopy-v4.16-rc1' of > git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux > > So far this cra

Re: [PATCH] net: remove VLA usage

2018-03-09 Thread Laszlo Toth
On Wed, Mar 07, 2018 at 08:26:14PM -0500, David Miller wrote: > From: Laszlo Toth > Date: Thu, 8 Mar 2018 01:19:53 +0100 > > > Separated snmp_seq_show_tcp_udp() to tcp and udp variants, > > so the usage of max_t() for the array size can be emitted. > > > > Signed-off-by: Laszlo Toth > > But it

Re: [PATCH 01/15] ice: Add basic driver framework for Intel(R) E800 Series

2018-03-09 Thread Jakub Kicinski
On Fri, 9 Mar 2018 09:21:22 -0800, Anirudh Venkataramanan wrote: > diff --git a/Documentation/networking/ice.txt > b/Documentation/networking/ice.txt > new file mode 100644 > index ..6261c46378e1 > --- /dev/null > +++ b/Documentation/networking/ice.txt nit: ice.rst, maybe?

[PATCH net-next 1/1] tc-testing: updated gact tests with batch test cases

2018-03-09 Thread Roman Mashak
Add test cases to exercise code paths responsible for adding or deleting batch of TC actions. Signed-off-by: Roman Mashak --- .../tc-testing/tc-tests/actions/gact.json | 73 +- 1 file changed, 72 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/tc-t

[PATCH v2 net-next 1/3] net: macb: Reorganize macb_mii bringup

2018-03-09 Thread Brad Mouring
The macb mii setup (mii_probe() and mii_init()) previously was somewhat interspersed, likely a result of organic growth and hacking. This change moves mii bus registration into mii_init and probing the bus for devices into mii_probe. Signed-off-by: Brad Mouring Suggested-by: Andrew Lunn --- dr

[PATCH v2 net-next 3/3] Documentation: macb: Document phy-handle optional binding

2018-03-09 Thread Brad Mouring
Signed-off-by: Brad Mouring --- Documentation/devicetree/bindings/net/macb.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/net/macb.txt b/Documentation/devicetree/bindings/net/macb.txt index 27966ae741e0..457d5ae16f23 100644 --- a/Documentation/devicetre

[PATCH v2 net-next 2/3] net: macb: Add phy-handle DT support

2018-03-09 Thread Brad Mouring
This optional binding (as described in the ethernet DT bindings doc) directs the netdev to the phydev to use. This is useful for a phy chip that has >1 phy in it, and two netdevs are using the same phy chip (i.e. the second mac's phy lives on the first mac's MDIO bus) The devicetree snippet would

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

2018-03-09 Thread Andrew Morton
On Fri, 09 Mar 2018 21:41:38 +0100 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

[PATCH net-next 1/1] tc-testing: add TC vlan action tests

2018-03-09 Thread Roman Mashak
Signed-off-by: Roman Mashak Tested-by: Brenda J. Butler --- .../tc-testing/tc-tests/actions/vlan.json | 410 + 1 file changed, 410 insertions(+) create mode 100644 tools/testing/selftests/tc-testing/tc-tests/actions/vlan.json diff --git a/tools/testing/selftests/t

Re: KASAN: use-after-free Read in sctp_association_free (2)

2018-03-09 Thread Neil Horman
On Fri, Mar 09, 2018 at 12:59:06PM -0800, syzbot wrote: > Hello, > > syzbot hit the following crash on net-next commit > fd372a7a9e5e9d8011a0222d10edd3523abcd3b1 (Thu Mar 8 19:43:48 2018 +) > Merge tag 'mlx5-updates-2018-02-28-2' of > git://git.kernel.org/pub/scm/linux/kernel/git/mellanox/linu

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

2018-03-09 Thread Kees Cook
On Fri, Mar 9, 2018 at 1:10 PM, 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 >> thinks this is a dynamic calculation due

[PATCH net-next 1/1] tc-testing: updated gact tests with batch test cases

2018-03-09 Thread Roman Mashak
Add test cases to exercise code paths responsible for adding or deleting batch of TC actions. Signed-off-by: Roman Mashak --- .../tc-testing/tc-tests/actions/gact.json | 73 +- 1 file changed, 72 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/tc-t

Re: [PATCH v2 net 1/5] tcp: feed correct number of pkts acked to cc modules also in recovery

2018-03-09 Thread Ilpo Järvinen
On Fri, 9 Mar 2018, Sergei Shtylyov wrote: > On 03/09/2018 05:10 PM, Ilpo Järvinen wrote: > > > @@ -3068,8 +3072,11 @@ static int tcp_clean_rtx_queue(struct sock *sk, u32 > > prior_fack, > > - if (!after(scb->end_seq, tp->high_seq)) > > + if (!after(scb->end_s

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

2018-03-09 Thread Linus Torvalds
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 > thinks this is a dynamic calculation due to the single-eval logic, which > is not needed in the lite

Re: [PATCH net] ipv4: lock mtu in fnhe when received PMTU < net.ipv4.route.min_pmtu

2018-03-09 Thread David Miller
From: Sabrina Dubroca Date: Fri, 9 Mar 2018 17:43:21 +0100 > diff --git a/include/net/ip_fib.h b/include/net/ip_fib.h > index f80524396c06..77d0a78cf7d2 100644 > --- a/include/net/ip_fib.h > +++ b/include/net/ip_fib.h > @@ -59,6 +59,7 @@ struct fib_nh_exception { > int

[bpf-next V3 PATCH 15/15] xdp: transition into using xdp_frame for ndo_xdp_xmit

2018-03-09 Thread Jesper Dangaard Brouer
Changing API ndo_xdp_xmit to take a struct xdp_frame instead of struct xdp_buff. This brings xdp_return_frame and ndp_xdp_xmit in sync. This builds towards changing the API further to become a bulk API, because xdp_buff is not a queue-able object while xdp_frame is. Signed-off-by: Jesper Dangaar

[bpf-next V3 PATCH 13/15] mlx5: use page_pool for xdp_return_frame call

2018-03-09 Thread Jesper Dangaard Brouer
This patch shows how it is possible to have both the driver local page cache, which uses elevated refcnt for "catching"/avoiding SKB put_page. And at the same time, have pages getting returned to the page_pool from ndp_xdp_xmit DMA completion. Performance is surprisingly good. Tested DMA-TX compl

[bpf-next V3 PATCH 14/15] xdp: transition into using xdp_frame for return API

2018-03-09 Thread Jesper Dangaard Brouer
Changing API xdp_return_frame() to take struct xdp_frame as argument, seems like a natural choice. But there are some subtle performance details here that needs extra care, which is a deliberate choice. When de-referencing xdp_frame on a remote CPU during DMA-TX completion, result in the cache-lin

[bpf-next V3 PATCH 07/15] virtio_net: convert to use generic xdp_frame and xdp_return_frame API

2018-03-09 Thread Jesper Dangaard Brouer
The virtio_net driver assumes XDP frames are always released based on page refcnt (via put_page). Thus, is only queues the XDP data pointer address and uses virt_to_head_page() to retrieve struct page. Use the XDP return API to get away from such assumptions. Instead queue an xdp_frame, which all

[bpf-next V3 PATCH 08/15] bpf: cpumap convert to use generic xdp_frame

2018-03-09 Thread Jesper Dangaard Brouer
The generic xdp_frame format, was inspired by the cpumap own internal xdp_pkt format. It is now time to convert it over to the generic xdp_frame format. The cpumap needs one extra field dev_rx. Signed-off-by: Jesper Dangaard Brouer --- include/net/xdp.h |1 + kernel/bpf/cpumap.c | 100 +

[bpf-next V3 PATCH 12/15] xdp: allow page_pool as an allocator type in xdp_return_frame

2018-03-09 Thread Jesper Dangaard Brouer
New allocator type MEM_TYPE_PAGE_POOL for page_pool usage. The registered allocator page_pool pointer is not available directly from xdp_rxq_info, but it could be (if needed). For now, the driver should keep separate track of the page_pool pointer, which it should use for RX-ring page allocation.

[bpf-next V3 PATCH 10/15] xdp: rhashtable with allocator ID to pointer mapping

2018-03-09 Thread Jesper Dangaard Brouer
Use the IDA infrastructure for getting a cyclic increasing ID number, that is used for keeping track of each registered allocator per RX-queue xdp_rxq_info. Instead of using the IDR infrastructure, which uses a radix tree, use a dynamic rhashtable, for creating ID to pointer lookup table, because

[bpf-next V3 PATCH 09/15] mlx5: register a memory model when XDP is enabled

2018-03-09 Thread Jesper Dangaard Brouer
Now all the users of ndo_xdp_xmit have been converted to use xdp_return_frame. This enable a different memory model, thus activating another code path in the xdp_return_frame API. V2: Fixed issues pointed out by Tariq. Signed-off-by: Jesper Dangaard Brouer --- drivers/net/ethernet/mellanox/mlx5

[bpf-next V3 PATCH 02/15] xdp: introduce xdp_return_frame API and use in cpumap

2018-03-09 Thread Jesper Dangaard Brouer
Introduce an xdp_return_frame API, and convert over cpumap as the first user, given it have queued XDP frame structure to leverage. V3: Cleanup and remove C99 style comments, pointed out by Alex Duyck. Signed-off-by: Jesper Dangaard Brouer --- include/net/xdp.h | 28

[bpf-next V3 PATCH 11/15] page_pool: refurbish version of page_pool code

2018-03-09 Thread Jesper Dangaard Brouer
Need a fast page recycle mechanism for ndo_xdp_xmit API for returning pages on DMA-TX completion time, which have good cross CPU performance, given DMA-TX completion time can happen on a remote CPU. Refurbish my page_pool code, that was presented[1] at MM-summit 2016. Adapted page_pool code to not

[bpf-next V3 PATCH 06/15] tun: convert to use generic xdp_frame and xdp_return_frame API

2018-03-09 Thread Jesper Dangaard Brouer
The tuntap driver invented it's own driver specific way of queuing XDP packets, by storing the xdp_buff information in the top of the XDP frame data. Convert it over to use the more generic xdp_frame structure. The main problem with the in-driver method is that the xdp_rxq_info pointer cannot be

[bpf-next V3 PATCH 05/15] xdp: introduce a new xdp_frame type

2018-03-09 Thread Jesper Dangaard Brouer
This is needed to convert drivers tuntap and virtio_net. This is a generalization of what is done inside cpumap, which will be converted later. Signed-off-by: Jesper Dangaard Brouer --- include/net/xdp.h | 40 1 file changed, 40 insertions(+) diff --g

[bpf-next V3 PATCH 04/15] xdp: move struct xdp_buff from filter.h to xdp.h

2018-03-09 Thread Jesper Dangaard Brouer
This is done to prepare for the next patch, and it is also nice to move this XDP related struct out of filter.h. Signed-off-by: Jesper Dangaard Brouer --- include/linux/filter.h | 24 +--- include/net/xdp.h | 22 ++ 2 files changed, 23 insertions(

[bpf-next V3 PATCH 03/15] ixgbe: use xdp_return_frame API

2018-03-09 Thread Jesper Dangaard Brouer
Extend struct ixgbe_tx_buffer to store the xdp_mem_info. Signed-off-by: Jesper Dangaard Brouer --- drivers/net/ethernet/intel/ixgbe/ixgbe.h |1 + drivers/net/ethernet/intel/ixgbe/ixgbe_main.c |6 -- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/net/ether

[bpf-next V3 PATCH 00/15] XDP redirect memory return API

2018-03-09 Thread Jesper Dangaard Brouer
This patchset works towards supporting different XDP RX-ring memory allocators. As this will be needed by the AF_XDP zero-copy mode. The patchset uses mlx5 as the sample driver, which gets implemented XDP_REDIRECT RX-mode, but not ndo_xdp_xmit (as this API is subject to change thought the patchse

[bpf-next V3 PATCH 01/15] mlx5: basic XDP_REDIRECT forward support

2018-03-09 Thread Jesper Dangaard Brouer
This implements basic XDP redirect support in mlx5 driver. Notice that the ndo_xdp_xmit() is NOT implemented, because that API need some changes that this patchset is working towards. The main purpose of this patch is have different drivers doing XDP_REDIRECT to show how different memory models b

Re: [PATCH] net: use skb_is_gso_sctp() instead of open-coding

2018-03-09 Thread Marcelo Ricardo Leitner
On Fri, Mar 09, 2018 at 02:06:09PM +1100, Daniel Axtens wrote: > As well as the basic conversion, I noticed that a lot of the > SCTP code checks gso_type without first checking skb_is_gso() > so I have added that where appropriate. > > Also, document the helper. Thanks Daniel. > > Cc: Daniel Bo

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

2018-03-09 Thread Kees Cook
When max() is used in stack array size calculations from literal values (e.g. "char foo[max(sizeof(struct1), sizeof(struct2))]", the compiler thinks this is a dynamic calculation due to the single-eval logic, which is not needed in the literal case. This change removes several accidental stack VLAs

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

2018-03-09 Thread Andy Lutomirski
On Fri, Mar 9, 2018 at 7:38 PM, Linus Torvalds wrote: > On Fri, Mar 9, 2018 at 11:12 AM, Linus Torvalds > wrote: >> >> How are you going to handle five processes doing the same setup concurrently? > > Side note: it's not just serialization. It's also "is it actually up > and running". > I think

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

2018-03-09 Thread Andy Lutomirski
On Fri, Mar 9, 2018 at 6:55 PM, David Miller wrote: > From: Alexei Starovoitov > Date: Fri, 9 Mar 2018 10:50:49 -0800 > >> On 3/9/18 10:23 AM, Andy Lutomirski wrote: >>> It might not be totally crazy to back it by tmpfs. >> >> interesting. how do you propose to do it? >> Something like: >> - crea

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

2018-03-09 Thread Linus Torvalds
On Fri, Mar 9, 2018 at 11:12 AM, Linus Torvalds wrote: > > How are you going to handle five processes doing the same setup concurrently? Side note: it's not just serialization. It's also "is it actually up and running". The rule for "request_module()" (for a real module) has been that it returns

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

2018-03-09 Thread Thomas Falcon
Some backing devices cannot handle small packets well, so pad any small packets to avoid that. It was recommended that the VNIC driver should not send packets smaller than the minimum MTU value provided by firmware, so pad small packets to be at least that long. Signed-off-by: Thomas Falcon ---

Re: [PATCH net 4/5] tcp: prevent bogus undos when SACK is not enabled

2018-03-09 Thread Ilpo Järvinen
On Fri, 9 Mar 2018, David Miller wrote: > From: Ilpo Järvinen > Date: Fri, 9 Mar 2018 16:11:47 +0200 (EET) > > > Unfortunately I don't have now permission to publish the time-seq > > graph about it but I've tried to improve the changelog messages so > > that you can better understand under which

  1   2   3   >