[Patch net] genetlink: clean up family attributes allocations

2020-06-12 Thread Cong Wang
genl_family_rcv_msg_attrs_parse() and genl_family_rcv_msg_attrs_free() take a boolean parameter to determine whether allocate/free the family attrs. This is unnecessary as we can just check family->parallel_ops. More importantly, callers would not need to worry about pairing these parameters correc

[PATCH] iwl: fix crash in iwl_dbg_tlv_alloc_trigger

2020-06-12 Thread Jiri Slaby
The tlv passed to iwl_dbg_tlv_alloc_trigger comes from a loaded firmware file. The memory can be marked as read-only as firmware could be shared. In anyway, writing to this memory is not expected. So, iwl_dbg_tlv_alloc_trigger can crash now: BUG: unable to handle page fault for address: ae2c

Re: [PATCH] mld: fix memory leak in ipv6_mc_destroy_dev()

2020-06-12 Thread Hangbin Liu
On Thu, Jun 11, 2020 at 03:57:50PM +0800, Wang Hai wrote: > Commit a84d01647989 ("mld: fix memory leak in mld_del_delrec()") fixed > the memory leak of MLD, but missing the ipv6_mc_destroy_dev() path, in > which mca_sources are leaked after ma_put(). > > Using ip6_mc_clear_src() to take care of th

Re: [RFC] .BTF section data alignment issue on s390

2020-06-12 Thread Jiri Olsa
On Fri, Jun 12, 2020 at 12:46:13AM +0200, Ilya Leoshkevich wrote: > On Thu, 2020-06-11 at 22:50 +0200, Jiri Olsa wrote: > > hi, > > we're hitting a problem on s390 with BTF data alignment. > > > > When running simple test, we're getting this message from > > verifier and console: > > > > bpf_co

Re: [PATCH] iwl: fix crash in iwl_dbg_tlv_alloc_trigger

2020-06-12 Thread Kalle Valo
Jiri Slaby writes: > The tlv passed to iwl_dbg_tlv_alloc_trigger comes from a loaded firmware > file. The memory can be marked as read-only as firmware could be > shared. In anyway, writing to this memory is not expected. So, > iwl_dbg_tlv_alloc_trigger can crash now: > > BUG: unable to handle

Re: [PATCH] iwl: fix crash in iwl_dbg_tlv_alloc_trigger

2020-06-12 Thread Luciano Coelho
On Fri, 2020-06-12 at 10:55 +0300, Kalle Valo wrote: > Jiri Slaby writes: > > > The tlv passed to iwl_dbg_tlv_alloc_trigger comes from a loaded firmware > > file. The memory can be marked as read-only as firmware could be > > shared. In anyway, writing to this memory is not expected. So, > > iwl_

[PATCH] rtw88: 8822ce: add support for device ID 0xc82f

2020-06-12 Thread Aaron Ma
New device ID 0xc82f found on Lenovo ThinkCenter. Tested it with c822 driver, works good. PCI id: 03:00.0 Network controller [0280]: Realtek Semiconductor Co., Ltd. Device [10ec:c82f] Subsystem: Lenovo Device [17aa:c02f] Signed-off-by: Aaron Ma --- drivers/net/wireless/realtek/rtw88/rtw

[PATCH v2] net: mvneta: Fix Serdes configuration for 2.5Gbps modes

2020-06-12 Thread Sascha Hauer
The Marvell MVNETA Ethernet controller supports a 2.5Gbps SGMII mode called DRSGMII. Depending on the Port MAC Control Register0 PortType setting this seems to be either an overclocked SGMII mode or 2500BaseX. This patch adds the necessary Serdes Configuration setting for the 2.5Gbps modes. There

[PATCH] mptcp: fix memory leak in mptcp_subflow_create_socket()

2020-06-12 Thread Wei Yongjun
socket malloced by sock_create_kern() should be release before return in the error handling, otherwise it cause memory leak. unreferenced object 0x88810910c000 (size 1216): comm "0003_test_m", pid 12238, jiffies 4295050289 (age 54.237s) hex dump (first 32 bytes): 01 00 00 00 01 00

Re: [PATCH v2] net: mvneta: Fix Serdes configuration for 2.5Gbps modes

2020-06-12 Thread Russell King - ARM Linux admin
On Fri, Jun 12, 2020 at 10:38:47AM +0200, Sascha Hauer wrote: > The Marvell MVNETA Ethernet controller supports a 2.5Gbps SGMII mode > called DRSGMII. Depending on the Port MAC Control Register0 PortType > setting this seems to be either an overclocked SGMII mode or 2500BaseX. > > This patch adds

Re: [PATCHv4 bpf-next 1/2] xdp: add a new helper for dev map multicast support

2020-06-12 Thread Hangbin Liu
On Wed, Jun 10, 2020 at 12:18:59PM +0200, Jesper Dangaard Brouer wrote: > On Tue, 26 May 2020 22:05:38 +0800 > Hangbin Liu wrote: > > > diff --git a/net/core/xdp.c b/net/core/xdp.c > > index 90f44f382115..acdc63833b1f 100644 > > --- a/net/core/xdp.c > > +++ b/net/core/xdp.c > > @@ -475,3 +475,29

[PATCH v2] 9p/trans_fd: Fix concurrency del of req_list in p9_fd_cancelled/p9_read_work

2020-06-12 Thread Wang Hai
p9_read_work and p9_fd_cancelled may be called concurrently. In some cases, req->req_list may be deleted by both p9_read_work and p9_fd_cancelled. We can fix it by ignoring replies associated with a cancelled request and ignoring cancelled request if message has been received before lock. Fixes:

Re: [PATCH v2] 9p/trans_fd: Fix concurrency del of req_list in p9_fd_cancelled/p9_read_work

2020-06-12 Thread Dominique Martinet
Wang Hai wrote on Fri, Jun 12, 2020: > p9_read_work and p9_fd_cancelled may be called concurrently. > In some cases, req->req_list may be deleted by both p9_read_work > and p9_fd_cancelled. > > We can fix it by ignoring replies associated with a cancelled > request and ignoring cancelled request i

Re: [PATCH v2] 9p/trans_fd: Fix concurrency del of req_list in p9_fd_cancelled/p9_read_work

2020-06-12 Thread wanghai (M)
在 2020/6/12 17:10, Dominique Martinet 写道: Wang Hai wrote on Fri, Jun 12, 2020: p9_read_work and p9_fd_cancelled may be called concurrently. In some cases, req->req_list may be deleted by both p9_read_work and p9_fd_cancelled. We can fix it by ignoring replies associated with a cancelled reque

KASAN: use-after-free Write in fsnotify_detach_connector_from_object

2020-06-12 Thread syzbot
Hello, syzbot found the following crash on: HEAD commit:7ae77150 Merge tag 'powerpc-5.8-1' of git://git.kernel.org.. git tree: upstream console output: https://syzkaller.appspot.com/x/log.txt?x=120b26c110 kernel config: https://syzkaller.appspot.com/x/.config?x=d195fe572fb15312 das

Re: [PATCH v2] net: mvneta: Fix Serdes configuration for 2.5Gbps modes

2020-06-12 Thread Russell King - ARM Linux admin
On Fri, Jun 12, 2020 at 09:47:10AM +0100, Russell King - ARM Linux admin wrote: > On Fri, Jun 12, 2020 at 10:38:47AM +0200, Sascha Hauer wrote: > > The Marvell MVNETA Ethernet controller supports a 2.5Gbps SGMII mode > > called DRSGMII. Depending on the Port MAC Control Register0 PortType > > setti

Re: [PATCH v2 1/2] perf tools: Fix potential memory leaks in perf events parser

2020-06-12 Thread Greg KH
On Thu, Jun 11, 2020 at 08:50:58PM +0200, Markus Elfring wrote: > > Fix memory leak of in function parse_events_term__sym_hw() > > and parse_events_term__clone() when error occur. > > How do you think about a wording variant like the following? > >Release a configuration object after a string

[PATCH net 2/2] flow_offload: fix the list_del corruption in the driver list

2020-06-12 Thread wenxu
From: wenxu When a indr device add in offload success. After the representor go away. All the flow_block_cb cleanup but miss del form driver list. Fixes: 0fdcf78d5973 ("net: use flow_indr_dev_setup_offload()") Signed-off-by: wenxu --- drivers/net/ethernet/broadcom/bnxt/bnxt_tc.c| 1 -

[PATCH net 1/2] flow_offload: return zero for FLOW_BLOCK_UNBIND type flow_indr_dev_setup_offload

2020-06-12 Thread wenxu
From: wenxu block->nooffloaddevcnt warning with following dmesg log: When a indr device add in offload success. The block->nooffloaddevcnt always zero. But When all the representors go away. All the flow_block_cb cleanup. Then remove the indr device, The __tcf_block_put call flow_indr_dev_setup_

Re: [PATCH] xdp_rxq_info_user: Replace malloc/memset w/calloc

2020-06-12 Thread Joe Perches
On Fri, 2020-06-12 at 08:42 +0200, Jesper Dangaard Brouer wrote: > On Thu, 11 Jun 2020 20:36:40 -0400 > Gaurav Singh wrote: > > > Replace malloc/memset with calloc > > > > Fixes: 0fca931a6f21 ("samples/bpf: program demonstrating access to > > xdp_rxq_info") > > Signed-off-by: Gaurav Singh > >

Re: [PATCH v2] net: mvneta: Fix Serdes configuration for 2.5Gbps modes

2020-06-12 Thread Sascha Hauer
On Fri, Jun 12, 2020 at 09:47:10AM +0100, Russell King - ARM Linux admin wrote: > On Fri, Jun 12, 2020 at 10:38:47AM +0200, Sascha Hauer wrote: > > The Marvell MVNETA Ethernet controller supports a 2.5Gbps SGMII mode > > called DRSGMII. Depending on the Port MAC Control Register0 PortType > > setti

Re: [PATCH bpf] bpf: tcp: recv() should return 0 when the peer socket is closed

2020-06-12 Thread Jakub Sitnicki
On Wed, 10 Jun 2020 12:19:43 +0200 Sabrina Dubroca wrote: > If the peer is closed, we will never get more data, so > tcp_bpf_wait_data will get stuck forever. In case we passed > MSG_DONTWAIT to recv(), we get EAGAIN but we should actually get > 0. > > From man 2 recv: > > RETURN VALUE > >

Re: [PATCH bpf] bpf: sockmap: don't attach programs to UDP sockets

2020-06-12 Thread Jakub Sitnicki
On Thu, 11 Jun 2020 18:25:20 +0100 Lorenz Bauer wrote: > The stream parser infrastructure isn't set up to deal with UDP > sockets, so we mustn't try to attach programs to them. > > I remember making this change at some point, but I must have lost > it while rebasing or something similar. > > Fi

Re: [PATCH v2] net: mvneta: Fix Serdes configuration for 2.5Gbps modes

2020-06-12 Thread Russell King - ARM Linux admin
On Fri, Jun 12, 2020 at 11:01:15AM +0100, Russell King - ARM Linux admin wrote: > On Fri, Jun 12, 2020 at 09:47:10AM +0100, Russell King - ARM Linux admin > wrote: > > On Fri, Jun 12, 2020 at 10:38:47AM +0200, Sascha Hauer wrote: > > > The Marvell MVNETA Ethernet controller supports a 2.5Gbps SGMI

Re: [PATCH v2] net: mvneta: Fix Serdes configuration for 2.5Gbps modes

2020-06-12 Thread Russell King - ARM Linux admin
On Fri, Jun 12, 2020 at 11:18:20AM +0100, Russell King - ARM Linux admin wrote: > On Fri, Jun 12, 2020 at 11:01:15AM +0100, Russell King - ARM Linux admin > wrote: > > On Fri, Jun 12, 2020 at 09:47:10AM +0100, Russell King - ARM Linux admin > > wrote: > > > On Fri, Jun 12, 2020 at 10:38:47AM +020

Re: [PATCH v2] net: mvneta: Fix Serdes configuration for 2.5Gbps modes

2020-06-12 Thread Russell King - ARM Linux admin
On Fri, Jun 12, 2020 at 11:42:08AM +0100, Russell King - ARM Linux admin wrote: > On Fri, Jun 12, 2020 at 11:18:20AM +0100, Russell King - ARM Linux admin > wrote: > > On Fri, Jun 12, 2020 at 11:01:15AM +0100, Russell King - ARM Linux admin > > wrote: > > > On Fri, Jun 12, 2020 at 09:47:10AM +010

Re: [PATCH 0/6] Add Microchip MCP25XXFD CAN driver

2020-06-12 Thread Marc Kleine-Budde
On 6/11/20 10:30 PM, Marc Kleine-Budde wrote: > On 6/11/20 6:26 PM, Marc Kleine-Budde wrote: >> I initially started looking at Martin's driver and it was not using several >> modern CAN driver infrastructures. I then posted some cleanup patches but >> Martin >> was not working on the driver any mo

Re: [PATCH v2] net: mvneta: Fix Serdes configuration for 2.5Gbps modes

2020-06-12 Thread Russell King - ARM Linux admin
On Fri, Jun 12, 2020 at 12:22:13PM +0100, Russell King - ARM Linux admin wrote: > On Fri, Jun 12, 2020 at 11:42:08AM +0100, Russell King - ARM Linux admin > wrote: > > With the obvious mistakes fixed (extraneous 'i' and lack of default > > case), it seems to still work on Armada 388 Clearfog Pro w

[PATCH net] i40e: fix crash when Rx descriptor count is changed

2020-06-12 Thread Björn Töpel
From: Björn Töpel When the AF_XDP buffer allocator was introduced, the Rx SW ring "rx_bi" allocation was moved from i40e_setup_rx_descriptors() function, and was instead done in the i40e_configure_rx_ring() function. This broke the ethtool set_ringparam() hook for changing the Rx descriptor coun

Re: [PATCH v2] net: mvneta: Fix Serdes configuration for 2.5Gbps modes

2020-06-12 Thread Sascha Hauer
On Fri, Jun 12, 2020 at 12:30:31PM +0100, Russell King - ARM Linux admin wrote: > On Fri, Jun 12, 2020 at 12:22:13PM +0100, Russell King - ARM Linux admin > wrote: > > On Fri, Jun 12, 2020 at 11:42:08AM +0100, Russell King - ARM Linux admin > > wrote: > > > With the obvious mistakes fixed (extran

Re: [PATCH 1/2] net: dsa: qca8k: Switch to PHYLINK instead of PHYLIB

2020-06-12 Thread Jonathan McDowell
On Thu, Jun 11, 2020 at 09:55:23AM +0100, Russell King - ARM Linux admin wrote: > On Wed, Jun 10, 2020 at 08:14:03PM +0100, Jonathan McDowell wrote: > > Update the driver to use the new PHYLINK callbacks, removing the > > legacy adjust_link callback. > > Looks good, there's a couple of issues / qu

Re: [PATCH] xdp_rxq_info_user: Replace malloc/memset w/calloc

2020-06-12 Thread Jesper Dangaard Brouer
On Fri, 12 Jun 2020 03:14:58 -0700 Joe Perches wrote: > On Fri, 2020-06-12 at 08:42 +0200, Jesper Dangaard Brouer wrote: > > On Thu, 11 Jun 2020 20:36:40 -0400 > > Gaurav Singh wrote: > > > > > Replace malloc/memset with calloc > > > > > > Fixes: 0fca931a6f21 ("samples/bpf: program demonstra

Re: [PATCH v2] net: mvneta: Fix Serdes configuration for 2.5Gbps modes

2020-06-12 Thread Sascha Hauer
On Fri, Jun 12, 2020 at 11:18:20AM +0100, Russell King - ARM Linux admin wrote: > On Fri, Jun 12, 2020 at 11:01:15AM +0100, Russell King - ARM Linux admin > wrote: > > On Fri, Jun 12, 2020 at 09:47:10AM +0100, Russell King - ARM Linux admin > > wrote: > > > On Fri, Jun 12, 2020 at 10:38:47AM +020

Re: [PATCH] xdp_rxq_info_user: Replace malloc/memset w/calloc

2020-06-12 Thread Toke Høiland-Jørgensen
Joe Perches writes: > On Fri, 2020-06-12 at 08:42 +0200, Jesper Dangaard Brouer wrote: >> On Thu, 11 Jun 2020 20:36:40 -0400 >> Gaurav Singh wrote: >> >> > Replace malloc/memset with calloc >> > >> > Fixes: 0fca931a6f21 ("samples/bpf: program demonstrating access to >> > xdp_rxq_info") >> > S

Re: [PATCH v2] net: mvneta: Fix Serdes configuration for 2.5Gbps modes

2020-06-12 Thread Russell King - ARM Linux admin
On Fri, Jun 12, 2020 at 02:06:04PM +0200, Sascha Hauer wrote: > And here is the same patch which applies on master and the net tree. > It works as expected on my Armada XP in 2.5Gbps mode. Provided you are > happy with the patch I can send it as a formal patch on monday if by > then you haven't don

Re: [Patch net] genetlink: clean up family attributes allocations

2020-06-12 Thread Ido Schimmel
On Fri, Jun 12, 2020 at 12:16:55AM -0700, Cong Wang wrote: > genl_family_rcv_msg_attrs_parse() and genl_family_rcv_msg_attrs_free() > take a boolean parameter to determine whether allocate/free the family > attrs. This is unnecessary as we can just check family->parallel_ops. > More importantly, ca

Re: [PATCH v2] net: mvneta: Fix Serdes configuration for 2.5Gbps modes

2020-06-12 Thread Russell King - ARM Linux admin
On Fri, Jun 12, 2020 at 01:52:50PM +0200, Sascha Hauer wrote: > On Fri, Jun 12, 2020 at 12:30:31PM +0100, Russell King - ARM Linux admin > wrote: > > On Fri, Jun 12, 2020 at 12:22:13PM +0100, Russell King - ARM Linux admin > > wrote: > > > On Fri, Jun 12, 2020 at 11:42:08AM +0100, Russell King -

[REGRESSION] mlx5: Driver remove during hot unplug is broken

2020-06-12 Thread Niklas Schnelle
Hello Parav, Hello Saeed, our CI system for IBM Z Linux found a hang[0] when hot unplugging a ConnectX-4 Lx VF from a z/VM guest in Linus' current tree and added during the merge window. Sadly it didn't happen all the time which sent me on the wrong path for two full git bisects. Anyway, I've n

Re: [PATCH v4 0/3] Add support for SQI and master-slave

2020-06-12 Thread Michal Kubecek
On Wed, Jun 10, 2020 at 10:37:41AM +0200, Oleksij Rempel wrote: > This patch set is extending ethtool to make it more usable on automotive > PHYs like NXP TJA11XX. > > They make use of new KAPI (currently in net-next, will go probably to the > kernel 5.8-rc1): > - PHY master-slave role configurati

Re: [PATCH v2 1/7] Bluetooth: Add definitions for advertisement monitor features

2020-06-12 Thread Marcel Holtmann
Hi Miao-chen, > Thanks for reviewing. Please see v3 for the update. > I am trying to settle down the name of Add Advertisement Pattern > Monitor command with Luiz on the other thread. I will post the update > here once it is sorted out. I thought the name was just fine. Especially in the discusse

[PATCH] ipvs: avoid drop first packet to reuse conntrack

2020-06-12 Thread YangYuxi
Since 'commit f719e3754ee2 ("ipvs: drop first packet to redirect conntrack")', when a new TCP connection meet the conditions that need reschedule, the first syn packet is dropped, this cause one second latency for the new connection, more discussion about this problem can easy search from google, s

Re: [PATCH net 1/2] flow_offload: return zero for FLOW_BLOCK_UNBIND type flow_indr_dev_setup_offload

2020-06-12 Thread wenxu
Please drop this series. Thank you. 在 2020/6/12 18:08, we...@ucloud.cn 写道: From: wenxu block->nooffloaddevcnt warning with following dmesg log: When a indr device add in offload success. The block->nooffloaddevcnt always zero. But When all the representors go away. All the flow_block_cb clea

Re: [PATCH net v3 1/2] flow_offload: fix incorrect cleanup for indirect flow_blocks

2020-06-12 Thread Vlad Buslov
On Thu 11 Jun 2020 at 19:52, we...@ucloud.cn wrote: > From: wenxu > > If the representor is removed, then identify the indirect > flow_blocks that need to be removed by the release callback. > > Fixes: 1fac52da5942 ("net: flow_offload: consolidate indirect flow_block > infrastructure") > Signed

Re: [PATCH] ath10k: Wait until copy complete is actually done before completing

2020-06-12 Thread pillair
Hi Doug, The send callback for the CEs do check for hw_index/SRRI before trying to free the buffer. But adding a check for copy-complete (before calling the individual CE callbacks) seems to be the better approach. Hence I agree that this patch should be added. Thanks, Rakesh Pillai. On 202

Re: [PATCH net 2/2] flow_offload: fix the list_del corruption in the driver list

2020-06-12 Thread Vlad Buslov
On Fri 12 Jun 2020 at 13:08, we...@ucloud.cn wrote: > From: wenxu > > When a indr device add in offload success. After the representor > go away. All the flow_block_cb cleanup but miss del form driver > list. > > Fixes: 0fdcf78d5973 ("net: use flow_indr_dev_setup_offload()") > Signed-off-by: wen

Re: [PATCH] xdp_rxq_info_user: Replace malloc/memset w/calloc

2020-06-12 Thread Joe Perches
On Fri, 2020-06-12 at 14:05 +0200, Jesper Dangaard Brouer wrote: > On Fri, 12 Jun 2020 03:14:58 -0700 > Joe Perches wrote: > > > On Fri, 2020-06-12 at 08:42 +0200, Jesper Dangaard Brouer wrote: > > > On Thu, 11 Jun 2020 20:36:40 -0400 > > > Gaurav Singh wrote: > > > > > > > Replace malloc/mem

[PATCH bpf 1/2] flow_dissector: reject invalid attach_flags

2020-06-12 Thread Lorenz Bauer
Using BPF_PROG_ATTACH on a flow dissector program supports neither flags nor target_fd but accepts any value. Return EINVAL if either are non-zero. Signed-off-by: Lorenz Bauer Fixes: b27f7bb590ba ("flow_dissector: Move out netns_bpf prog callbacks") --- kernel/bpf/net_namespace.c | 3 +++ 1 file

[PATCH bpf 2/2] bpf: sockmap: reject invalid attach_flags

2020-06-12 Thread Lorenz Bauer
Using BPF_PROG_ATTACH on a sockmap program currently understands no flags, but accepts any value. Return EINVAL if any flags are specified. Signed-off-by: Lorenz Bauer Fixes: 604326b41a6f ("bpf, sockmap: convert to generic sk_msg interface") --- net/core/sock_map.c | 3 +++ 1 file changed, 3 ins

[RFC,net-next, 4/5] vrf: add l3mdev registration for table to VRF device lookup

2020-06-12 Thread Andrea Mayer
During the initialization phase of the VRF module, the callback for table to VRF device lookup is registered in l3mdev. Signed-off-by: Andrea Mayer --- drivers/net/vrf.c | 59 +++ 1 file changed, 55 insertions(+), 4 deletions(-) diff --git a/drivers/n

[RFC,net-next, 0/5] Strict mode for VRF

2020-06-12 Thread Andrea Mayer
This patch set adds the new "strict mode" functionality to the Virtual Routing and Forwarding infrastructure (VRF). Hereafter we discuss the requirements and the main features of the "strict mode" for VRF. On VRF creation, it is necessary to specify the associated routing table used during the loo

[RFC,net-next, 5/5] selftests: add selftest for the VRF strict mode

2020-06-12 Thread Andrea Mayer
The new strict mode functionality is tested in different configurations and on different network namespaces. Signed-off-by: Andrea Mayer --- .../selftests/net/vrf_strict_mode_test.sh | 390 ++ 1 file changed, 390 insertions(+) create mode 100755 tools/testing/selftests/net/v

[RFC,net-next, 2/5] vrf: track associations between VRF devices and tables

2020-06-12 Thread Andrea Mayer
Add the data structures and the processing logic to keep track of the associations between VRF devices and routing tables. When a VRF is instantiated, it needs to refer to a given routing table. For each table, we explicitly keep track of the existing VRFs that refer to the table. Signed-off-by: A

[RFC,net-next, 3/5] vrf: add sysctl parameter for strict mode

2020-06-12 Thread Andrea Mayer
Add net.vrf.strict_mode sysctl parameter. When net.vrf.strict_mode=0 (default) it is possible to associate multiple VRF devices to the same table. Conversely, when net.vrf.strict_mode=1 a table can be associated to a single VRF device. When switching from net.vrf.strict_mode=0 to net.vrf.strict_m

[RFC,net-next, 1/5] l3mdev: add infrastructure for table to VRF mapping

2020-06-12 Thread Andrea Mayer
Add infrastructure to l3mdev (the core code for Layer 3 master devices) in order to find out the corresponding VRF device for a given table id. Therefore, the l3mdev implementations: - can register a callback that returns the device index of the l3mdev associated with a given table id; - can o

Re: [RFC,net-next, 0/5] Strict mode for VRF

2020-06-12 Thread Dinesh G Dutt
Thanks for doing this Andrea. This is a very important patch. I'll let the others comment on the specificity of the patch, but strict mode=1 should be the default . Dinesh On 6/12/20 9:49 AM, Andrea Mayer wrote: This patch set adds the new "strict mode" functionality to the Virtual Routing an

Re: [PATCH] mptcp: unify MPTCP_PM_MAX_ADDR and MPTCP_PM_ADDR_MAX

2020-06-12 Thread Matthieu Baerts
Hi Geliang, On 12/06/2020 07:27, Geliang Tang wrote: Unify these two duplicate macros into 8. Thank you for this new patch! (...) diff --git a/net/mptcp/protocol.h b/net/mptcp/protocol.h index 809687d3f410..86d265500cf6 100644 --- a/net/mptcp/protocol.h +++ b/net/mptcp/protocol.h @@ -135,7

Re: [PATCH v3 4/7] Bluetooth: Add handler of MGMT_OP_REMOVE_ADV_MONITOR

2020-06-12 Thread Jakub Kicinski
On Thu, 11 Jun 2020 23:15:26 -0700 Miao-chen Chou wrote: > This adds the request handler of MGMT_OP_REMOVE_ADV_MONITOR command. > Note that the controller-based monitoring is not yet in place. This > removes the internal monitor(s) without sending HCI traffic, so the > request returns immediately.

Re: [RFC,net-next, 1/5] l3mdev: add infrastructure for table to VRF mapping

2020-06-12 Thread Jakub Kicinski
On Fri, 12 Jun 2020 18:49:33 +0200 Andrea Mayer wrote: > Add infrastructure to l3mdev (the core code for Layer 3 master devices) in > order to find out the corresponding VRF device for a given table id. > Therefore, the l3mdev implementations: > - can register a callback that returns the device in

Re: [RFC,net-next, 3/5] vrf: add sysctl parameter for strict mode

2020-06-12 Thread Jakub Kicinski
On Fri, 12 Jun 2020 18:49:35 +0200 Andrea Mayer wrote: > Add net.vrf.strict_mode sysctl parameter. > > When net.vrf.strict_mode=0 (default) it is possible to associate multiple > VRF devices to the same table. Conversely, when net.vrf.strict_mode=1 a > table can be associated to a single VRF devic

Re: [PATCH] mptcp: use list_first_entry_or_null

2020-06-12 Thread Mat Martineau
Hello Geliang, On Fri, 12 Jun 2020, Geliang Tang wrote: Use list_first_entry_or_null to simplify the code. Signed-off-by: Geliang Tang --- net/mptcp/protocol.h | 5 + 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/net/mptcp/protocol.h b/net/mptcp/protocol.h index 86d265500c

net-next test error: BUG: using smp_processor_id() in preemptible code in ext4_mb_new_blocks

2020-06-12 Thread syzbot
Hello, syzbot found the following crash on: HEAD commit:af7b4801 Merge git://git.kernel.org/pub/scm/linux/kernel/g.. git tree: net-next console output: https://syzkaller.appspot.com/x/log.txt?x=15fe909e10 kernel config: https://syzkaller.appspot.com/x/.config?x=b366fd92adf6f8b4 das

[PATCH net] ibmvnic: Harden device login requests

2020-06-12 Thread Thomas Falcon
The VNIC driver's "login" command sequence is the final step in the driver's initialization process with device firmware, confirming the available device queue resources to be utilized by the driver. Under high system load, firmware may not respond to the request in a timely manner or may abort the

net test error: BUG: using smp_processor_id() in preemptible code in ext4_mb_new_blocks

2020-06-12 Thread syzbot
Hello, syzbot found the following crash on: HEAD commit:18dbd4cd Merge branch 'net-ipa-endpoint-configuration-fixes' git tree: net console output: https://syzkaller.appspot.com/x/log.txt?x=13f762ea10 kernel config: https://syzkaller.appspot.com/x/.config?x=b366fd92adf6f8b4 dashboar

[PATCH net] ibmvnic: Flush existing work items before device removal

2020-06-12 Thread Thomas Falcon
Ensure that all scheduled work items have completed before continuing with device removal and after further event scheduling has been halted. This patch fixes a bug where a scheduled driver reset event is processed following device removal. Signed-off-by: Thomas Falcon --- drivers/net/ethernet/i

[PATCH] xdp_rxq_info_user: Fix null pointer dereference. Replace malloc/memset with calloc.

2020-06-12 Thread Gaurav Singh
Memset on the pointer right after malloc can cause a null pointer deference if it failed to allocate memory. A simple fix is to replace malloc/memset with a calloc() Fixes: 0fca931a6f21 ("samples/bpf: program demonstrating access to xdp_rxq_info") Signed-off-by: Gaurav Singh --- samples/bpf/xdp

Re: [PATCH] mptcp: fix memory leak in mptcp_subflow_create_socket()

2020-06-12 Thread Mat Martineau
Hello Wei, On Fri, 12 Jun 2020, Wei Yongjun wrote: socket malloced by sock_create_kern() should be release before return in the error handling, otherwise it cause memory leak. unreferenced object 0x88810910c000 (size 1216): comm "0003_test_m", pid 12238, jiffies 4295050289 (age 54.

[PATCH] proc: Use new_inode not new_inode_pseudo

2020-06-12 Thread Eric W. Biederman
Recently syzbot reported that unmounting proc when there is an ongoing inotify watch on the root directory of proc could result in a use after free when the watch is removed after the unmount of proc when the watcher exits. Commit 69879c01a0c3 ("proc: Remove the now unnecessary internal mount of

Re: [PATCH 1/2] docs: mm/gup: pin_user_pages.rst: add a "case 5"

2020-06-12 Thread Matthew Wilcox
On Fri, May 29, 2020 at 04:43:08PM -0700, John Hubbard wrote: > +CASE 5: Pinning in order to write to the data within the page > +- > +Even though neither DMA nor Direct IO is involved, just a simple case of > "pin, > +access page's data,

[PATCH bpf] libbpf: support pre-initializing .bss global variables

2020-06-12 Thread Andrii Nakryiko
Remove invalid assumption in libbpf that .bss map doesn't have to be updated in kernel. With addition of skeleton and memory-mapped initialization image, .bss doesn't have to be all zeroes when BPF map is created, because user-code might have initialized those variables from user-space. Fixes: eba

[PATCH] test_objagg: Fix potential memory leak in error handling

2020-06-12 Thread Aditya Pakki
In case of failure of check_expect_hints_stats(), the resources allocated by objagg_hints_get should be freed. The patch fixes this issue. Signed-off-by: Aditya Pakki --- lib/test_objagg.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/test_objagg.c b/lib/test_objagg

Re: [PATCH 1/2] docs: mm/gup: pin_user_pages.rst: add a "case 5"

2020-06-12 Thread John Hubbard
On 2020-06-12 12:24, Matthew Wilcox wrote: On Fri, May 29, 2020 at 04:43:08PM -0700, John Hubbard wrote: +CASE 5: Pinning in order to write to the data within the page +- +Even though neither DMA nor Direct IO is involved, just a simple

[PATCH] net: ethernet: Fix potential memory leak caused in error handling

2020-06-12 Thread Aditya Pakki
In ethoc_probe, a failure of mdiobus_register() does not release the memory allocated by mdiobus_alloc. The patch fixes this issue. Signed-off-by: Aditya Pakki --- drivers/net/ethernet/ethoc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/ethoc.c b/dr

[PATCH bpf] tools/bpftool: fix skeleton codegen

2020-06-12 Thread Andrii Nakryiko
Remove unnecessary check at the end of codegen() routine which makes codegen() to always fail and exit bpftool with error code. Positive value of variable n is not an indicator of a failure. Cc: Tobias Klauser Fixes: 2c4779eff837 ("tools, bpftool: Exit on error in function codegen") Signed-off-by

Re: [PATCH] xdp_rxq_info_user: Fix null pointer dereference. Replace malloc/memset with calloc.

2020-06-12 Thread Jesper Dangaard Brouer
On Fri, 12 Jun 2020 14:53:27 -0400 Gaurav Singh wrote: > Memset on the pointer right after malloc can cause a > null pointer deference if it failed to allocate memory. > A simple fix is to replace malloc/memset with a calloc() > > Fixes: 0fca931a6f21 ("samples/bpf: program demonstrating access t

[PATCH] rocker: fix incorrect error handling in dma_rings_init

2020-06-12 Thread Aditya Pakki
In rocker_dma_rings_init, the goto blocks in case of errors caused by the functions rocker_dma_cmd_ring_waits_alloc() and rocker_dma_ring_create() are incorrect. The patch fixes the order consistent with cleanup in rocker_dma_rings_fini(). Signed-off-by: Aditya Pakki --- drivers/net/ethernet/roc

[PATCH] net: Fix a potential incorrect error handling in rawsock_connect

2020-06-12 Thread Aditya Pakki
In rawsock_connect, the device is allocated by calling nfc_get_device. In case of incorrect bounds index, the device should be freed by calling nfc_put_device. The patch fixes this issue. Signed-off-by: Aditya Pakki --- net/nfc/rawsock.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) dif

Re: [PATCH] net: ethernet: Fix potential memory leak caused in error handling

2020-06-12 Thread Andrew Lunn
On Fri, Jun 12, 2020 at 03:06:54PM -0500, Aditya Pakki wrote: > In ethoc_probe, a failure of mdiobus_register() does not release > the memory allocated by mdiobus_alloc. The patch fixes this issue. Hi Aditya Please improve the Subject: line to indicate which driver you are fixing. A Fixes: tag w

Re: [PATCH] net: Fix a potential incorrect error handling in rawsock_connect

2020-06-12 Thread Andrew Lunn
On Fri, Jun 12, 2020 at 03:37:43PM -0500, Aditya Pakki wrote: > In rawsock_connect, the device is allocated by calling nfc_get_device. > In case of incorrect bounds index, the device should be freed by > calling nfc_put_device. The patch fixes this issue. Hi Aditya Putting nfc in the Subject: wou

Re: [Patch net] genetlink: clean up family attributes allocations

2020-06-12 Thread David Miller
From: Cong Wang Date: Fri, 12 Jun 2020 00:16:55 -0700 > genl_family_rcv_msg_attrs_parse() and genl_family_rcv_msg_attrs_free() > take a boolean parameter to determine whether allocate/free the family > attrs. This is unnecessary as we can just check family->parallel_ops. > More importantly, calle

Re: [PATCH net] ibmvnic: Flush existing work items before device removal

2020-06-12 Thread David Miller
From: Thomas Falcon Date: Fri, 12 Jun 2020 13:34:41 -0500 > Ensure that all scheduled work items have completed before continuing > with device removal and after further event scheduling has been > halted. This patch fixes a bug where a scheduled driver reset event > is processed following device

Re: [PATCH net] ibmvnic: Harden device login requests

2020-06-12 Thread David Miller
From: Thomas Falcon Date: Fri, 12 Jun 2020 13:31:39 -0500 > @@ -841,13 +841,14 @@ static int ibmvnic_login(struct net_device *netdev) > { > struct ibmvnic_adapter *adapter = netdev_priv(netdev); > unsigned long timeout = msecs_to_jiffies(3); > + int retries = 10; > int

Re: [pull request][net 00/10] mlx5 fixes 2020-06-11

2020-06-12 Thread Saeed Mahameed
On Thu, 2020-06-11 at 18:23 -0700, David Miller wrote: > From: Saeed Mahameed > Date: Thu, 11 Jun 2020 15:46:58 -0700 > > > This series introduces some fixes to mlx5 driver. > > For more information please see tag log below. > > Tag log is basically empty :-) Sorry, I will make sure to drop thi

Re: [PATCH net] net: mvneta: do not redirect frames during reconfiguration

2020-06-12 Thread Lorenzo Bianconi
> From: Lorenzo Bianconi > Date: Tue, 9 Jun 2020 00:02:39 +0200 > > > Disable frames injection in mvneta_xdp_xmit routine during hw > > re-configuration in order to avoid hardware hangs > > > > Fixes: b0a43db9087a ("net: mvneta: add XDP_TX support") > > Signed-off-by: Lorenzo Bianconi > > Loo

Re: [REGRESSION] mlx5: Driver remove during hot unplug is broken

2020-06-12 Thread Saeed Mahameed
On Fri, 2020-06-12 at 15:09 +0200, Niklas Schnelle wrote: > Hello Parav, Hello Saeed, > > our CI system for IBM Z Linux found a hang[0] when hot unplugging a > ConnectX-4 Lx VF from a z/VM guest > in Linus' current tree and added during the merge window. > Sadly it didn't happen all the time which

Re: [PATCH bpf] bpf: tcp: recv() should return 0 when the peer socket is closed

2020-06-12 Thread Alexei Starovoitov
On Fri, Jun 12, 2020 at 3:18 AM Jakub Sitnicki wrote: > > On Wed, 10 Jun 2020 12:19:43 +0200 > Sabrina Dubroca wrote: > > > If the peer is closed, we will never get more data, so > > tcp_bpf_wait_data will get stuck forever. In case we passed > > MSG_DONTWAIT to recv(), we get EAGAIN but we shoul

Re: [PATCH bpf] tools/bpftool: fix skeleton codegen

2020-06-12 Thread Tobias Klauser
On 2020-06-12 at 22:16:03 +0200, Andrii Nakryiko wrote: > Remove unnecessary check at the end of codegen() routine which makes codegen() > to always fail and exit bpftool with error code. Positive value of variable > n is not an indicator of a failure. > > Cc: Tobias Klauser > Fixes: 2c4779eff83

Re: [PATCH v2 1/7] Bluetooth: Add definitions for advertisement monitor features

2020-06-12 Thread Miao-chen Chou
Hi Marcel, The name in the mgmt-api.txt doc is "Add Advertisement Patterns Monitor Command", and Luiz changed the name from MGMT_OP_ADD_ADV_PATTERNS_MONITOR to MGMT_OP_ADD_ADV_MONITOR before applied. So we either change the doc or change the header file to match. Based on the outcome I may need to

Re: [PATCH bpf] tools/bpftool: fix skeleton codegen

2020-06-12 Thread Alexei Starovoitov
On Fri, Jun 12, 2020 at 3:05 PM Tobias Klauser wrote: > > On 2020-06-12 at 22:16:03 +0200, Andrii Nakryiko wrote: > > Remove unnecessary check at the end of codegen() routine which makes > > codegen() > > to always fail and exit bpftool with error code. Positive value of variable > > n is not an

Re: [PATCH bpf] libbpf: support pre-initializing .bss global variables

2020-06-12 Thread Alexei Starovoitov
On Fri, Jun 12, 2020 at 12:45 PM Andrii Nakryiko wrote: > > Remove invalid assumption in libbpf that .bss map doesn't have to be updated > in kernel. With addition of skeleton and memory-mapped initialization image, > .bss doesn't have to be all zeroes when BPF map is created, because user-code >

Re: [PATCH bpf 1/2] flow_dissector: reject invalid attach_flags

2020-06-12 Thread Alexei Starovoitov
On Fri, Jun 12, 2020 at 9:02 AM Lorenz Bauer wrote: > > Using BPF_PROG_ATTACH on a flow dissector program supports neither flags > nor target_fd but accepts any value. Return EINVAL if either are non-zero. > > Signed-off-by: Lorenz Bauer > Fixes: b27f7bb590ba ("flow_dissector: Move out netns_bpf

Re: [PATCH bpf] bpf: tcp: recv() should return 0 when the peer socket is closed

2020-06-12 Thread John Fastabend
Alexei Starovoitov wrote: > On Fri, Jun 12, 2020 at 3:18 AM Jakub Sitnicki wrote: > > > > On Wed, 10 Jun 2020 12:19:43 +0200 > > Sabrina Dubroca wrote: > > > > > If the peer is closed, we will never get more data, so > > > tcp_bpf_wait_data will get stuck forever. In case we passed > > > MSG_DONT

Re: [PATCH bpf] bpf: sockmap: don't attach programs to UDP sockets

2020-06-12 Thread John Fastabend
Jakub Sitnicki wrote: > On Thu, 11 Jun 2020 18:25:20 +0100 > Lorenz Bauer wrote: > > > The stream parser infrastructure isn't set up to deal with UDP > > sockets, so we mustn't try to attach programs to them. > > > > I remember making this change at some point, but I must have lost > > it while

Re: [PATCH] xdp_rxq_info_user: Fix null pointer dereference. Replace malloc/memset with calloc.

2020-06-12 Thread John Fastabend
Jesper Dangaard Brouer wrote: > On Fri, 12 Jun 2020 14:53:27 -0400 > Gaurav Singh wrote: > > > Memset on the pointer right after malloc can cause a > > null pointer deference if it failed to allocate memory. > > A simple fix is to replace malloc/memset with a calloc() > > > > Fixes: 0fca931a6f21

[PATCH v4 1/7] Bluetooth: Add definitions for advertisement monitor features

2020-06-12 Thread Miao-chen Chou
This adds support for Advertisement Monitor API. Here are the commands and events added. - Read Advertisement Monitor Feature command - Add Advertisement Pattern Monitor command - Remove Advertisement Monitor command - Advertisement Monitor Added event - Advertisement Monitor Removed event Signed-

[PATCH v4 5/7] Bluetooth: Notify adv monitor added event

2020-06-12 Thread Miao-chen Chou
This notifies management sockets on MGMT_EV_ADV_MONITOR_ADDED event. The following test was performed. - Start two btmgmt consoles, issue a btmgmt advmon-add command on one console and observe a MGMT_EV_ADV_MONITOR_ADDED event on the other Signed-off-by: Miao-chen Chou --- Changes in v4: None C

[PATCH v4 4/7] Bluetooth: Add handler of MGMT_OP_REMOVE_ADV_MONITOR

2020-06-12 Thread Miao-chen Chou
This adds the request handler of MGMT_OP_REMOVE_ADV_MONITOR command. Note that the controller-based monitoring is not yet in place. This removes the internal monitor(s) without sending HCI traffic, so the request returns immediately. The following test was performed. - Issue btmgmt advmon-remove w

[PATCH v4 2/7] Bluetooth: Add handler of MGMT_OP_READ_ADV_MONITOR_FEATURES

2020-06-12 Thread Miao-chen Chou
This adds the request handler of MGMT_OP_READ_ADV_MONITOR_FEATURES command. Since the controller-based monitoring is not yet in place, this report only the supported features but not the enabled features. The following test was performed. - Issuing btmgmt advmon-features. Signed-off-by: Miao-chen

[PATCH v4 7/7] Bluetooth: Update background scan and report device based on advertisement monitors

2020-06-12 Thread Miao-chen Chou
This calls hci_update_background_scan() when there is any update on the advertisement monitors. If there is at least one advertisement monitor, the filtering policy of scan parameters should be 0x00. This also reports device found mgmt events if there is at least one monitor. The following cases w

[PATCH v4 3/7] Bluetooth: Add handler of MGMT_OP_ADD_ADV_PATTERNS_MONITOR

2020-06-12 Thread Miao-chen Chou
This adds the request handler of MGMT_OP_ADD_ADV_PATTERNS_MONITOR command. Note that the controller-based monitoring is not yet in place. This tracks the content of the monitor without sending HCI traffic, so the request returns immediately. The following manual test was performed. - Issue btmgmt

[PATCH v4 6/7] Bluetooth: Notify adv monitor removed event

2020-06-12 Thread Miao-chen Chou
This notifies management sockets on MGMT_EV_ADV_MONITOR_REMOVED event. The following test was performed. - Start two btmgmt consoles, issue a btmgmt advmon-remove command on one console and observe a MGMT_EV_ADV_MONITOR_REMOVED event on the other. Signed-off-by: Miao-chen Chou --- Changes in v4

  1   2   >