[PATCH bpf 2/2] xsk: fix to reject invalid options in Tx descriptor

2019-03-07 Thread Björn Töpel
From: Björn Töpel Passing a non-existing option in the options member of struct xdp_desc, incorrectly, silently ignored. This patch addresses that behavior, and drops any Tx descriptor with non-existing options. We have examined existing user space code, and to our best knowledge, no one is rely

[PATCH bpf 0/2] xsk: fix non-existing flag/option behavior

2019-03-07 Thread Björn Töpel
These two patches addresses the behavior of xsk_bind and Tx descriptor validation, when non-existing flags are set. Thanks, Björn Björn Töpel (2): xsk: fix to reject invalid flags in xsk_bind xsk: fix to reject invalid options in Tx descriptor net/xdp/xsk.c | 5 - net/xdp/xsk_qu

[PATCH bpf 1/2] xsk: fix to reject invalid flags in xsk_bind

2019-03-07 Thread Björn Töpel
From: Björn Töpel Passing a non-existing flag in the sxdp_flags member of struct sockaddr_xdp was, incorrectly, silently ignored. This patch addresses that behavior, and rejects any non-existing flags. We have examined existing user space code, and to our best knowledge, no one is relying on the

[PATCH net] sctp: remove sched init from sctp_stream_init

2019-03-07 Thread Xin Long
syzbot reported a NULL-ptr deref caused by that sched->init() in sctp_stream_init() set stream->rr_next = NULL. kasan: GPF could be caused by NULL-ptr deref or user memory access RIP: 0010:sctp_sched_rr_dequeue+0xd3/0x170 net/sctp/stream_sched_rr.c:141 Call Trace: sctp_outq_dequeue_data

[PATCH net] pptp: dst_release sk_dst_cache in pptp_sock_destruct

2019-03-07 Thread Xin Long
sk_setup_caps() is called to set sk->sk_dst_cache in pptp_connect, so we have to dst_release(sk->sk_dst_cache) in pptp_sock_destruct, otherwise, the dst refcnt will leak. It can be reproduced by this syz log: r1 = socket$pptp(0x18, 0x1, 0x2) bind$pptp(r1, &(0x7f000100)={0x18, 0x2, {0x0, @

[PATCH net] route: set the deleted fnhe fnhe_daddr to 0 in ip_del_fnhe to fix a race

2019-03-07 Thread Xin Long
The race occurs in __mkroute_output() when 2 threads lookup a dst: CPU A CPU B find_exception() find_exception() [fnhe expires] ip_del_fnhe() [fnhe is deleted] rt_bind_exception() In rt_bind_exception() it will bind a deleted f

Re: [PATCH 2/2] net: bonding: fix incorrect type in assignment

2019-03-07 Thread Jay Vosburgh
Bo YU wrote: >There are some warning when: > >sudo make C=1 CF=-D__CHECK_ENDIAN__ drivers/net/bonding/ > >drivers/net/bonding/bond_main.c:2438:40: warning: incorrect type in assignment >(different base types) >drivers/net/bonding/bond_main.c:2438:40:expected restricted __be16 >[usertype] vl

[PATCH V3] bpf: fix warning about using plain integer as NULL

2019-03-07 Thread Bo YU
Sparse warning below: sudo make C=2 CF=-D__CHECK_ENDIAN__ M=net/bpf/ CHECK net/bpf//test_run.c net/bpf//test_run.c:19:77: warning: Using plain integer as NULL pointer ./include/linux/bpf-cgroup.h:295:77: warning: Using plain integer as NULL pointer Fixes: 8bad74f9840f ("bpf: extend cgroup bpf

Re: [PATCH net] net: selinux: fix memory leak in selinux_netlbl_socket_post_create()

2019-03-07 Thread maowenan
On 2019/3/8 4:36, Paul Moore wrote: > On Wed, Mar 6, 2019 at 9:44 PM Mao Wenan wrote: >> >> If netlbl_sock_setattr() is failed, it directly returns rc and forgets >> to free secattr. >> >> BUG: memory leak >> unreferenced object 0x8883c3ea4200 (size 2664): >> comm "syz-executor.2", pid 88

Re: [PATCH V2] bpf: fix warning about using plain integer as NULL

2019-03-07 Thread Y Song
On Thu, Mar 7, 2019 at 10:12 PM Bo YU wrote: > > Sparse warning below: > > sudo make C=2 CF=-D__CHECK_ENDIAN__ M=net/bpf/ > CHECK net/bpf//test_run.c > net/bpf//test_run.c:19:77: warning: Using plain integer as NULL pointer > ./include/linux/bpf-cgroup.h:295:77: warning: Using plain integer as N

[PATCH V2] bpf: fix warning about using plain integer as NULL

2019-03-07 Thread Bo YU
Sparse warning below: sudo make C=2 CF=-D__CHECK_ENDIAN__ M=net/bpf/ CHECK net/bpf//test_run.c net/bpf//test_run.c:19:77: warning: Using plain integer as NULL pointer ./include/linux/bpf-cgroup.h:295:77: warning: Using plain integer as NULL pointer Fixes: 8bad74f9840f ("bpf: extend cgroup bpf

Re: [Linuxptp-devel] strangeness

2019-03-07 Thread Harini Katakam
Hi Paul, On Fri, Mar 8, 2019 at 12:33 AM Paul Thomas wrote: > > On Thu, Mar 7, 2019 at 12:32 AM Harini Katakam wrote: > > > > Hi Paul, > > On Thu, Mar 7, 2019 at 4:38 AM Paul Thomas wrote: > > > > > > On Fri, Mar 1, 2019 at 1:24 AM Harini Katakam wrote: > > > > > > > > +netdev > > > > > > > > H

Re: [PATCH] bpf: fix warning about using plain integer as NULL

2019-03-07 Thread Yonghong Song
On 3/7/19 8:39 PM, Bo YU wrote: > Sparse warning below: > > sudo make C=2 CF=-D__CHECK_ENDIAN__ M=net/bpf/ > CHECK net/bpf//test_run.c > net/bpf//test_run.c:19:77: warning: Using plain integer as NULL pointer > ./include/linux/bpf-cgroup.h:295:77: warning: Using plain integer as NULL > pointe

[PATCH 2/2] net: bonding: fix incorrect type in assignment

2019-03-07 Thread Bo YU
There are some warning when: sudo make C=1 CF=-D__CHECK_ENDIAN__ drivers/net/bonding/ drivers/net/bonding/bond_main.c:2438:40: warning: incorrect type in assignment (different base types) drivers/net/bonding/bond_main.c:2438:40:expected restricted __be16 [usertype] vlan_proto drivers/net/bo

[PATCH 0/2] net: bonding: fix sparse warning

2019-03-07 Thread Bo YU
Bo YU (2): net: bonding: fix restricted __be16 degrades to integer net: bonding: fix incorrect type in assignment drivers/net/bonding/bond_main.c| 8 drivers/net/bonding/bond_options.c | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) -- 2.11.0

[PATCH 1/2] net: bonding: fix restricted __be16 degrades to integer

2019-03-07 Thread Bo YU
There are some warning when: sudo make C=1 CF=-D__CHECK_ENDIAN__ drivers/net/bonding/ drivers/net/bonding/bond_main.c:2385:26: warning: restricted __be16 degrades to integer drivers/net/bonding/bond_main.c:2391:20: warning: restricted __be16 degrades to integer ... drivers/net/bonding/bond_main

Re: [PATCH v3 bpf]: libbpf: fixing leak when kernel does not support btf

2019-03-07 Thread Yonghong Song
On 3/7/19 9:18 PM, Nikita V. Shirokov wrote: > we could end up in situation when we have object file w/ all btf > info but kernel does not support btf yet. in this situation currently > libbpf just set obj->btf to NULL w/o freeing it first. > this patch if fixing it by making sure to run btf__fre

[PATCH v3 bpf]: libbpf: fixing leak when kernel does not support btf

2019-03-07 Thread Nikita V. Shirokov
we could end up in situation when we have object file w/ all btf info but kernel does not support btf yet. in this situation currently libbpf just set obj->btf to NULL w/o freeing it first. this patch if fixing it by making sure to run btf__free first v2->v3: - adding "Fixes" tag v1->v2: - addi

[PATCH] bpf: fix warning about using plain integer as NULL

2019-03-07 Thread Bo YU
Sparse warning below: sudo make C=2 CF=-D__CHECK_ENDIAN__ M=net/bpf/ CHECK net/bpf//test_run.c net/bpf//test_run.c:19:77: warning: Using plain integer as NULL pointer ./include/linux/bpf-cgroup.h:295:77: warning: Using plain integer as NULL pointer Signed-off-by: Bo YU --- include/linux/bpf-

[PATCH v2 bpf]: libbpf: fixing leak when kernel does not support btf

2019-03-07 Thread Nikita V. Shirokov
we could end up in situation when we have object file w/ all btf info but kernel does not support btf yet. in this situation currently libbpf just set obj->btf to NULL w/o freeing it first. this patch if fixing it by making sure to run btf__free first v1->v2: - adding netdev to cc Signed-off-by:

[PATCH] net: stmmac: Avoid one more sometimes uninitialized Clang warning

2019-03-07 Thread Nathan Chancellor
When building with -Wsometimes-uninitialized, Clang warns: drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c:111:2: error: variable 'ns' is used uninitialized whenever 'if' condition is false [-Werror,-Wsometimes-uninitialized] drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c:111:2: error: variable

Re: [PATCH net 1/3] sctp: sctp_sock_migrate() returns error if sctp_bind_addr_dup() fails

2019-03-07 Thread Xin Long
On Fri, Mar 8, 2019 at 2:25 AM Marcelo Ricardo Leitner wrote: > > On Sun, Mar 03, 2019 at 05:54:53PM +0800, Xin Long wrote: > > It should fail to create the new sk if sctp_bind_addr_dup() fails > > when accepting or peeloff an association. > > > > Signed-off-by: Xin Long > > --- > > net/sctp/soc

Re: [RFC PATCH V2 5/5] vhost: access vq metadata through kernel virtual address

2019-03-07 Thread Jerome Glisse
On Thu, Mar 07, 2019 at 10:43:12PM -0500, Michael S. Tsirkin wrote: > On Thu, Mar 07, 2019 at 10:40:53PM -0500, Jerome Glisse wrote: > > On Thu, Mar 07, 2019 at 10:16:00PM -0500, Michael S. Tsirkin wrote: > > > On Thu, Mar 07, 2019 at 09:55:39PM -0500, Jerome Glisse wrote: > > > > On Thu, Mar 07, 2

Re: [RFC PATCH V2 5/5] vhost: access vq metadata through kernel virtual address

2019-03-07 Thread Michael S. Tsirkin
On Thu, Mar 07, 2019 at 10:40:53PM -0500, Jerome Glisse wrote: > On Thu, Mar 07, 2019 at 10:16:00PM -0500, Michael S. Tsirkin wrote: > > On Thu, Mar 07, 2019 at 09:55:39PM -0500, Jerome Glisse wrote: > > > On Thu, Mar 07, 2019 at 09:21:03PM -0500, Michael S. Tsirkin wrote: > > > > On Thu, Mar 07, 2

Re: [RFC PATCH V2 5/5] vhost: access vq metadata through kernel virtual address

2019-03-07 Thread Jerome Glisse
On Thu, Mar 07, 2019 at 10:16:00PM -0500, Michael S. Tsirkin wrote: > On Thu, Mar 07, 2019 at 09:55:39PM -0500, Jerome Glisse wrote: > > On Thu, Mar 07, 2019 at 09:21:03PM -0500, Michael S. Tsirkin wrote: > > > On Thu, Mar 07, 2019 at 02:17:20PM -0500, Jerome Glisse wrote: > > > > > It's because of

Re: [PATCH 1/8] aio: make sure file is pinned

2019-03-07 Thread Al Viro
On Wed, Mar 06, 2019 at 05:30:21PM -0800, Linus Torvalds wrote: > On Wed, Mar 6, 2019 at 5:20 PM Al Viro wrote: > > > > I'll try to massage that series on top of your patch; I still hate the > > post-vfs_poll() logics in aio_poll() ;-/ Give me about half an hour > > and I'll have something to pos

Re: [RFC PATCH V2 5/5] vhost: access vq metadata through kernel virtual address

2019-03-07 Thread Michael S. Tsirkin
On Thu, Mar 07, 2019 at 09:55:39PM -0500, Jerome Glisse wrote: > On Thu, Mar 07, 2019 at 09:21:03PM -0500, Michael S. Tsirkin wrote: > > On Thu, Mar 07, 2019 at 02:17:20PM -0500, Jerome Glisse wrote: > > > > It's because of all these issues that I preferred just accessing > > > > userspace memory a

Re: [RFC PATCH V2 5/5] vhost: access vq metadata through kernel virtual address

2019-03-07 Thread Jerome Glisse
On Thu, Mar 07, 2019 at 09:21:03PM -0500, Michael S. Tsirkin wrote: > On Thu, Mar 07, 2019 at 02:17:20PM -0500, Jerome Glisse wrote: > > > It's because of all these issues that I preferred just accessing > > > userspace memory and handling faults. Unfortunately there does not > > > appear to exist

Re: [PATCH net-next v2 4/7] devlink: allow subports on devlink PCI ports

2019-03-07 Thread Jakub Kicinski
On Thu, 7 Mar 2019 10:48:16 +0100, Jiri Pirko wrote: > Wed, Mar 06, 2019 at 06:56:38PM CET, jakub.kicin...@netronome.com wrote: > >On Wed, 6 Mar 2019 13:20:37 +0100, Jiri Pirko wrote: > >For creating subdevices, I don't think the handle should ever be port. > >We create new ports on a devlink ins

Re: [RFC PATCH V2 5/5] vhost: access vq metadata through kernel virtual address

2019-03-07 Thread Michael S. Tsirkin
On Thu, Mar 07, 2019 at 02:17:20PM -0500, Jerome Glisse wrote: > > It's because of all these issues that I preferred just accessing > > userspace memory and handling faults. Unfortunately there does not > > appear to exist an API that whitelists a specific driver along the lines > > of "I checked t

Re: [net-next PATCH] net/rds: Return proper "tos" value to user-space

2019-03-07 Thread santosh.shilim...@oracle.com
On 3/7/19 2:01 PM, Gerd Rausch wrote: The proper "tos" value needs to be returned to user-space (sockopt RDS_INFO_CONNECTIONS). Fixes: 3eb450367d08 ("rds: add type of service(tos) infrastructure") Signed-off-by: Gerd Rausch --- net/rds/connection.c | 1 + 1 file changed, 1 insertion(+) diff

Re: [net-next PATCH] net/rds: Return proper "tos" value to user-space

2019-03-07 Thread Yanjun Zhu
On 2019/3/8 6:01, Gerd Rausch wrote: The proper "tos" value needs to be returned to user-space (sockopt RDS_INFO_CONNECTIONS). Fixes: 3eb450367d08 ("rds: add type of service(tos) infrastructure") Signed-off-by: Gerd Rausch In RDS/IB, tos is set in this function. Do you still use RoCE device

-Wsometimes-uninitialized Clang warning in drivers/net/ethernet/broadcom/bnxt/bnxt.c

2019-03-07 Thread Nathan Chancellor
Hi all, We are trying to get Clang's -Wsometimes-uninitialized turned on for the kernel as it can catch some bugs that GCC can't. This warning came up: drivers/net/ethernet/broadcom/bnxt/bnxt.c:1612:6: warning: variable 'len' is used uninitialized whenever 'if' condition is true [-Wsometimes-uni

[PATCH net] net: dsa: mv88e6xxx: Set correct interface mode for CPU/DSA ports

2019-03-07 Thread Andrew Lunn
By default, the switch driver is expected to configure CPU and DSA ports to their maximum speed. For the 6341 and 6390 families, the ports interface mode has to be configured as well. The 6390X range support 10G ports using XAUI, while the 6341 and 6390 supports 2500BaseX, as their maximum speed.

-Wsometimes-uninitialized Clang warning in net/tipc/node.c

2019-03-07 Thread Nathan Chancellor
Hi all, We are trying to get Clang's -Wsometimes-uninitialized turned on for the kernel as it can catch some bugs that GCC can't. This warning came up: net/tipc/node.c:831:6: warning: variable 'maddr' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized] if (

Re: [PATCH] net: ethernet: sun: Zero initialize class in default case in niu_add_ethtool_tcam_entry

2019-03-07 Thread Nick Desaulniers
On Thu, Mar 7, 2019 at 3:29 PM Nathan Chancellor wrote: > > When building with -Wsometimes-uninitialized, Clang warns: > > drivers/net/ethernet/sun/niu.c:7466:5: warning: variable 'class' is used > uninitialized whenever switch default is taken > [-Wsometimes-uninitialized] > > The default case ca

Re: [PATCH] cfg80211: Change an 'else if' into an 'else' in cfg80211_calculate_bitrate_he

2019-03-07 Thread Nick Desaulniers
On Thu, Mar 7, 2019 at 3:57 PM Nathan Chancellor wrote: > > When building with -Wsometimes-uninitialized, Clang warns: > > net/wireless/util.c:1223:11: warning: variable 'result' is used > uninitialized whenever 'if' condition is false > [-Wsometimes-uninitialized] > > Clang can't evaluate at this

Re: [PATCH] iwlwifi: mvm: Change an 'else if' into an 'else' in iwl_mvm_send_add_bcast_sta

2019-03-07 Thread Nick Desaulniers
On Thu, Mar 7, 2019 at 4:03 PM Nathan Chancellor wrote: > > When building with -Wsometimes-uninitialized, Clang warns: > > drivers/net/wireless/intel/iwlwifi/mvm/sta.c:2114:12: warning: variable > 'queue' is used uninitialized whenever 'if' condition is false > [-Wsometimes-uninitialized] > > Clan

[PATCH] iwlwifi: mvm: Change an 'else if' into an 'else' in iwl_mvm_send_add_bcast_sta

2019-03-07 Thread Nathan Chancellor
When building with -Wsometimes-uninitialized, Clang warns: drivers/net/wireless/intel/iwlwifi/mvm/sta.c:2114:12: warning: variable 'queue' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized] Clang can't evaluate at this point that WARN(1, ...) always returns true be

[PATCH] cfg80211: Change an 'else if' into an 'else' in cfg80211_calculate_bitrate_he

2019-03-07 Thread Nathan Chancellor
When building with -Wsometimes-uninitialized, Clang warns: net/wireless/util.c:1223:11: warning: variable 'result' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized] Clang can't evaluate at this point that WARN(1, ...) always returns true because __ret_warn_on is d

Re: [PATCH v7 perf,bpf 11/15] perf: add -lopcodes to feature-libbfd

2019-03-07 Thread Song Liu
> On Mar 7, 2019, at 3:26 PM, Stanislav Fomichev wrote: > > On 03/07, Song Liu wrote: >> Both libbfd and libopcodes are distributed with binutil-dev/devel. When >> libbfd presents, it is OK to assume libopcodes also presents. This has >> been a safe assumption for bpftool. >> >> This patch ad

[PATCH] net: ethernet: sun: Zero initialize class in default case in niu_add_ethtool_tcam_entry

2019-03-07 Thread Nathan Chancellor
When building with -Wsometimes-uninitialized, Clang warns: drivers/net/ethernet/sun/niu.c:7466:5: warning: variable 'class' is used uninitialized whenever switch default is taken [-Wsometimes-uninitialized] The default case can never happen because i can only be 0 to 3 (NIU_L3_PROG_CLS is defined

Re: [PATCH v7 perf,bpf 11/15] perf: add -lopcodes to feature-libbfd

2019-03-07 Thread Stanislav Fomichev
On 03/07, Song Liu wrote: > Both libbfd and libopcodes are distributed with binutil-dev/devel. When > libbfd presents, it is OK to assume libopcodes also presents. This has > been a safe assumption for bpftool. > > This patch adds -lopcodes to perf/Makefile.config. libopcodes will be > used in the

RE: [RFC net-next 0/8] Introducing subdev bus and devlink extension

2019-03-07 Thread Parav Pandit
> -Original Message- > From: Kirti Wankhede > Sent: Thursday, March 7, 2019 4:02 PM > To: Parav Pandit ; Jakub Kicinski > > Cc: Or Gerlitz ; netdev@vger.kernel.org; linux- > ker...@vger.kernel.org; michal.l...@markovi.net; da...@davemloft.net; > gre...@linuxfoundation.org; Jiri Pirko ;

Re: [PATCH] [v2] ethtool: reduce stack usage with clang

2019-03-07 Thread Arnd Bergmann
On Thu, Mar 7, 2019 at 6:46 PM David Miller wrote: > > From: Arnd Bergmann > Date: Thu, 7 Mar 2019 16:58:35 +0100 > > > clang inlines the dev_ethtool() more aggressively than gcc does, leading > > to a larger amount of used stack space: > > > > net/core/ethtool.c:2536:24: error: stack frame size

Re: [RFC net-next 0/8] Introducing subdev bus and devlink extension

2019-03-07 Thread Kirti Wankhede
On 3/8/2019 2:51 AM, Parav Pandit wrote: > > >> -Original Message- >> From: Kirti Wankhede >> Sent: Thursday, March 7, 2019 3:08 PM >> To: Parav Pandit ; Jakub Kicinski >> >> Cc: Or Gerlitz ; netdev@vger.kernel.org; linux- >> ker...@vger.kernel.org; michal.l...@markovi.net; da...@dav

[PATCH] ath11k: fix bugon.cocci warnings

2019-03-07 Thread Julia Lawall
From: kbuild test robot Use BUG_ON instead of if condition followed by BUG. Generated by: scripts/coccinelle/misc/bugon.cocci Fixes: c105b7abf400 ("ath11k: collect DDR dump after fw crash") CC: Venkateswara Naralasetty Signed-off-by: kbuild test robot Signed-off-by: Julia Lawall --- tree:

Re: [PATCH 0/2] bpf: context casting for tail call and gtrace prog type

2019-03-07 Thread Alexei Starovoitov
On Tue, Mar 05, 2019 at 09:03:57PM -0500, Kris Van Hees wrote: > > So in summary, I am trying to solve two (related) problems: > > - Ensure that unprivileged tracing can obtain information about the task that > triggered a probe or event. There will always be limitations but we can do > bett

Re: [RFC PATCH V2 5/5] vhost: access vq metadata through kernel virtual address

2019-03-07 Thread Andrea Arcangeli
Hello Jerome, On Thu, Mar 07, 2019 at 03:17:22PM -0500, Jerome Glisse wrote: > So for the above the easiest thing is to call set_page_dirty() from > the mmu notifier callback. It is always safe to use the non locking > variant from such callback. Well it is safe only if the page was > map with wri

RE: [RFC net-next 0/8] Introducing subdev bus and devlink extension

2019-03-07 Thread Parav Pandit
> -Original Message- > From: Kirti Wankhede > Sent: Thursday, March 7, 2019 3:08 PM > To: Parav Pandit ; Jakub Kicinski > > Cc: Or Gerlitz ; netdev@vger.kernel.org; linux- > ker...@vger.kernel.org; michal.l...@markovi.net; da...@davemloft.net; > gre...@linuxfoundation.org; Jiri Pirko ;

Re: [RFC net-next 0/8] Introducing subdev bus and devlink extension

2019-03-07 Thread Kirti Wankhede
On 3/8/2019 2:32 AM, Parav Pandit wrote: > > >> -Original Message- >> From: Kirti Wankhede >> Sent: Thursday, March 7, 2019 2:54 PM >> To: Parav Pandit ; Jakub Kicinski >> >> Cc: Or Gerlitz ; netdev@vger.kernel.org; linux- >> ker...@vger.kernel.org; michal.l...@markovi.net; da...@dav

RE: [RFC net-next 0/8] Introducing subdev bus and devlink extension

2019-03-07 Thread Parav Pandit
> -Original Message- > From: Kirti Wankhede > Sent: Thursday, March 7, 2019 2:54 PM > To: Parav Pandit ; Jakub Kicinski > > Cc: Or Gerlitz ; netdev@vger.kernel.org; linux- > ker...@vger.kernel.org; michal.l...@markovi.net; da...@davemloft.net; > gre...@linuxfoundation.org; Jiri Pirko ;

Re: [RFC net-next 0/8] Introducing subdev bus and devlink extension

2019-03-07 Thread Kirti Wankhede
>>> >>> Yes. I got my patches to adapt to mdev way. Will be posting RFC v2 soon. >>> Will wait for a day to receive more comments/views from Greg and others. >>> >>> As I explained in this cover-letter and discussion, First use case is >>> to create and use mdevs in the host (and not in VM). >

Re: [PATCH net] net: selinux: fix memory leak in selinux_netlbl_socket_post_create()

2019-03-07 Thread Paul Moore
On Wed, Mar 6, 2019 at 9:44 PM Mao Wenan wrote: > > If netlbl_sock_setattr() is failed, it directly returns rc and forgets > to free secattr. > > BUG: memory leak > unreferenced object 0x8883c3ea4200 (size 2664): > comm "syz-executor.2", pid 8813, jiffies 4297264419 (age 156.090s) > hex du

RE: [RFC net-next 0/8] Introducing subdev bus and devlink extension

2019-03-07 Thread Parav Pandit
> -Original Message- > From: Kirti Wankhede > Sent: Thursday, March 7, 2019 1:04 PM > To: Parav Pandit ; Jakub Kicinski > > Cc: Or Gerlitz ; netdev@vger.kernel.org; linux- > ker...@vger.kernel.org; michal.l...@markovi.net; da...@davemloft.net; > gre...@linuxfoundation.org; Jiri Pirko ;

Re: [RFC PATCH V2 5/5] vhost: access vq metadata through kernel virtual address

2019-03-07 Thread Jerome Glisse
On Thu, Mar 07, 2019 at 02:38:38PM -0500, Andrea Arcangeli wrote: > On Thu, Mar 07, 2019 at 02:09:10PM -0500, Jerome Glisse wrote: > > I thought this patch was only for anonymous memory ie not file back ? > > Yes, the other common usages are on hugetlbfs/tmpfs that also don't > need to implement w

Re: [RFC PATCH V2 5/5] vhost: access vq metadata through kernel virtual address

2019-03-07 Thread Andrea Arcangeli
On Thu, Mar 07, 2019 at 02:09:10PM -0500, Jerome Glisse wrote: > I thought this patch was only for anonymous memory ie not file back ? Yes, the other common usages are on hugetlbfs/tmpfs that also don't need to implement writeback and are obviously safe too. > If so then set dirty is mostly usele

Re: [PATCH RFC v2] mac80211: debugfs option to force TX status frames

2019-03-07 Thread ga58taw
On Thu, Mar 07, 2019 at 05:42:04PM +0200, Kalle Valo wrote: > > + len = scnprintf(buf, sizeof(buf), "%d\n", (int)local->force_tx_status); > > I wonder about the cast, is it guaranteed that a bool is always of the > same size as an int? Why is this a problem? If a bool is smaller than an int, the

Re: [RFC PATCH V2 5/5] vhost: access vq metadata through kernel virtual address

2019-03-07 Thread Jerome Glisse
On Thu, Mar 07, 2019 at 12:56:45PM -0500, Michael S. Tsirkin wrote: > On Thu, Mar 07, 2019 at 10:47:22AM -0500, Michael S. Tsirkin wrote: > > On Wed, Mar 06, 2019 at 02:18:12AM -0500, Jason Wang wrote: > > > +static const struct mmu_notifier_ops vhost_mmu_notifier_ops = { > > > + .invalidate_range

Re: [RFC PATCH V2 5/5] vhost: access vq metadata through kernel virtual address

2019-03-07 Thread Andrea Arcangeli
On Thu, Mar 07, 2019 at 12:56:45PM -0500, Michael S. Tsirkin wrote: > On Thu, Mar 07, 2019 at 10:47:22AM -0500, Michael S. Tsirkin wrote: > > On Wed, Mar 06, 2019 at 02:18:12AM -0500, Jason Wang wrote: > > > +static const struct mmu_notifier_ops vhost_mmu_notifier_ops = { > > > + .invalidate_range

Re: [PATCH v2] vsock/virtio: fix kernel panic from virtio_transport_reset_no_sock

2019-03-07 Thread Stefano Garzarella
On Wed, Mar 6, 2019 at 11:13 AM Adalbert Lazăr wrote: > > Previous to commit 22b5c0b63f32 ("vsock/virtio: fix kernel panic > after device hot-unplug"), vsock_core_init() was called from > virtio_vsock_probe(). Now, virtio_transport_reset_no_sock() can be called > before vsock_core_init() has the c

Re: [RFC PATCH V2 5/5] vhost: access vq metadata through kernel virtual address

2019-03-07 Thread Jerome Glisse
On Thu, Mar 07, 2019 at 10:34:39AM -0500, Michael S. Tsirkin wrote: > On Thu, Mar 07, 2019 at 10:45:57AM +0800, Jason Wang wrote: > > > > On 2019/3/7 上午12:31, Michael S. Tsirkin wrote: > > > > +static void vhost_set_vmap_dirty(struct vhost_vmap *used) > > > > +{ > > > > + int i; > > > > + >

Re: [RFC net-next 0/8] Introducing subdev bus and devlink extension

2019-03-07 Thread Kirti Wankhede
CC += Alex On 3/6/2019 11:12 AM, Parav Pandit wrote: > Hi Kirti, > >> -Original Message- >> From: Kirti Wankhede >> Sent: Tuesday, March 5, 2019 9:51 PM >> To: Parav Pandit ; Jakub Kicinski >> >> Cc: Or Gerlitz ; netdev@vger.kernel.org; linux- >> ker...@vger.kernel.org; michal.l...@mark

Re: [Linuxptp-devel] strangeness

2019-03-07 Thread Paul Thomas
On Thu, Mar 7, 2019 at 12:32 AM Harini Katakam wrote: > > Hi Paul, > On Thu, Mar 7, 2019 at 4:38 AM Paul Thomas wrote: > > > > On Fri, Mar 1, 2019 at 1:24 AM Harini Katakam wrote: > > > > > > +netdev > > > > > > Hi Paul, > > > On Fri, Mar 1, 2019 at 12:29 AM Richard Cochran > > > wrote: > > > >

Re: [PATCH net] net/hsr: fix possible crash in add_timer()

2019-03-07 Thread David Miller
From: Eric Dumazet Date: Thu, 7 Mar 2019 09:36:33 -0800 > syzbot found another add_timer() issue, this time in net/hsr [1] > > Let's use mod_timer() which is safe. ... > Fixes: f421436a591d ("net/hsr: Add support for the High-availability Seamless > Redundancy protocol (HSRv0)") > Signed-off-

Re: [PATCH net] nfp: fix simple vNIC mailbox length

2019-03-07 Thread David Miller
From: Jakub Kicinski Date: Thu, 7 Mar 2019 10:52:13 -0800 > From: Dirk van der Merwe > > The simple vNIC mailbox length should be 12 decimal and not 0x12. > Using a decimal also makes it clear this is a length value and not > another field within the simple mailbox defines. > > Found by code

Re: [PATCH v2] net: stmmac: Avoid sometimes uninitialized Clang warnings

2019-03-07 Thread David Miller
From: Nathan Chancellor Date: Thu, 7 Mar 2019 11:00:28 -0700 > When building with -Wsometimes-uninitialized, Clang warns: > > drivers/net/ethernet/stmicro/stmmac/stmmac_main.c:495:3: warning: variable > 'ns' is used uninitialized whenever 'if' condition is false > [-Wsometimes-uninitialized]

Re: [PATCH] net: atm: Add another IS_ENABLED(CONFIG_COMPAT) in atm_dev_ioctl

2019-03-07 Thread David Miller
From: Nathan Chancellor Date: Thu, 7 Mar 2019 11:11:26 -0700 > I removed compat's universal assignment to 0, which allows this if > statement to fall through when compat is passed with a value other > than 0. > > Fixes: f9d19a7494e5 ("net: atm: Use IS_ENABLED in atm_dev_ioctl") > Signed-off-by:

[PATCH net] nfp: fix simple vNIC mailbox length

2019-03-07 Thread Jakub Kicinski
From: Dirk van der Merwe The simple vNIC mailbox length should be 12 decimal and not 0x12. Using a decimal also makes it clear this is a length value and not another field within the simple mailbox defines. Found by code inspection, there are no known firmware configurations where this would cau

KASAN: use-after-free Read in dst_dev_put

2019-03-07 Thread syzbot
Hello, syzbot found the following crash on: HEAD commit:7d762d69145a afs: Fix manually set volume location server .. git tree: upstream console output: https://syzkaller.appspot.com/x/log.txt?x=17ebb8ecc0 kernel config: https://syzkaller.appspot.com/x/.config?x=b76ec970784287c das

general protection fault in __queue_work

2019-03-07 Thread syzbot
Hello, syzbot found the following crash on: HEAD commit:3717f613f48d Merge branch 'core-rcu-for-linus' of git://gi.. git tree: upstream console output: https://syzkaller.appspot.com/x/log.txt?x=156e100b20 kernel config: https://syzkaller.appspot.com/x/.config?x=73d88a42238825ad da

Re: [PATCH net 1/3] sctp: sctp_sock_migrate() returns error if sctp_bind_addr_dup() fails

2019-03-07 Thread Marcelo Ricardo Leitner
On Sun, Mar 03, 2019 at 05:54:53PM +0800, Xin Long wrote: > It should fail to create the new sk if sctp_bind_addr_dup() fails > when accepting or peeloff an association. > > Signed-off-by: Xin Long > --- > net/sctp/socket.c | 34 -- > 1 file changed, 24 insertions

KASAN: slab-out-of-bounds Read in tcp_sk_exit

2019-03-07 Thread syzbot
Hello, syzbot found the following crash on: HEAD commit:e15aa3b2b138 ucc_geth: Reset BQL queue when stopping device git tree: net console output: https://syzkaller.appspot.com/x/log.txt?x=149b240f40 kernel config: https://syzkaller.appspot.com/x/.config?x=4fceea9e2d99ac20 dashboar

Re: [PATCH v2] net: stmmac: Avoid sometimes uninitialized Clang warnings

2019-03-07 Thread Nick Desaulniers
On Thu, Mar 7, 2019 at 10:00 AM Nathan Chancellor wrote: > > When building with -Wsometimes-uninitialized, Clang warns: > > drivers/net/ethernet/stmicro/stmmac/stmmac_main.c:495:3: warning: variable > 'ns' is used uninitialized whenever 'if' condition is false > [-Wsometimes-uninitialized] > dri

[PATCH] net: atm: Add another IS_ENABLED(CONFIG_COMPAT) in atm_dev_ioctl

2019-03-07 Thread Nathan Chancellor
I removed compat's universal assignment to 0, which allows this if statement to fall through when compat is passed with a value other than 0. Fixes: f9d19a7494e5 ("net: atm: Use IS_ENABLED in atm_dev_ioctl") Signed-off-by: Nathan Chancellor --- Sorry for not paying more attention :( net/atm/re

[PATCH v7 perf,bpf 15/15] perf, bpf: save bpf_prog_info and btf of short living bpf programs

2019-03-07 Thread Song Liu
To fully annotate BPF programs with source code mapping, 4 different information are needed: 1) PERF_RECORD_KSYMBOL 2) PERF_RECORD_BPF_EVENT 3) bpf_prog_info 4) btf This patch handles 3) and 4) for short living BPF programs. For timely process of these information, a dedicated even

[PATCH v7 perf,bpf 09/15] perf, bpf: save btf information as headers to perf.data

2019-03-07 Thread Song Liu
This patch enables perf-record to save btf information as headers to perf.data A new header type HEADER_BPF_BTF is introduced for this data. Signed-off-by: Song Liu --- tools/perf/util/header.c | 107 ++- tools/perf/util/header.h | 1 + 2 files changed, 107

[PATCH v7 perf,bpf 10/15] perf-top: add option --no-bpf-event

2019-03-07 Thread Song Liu
bpf events should be tracked by default for perf-top. This patch makes it on by default, and adds option to disable bpf events. Signed-off-by: Song Liu --- tools/perf/builtin-top.c | 3 +++ tools/perf/util/top.h| 1 + 2 files changed, 4 insertions(+) diff --git a/tools/perf/builtin-top.c b/

[PATCH v7 perf,bpf 13/15] perf, bpf: process PERF_BPF_EVENT_PROG_LOAD for annotation

2019-03-07 Thread Song Liu
This patch adds processing of PERF_BPF_EVENT_PROG_LOAD, which sets proper DSO type/id/etc of memory regions mapped to BPF programs to DSO_BINARY_TYPE__BPF_PROG_INFO Signed-off-by: Song Liu --- tools/perf/util/bpf-event.c | 53 + 1 file changed, 53 insertions(+

[PATCH v2] net: stmmac: Avoid sometimes uninitialized Clang warnings

2019-03-07 Thread Nathan Chancellor
When building with -Wsometimes-uninitialized, Clang warns: drivers/net/ethernet/stmicro/stmmac/stmmac_main.c:495:3: warning: variable 'ns' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized] drivers/net/ethernet/stmicro/stmmac/stmmac_main.c:495:3: warning: variable

[PATCH v7 perf,bpf 14/15] perf: introduce side band thread

2019-03-07 Thread Song Liu
This patch introduces side band thread that captures extended information for events like PERF_RECORD_BPF_EVENT. This new thread uses its own evlist that uses ring buffer with very low watermark for lower latency. To use side band thread, we need to: 1. add side band event(s) by calling perf_evl

[PATCH v7 perf,bpf 02/15] bpf: libbpf: introduce bpf_program__get_prog_info_linear()

2019-03-07 Thread Song Liu
Currently, bpf_prog_info includes 9 arrays. The user has the option to fetch any combination of these arrays. However, this requires a lot of handling of these arrays. This work becomes more tricky when we need to store bpf_prog_info to a file, because these arrays are allocated independently. Thi

[PATCH v7 perf,bpf 08/15] perf, bpf: save btf in a rbtree in perf_env

2019-03-07 Thread Song Liu
btf contains information necessary to annotate bpf programs. This patch saves btf for bpf programs loaded in the system. Signed-off-by: Song Liu --- tools/perf/util/bpf-event.c | 23 + tools/perf/util/bpf-event.h | 7 tools/perf/util/env.c | 65 +++

[PATCH v7 perf,bpf 07/15] perf, bpf: save bpf_prog_info information as headers to perf.data

2019-03-07 Thread Song Liu
This patch enables perf-record to save bpf_prog_info information as headers to perf.data. A new header type HEADER_BPF_PROG_INFO is introduced for this data. Signed-off-by: Song Liu --- tools/perf/util/header.c | 145 ++- tools/perf/util/header.h | 1 + 2 fi

[PATCH v7 perf,bpf 04/15] perf, bpf: synthesize bpf events with bpf_program__get_prog_info_linear()

2019-03-07 Thread Song Liu
With bpf_program__get_prog_info_linear, we can simplify the logic that synthesizes bpf events. This patch doesn't change the behavior of the code. Signed-off-by: Song Liu --- tools/perf/util/bpf-event.c | 118 1 file changed, 40 insertions(+), 78 deletions(-

[PATCH v7 perf,bpf 12/15] perf, bpf: enable annotation of bpf program

2019-03-07 Thread Song Liu
This patch enables the annotation of bpf program. A new dso type DSO_BINARY_TYPE__BPF_PROG_INFO is introduced to for BPF programs. In symbol__disassemble(), DSO_BINARY_TYPE__BPF_PROG_INFO dso calls into a new function symbol__disassemble_bpf(), where annotation line information is filled based bpf

[PATCH v7 perf,bpf 11/15] perf: add -lopcodes to feature-libbfd

2019-03-07 Thread Song Liu
Both libbfd and libopcodes are distributed with binutil-dev/devel. When libbfd presents, it is OK to assume libopcodes also presents. This has been a safe assumption for bpftool. This patch adds -lopcodes to perf/Makefile.config. libopcodes will be used in the next commit for bpf annotation. Sign

[PATCH v7 perf,bpf 06/15] perf, bpf: save bpf_prog_info in a rbtree in perf_env

2019-03-07 Thread Song Liu
bpf_prog_info contains information necessary to annotate bpf programs. This patch saves bpf_prog_info for bpf programs loaded in the system. Some big picture of the next few patches: To fully annotate BPF programs with source code mapping, 4 different information are needed: 1) PERF_RECORD_KS

[PATCH v7 perf,bpf 01/15] perf, bpf: consider events with attr.bpf_event as side-band events

2019-03-07 Thread Song Liu
Events with bpf_event should be considered as side-band event, as they carry information about BPF programs. Fixes: 6ee52e2a3fe4 ("perf, bpf: Introduce PERF_RECORD_BPF_EVENT") Signed-off-by: Song Liu --- kernel/events/core.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/k

[PATCH v7 perf,bpf 03/15] bpf: bpftool: use bpf_program__get_prog_info_linear() in prog.c:do_dump()

2019-03-07 Thread Song Liu
This patches uses bpf_program__get_prog_info_linear() to simplify the logic in prog.c do_dump(). Cc: Daniel Borkmann Cc: Alexei Starovoitov Signed-off-by: Song Liu --- tools/bpf/bpftool/prog.c | 266 +-- 1 file changed, 59 insertions(+), 207 deletions(-) di

[PATCH v7 perf,bpf 05/15] perf: change prototype of perf_event__synthesize_bpf_events()

2019-03-07 Thread Song Liu
This patch changes the arguments of perf_event__synthesize_bpf_events() to include perf_session* instead of perf_tool*. perf_session will be used in the next patch. Signed-off-by: Song Liu --- tools/perf/builtin-record.c | 2 +- tools/perf/builtin-top.c| 2 +- tools/perf/util/bpf-event.c | 8

[PATCH v7 perf,bpf 00/15] perf annotation of BPF programs

2019-03-07 Thread Song Liu
Changes v6 to v7: 1. Fix minor issues suggested by Jiri. Changes v5 to v6: 1. Improve side band evlist interface; 2. Minor style fixes. Changes v4 to v5: 1. Rebase to latest bpf-next; 2. Add dependency of 94816add0005 from Arnaldo's tree; 3. More details in change logs; 4. Add perf_env__init() to

Re: [RFC PATCH V2 5/5] vhost: access vq metadata through kernel virtual address

2019-03-07 Thread Michael S. Tsirkin
On Thu, Mar 07, 2019 at 10:47:22AM -0500, Michael S. Tsirkin wrote: > On Wed, Mar 06, 2019 at 02:18:12AM -0500, Jason Wang wrote: > > +static const struct mmu_notifier_ops vhost_mmu_notifier_ops = { > > + .invalidate_range = vhost_invalidate_range, > > +}; > > + > > void vhost_dev_init(struct vh

Re: [PATCH] net: stmmac: Avoid sometimes uninitialized Clang warnings

2019-03-07 Thread Nick Desaulniers
On Thu, Mar 7, 2019 at 9:49 AM David Miller wrote: > > From: Nathan Chancellor > Date: Thu, 7 Mar 2019 09:21:01 -0700 > > > @@ -565,7 +565,7 @@ static int stmmac_hwtstamp_set(struct net_device *dev, > > struct ifreq *ifr) > > u32 ts_master_en = 0; > > u32 ts_event_en = 0; > >

Re: [PATCH] net: atm: Use IS_ENABLED in atm_dev_ioctl

2019-03-07 Thread David Miller
From: Nathan Chancellor Date: Thu, 7 Mar 2019 09:57:42 -0700 > When building with -Wsometimes-uninitialized, Clang warns: > > net/atm/resources.c:256:6: warning: variable 'number' is used uninitialized > whenever 'if' condition is true [-Wsometimes-uninitialized] > net/atm/resources.c:212:7: w

Re: AF_XDP design flaws

2019-03-07 Thread Björn Töpel
On Thu, 7 Mar 2019 at 16:09, Maxim Mikityanskiy wrote: > [...] > > > Now, onto Max' concerns, from my perspective: > > > > 1. The kernel spins too much in napi mode. > > Not just too much, it will do it forever if the application simply doesn't > act. > > > Yes, the i40e driver does spin for thro

Re: general protection fault in sctp_sched_rr_dequeue

2019-03-07 Thread Marcelo Ricardo Leitner
On Wed, Mar 06, 2019 at 07:03:10AM -0500, Neil Horman wrote: > On Wed, Mar 06, 2019 at 06:43:48PM +0800, Xin Long wrote: > > On Wed, Mar 6, 2019 at 9:42 AM syzbot > > wrote: > > > > > > Hello, > > > > > > syzbot found the following crash on: > > > > > > HEAD commit:63bdf4284c38 Merge branch 'l

Re: [PATCH] net: stmmac: Avoid sometimes uninitialized Clang warnings

2019-03-07 Thread David Miller
From: Nathan Chancellor Date: Thu, 7 Mar 2019 09:21:01 -0700 > @@ -565,7 +565,7 @@ static int stmmac_hwtstamp_set(struct net_device *dev, > struct ifreq *ifr) > u32 ts_master_en = 0; > u32 ts_event_en = 0; > u32 value = 0; > - u32 sec_inc; > + u32 sec_inc = 0; >

[PATCH 01/35] perf, bpf: Consider events with attr.bpf_event as side-band events

2019-03-07 Thread Arnaldo Carvalho de Melo
From: Song Liu Events with attr.bpf_event set should be considered as side-band events, as they carry information about BPF programs. Signed-off-by: Song Liu Cc: Alexei Starovoitov Cc: Daniel Borkmann Cc: Jiri Olsa Cc: Namhyung Kim Cc: Peter Zijlstra Cc: kernel-t...@fb.com Cc: netdev@vger.

Re: [PATCH] [v2] ethtool: reduce stack usage with clang

2019-03-07 Thread David Miller
From: Arnd Bergmann Date: Thu, 7 Mar 2019 16:58:35 +0100 > clang inlines the dev_ethtool() more aggressively than gcc does, leading > to a larger amount of used stack space: > > net/core/ethtool.c:2536:24: error: stack frame size of 1216 bytes in function > 'dev_ethtool' [-Werror,-Wframe-large

  1   2   >