Re: [PATCH net] sctp: add wait_buf flag in asoc to avoid the peeloff and wait sndbuf race

2017-11-13 Thread Xin Long
On Mon, Nov 13, 2017 at 11:40 PM, Xin Long <lucien@gmail.com> wrote: > On Mon, Nov 13, 2017 at 11:23 PM, Neil Horman <nhor...@tuxdriver.com> wrote: >> On Mon, Nov 13, 2017 at 01:47:58PM +0800, Xin Long wrote: >>> Commit dfcb9f4f99f1 ("sctp: deny peel

Re: [PATCH net] sctp: add wait_buf flag in asoc to avoid the peeloff and wait sndbuf race

2017-11-13 Thread Xin Long
On Mon, Nov 13, 2017 at 11:23 PM, Neil Horman <nhor...@tuxdriver.com> wrote: > On Mon, Nov 13, 2017 at 01:47:58PM +0800, Xin Long wrote: >> Commit dfcb9f4f99f1 ("sctp: deny peeloff operation on asocs with threads >> sleeping on it") fixed the race between peeloff

Re: [PATCH net] sctp: do not free asoc when it is already dead in sctp_sendmsg

2017-11-13 Thread Xin Long
On Mon, Nov 13, 2017 at 10:46 PM, Neil Horman <nhor...@tuxdriver.com> wrote: > On Mon, Nov 13, 2017 at 12:43:50PM +0800, Xin Long wrote: >> Now in sctp_sendmsg sctp_wait_for_sndbuf could schedule out without >> holding sock sk. It means the current asoc can be freed el

Re: [PATCH net] sctp: check stream reset info len before making reconf chunk

2017-11-13 Thread Xin Long
On Mon, Nov 13, 2017 at 11:09 PM, Neil Horman <nhor...@tuxdriver.com> wrote: > On Mon, Nov 13, 2017 at 01:39:27PM +0800, Xin Long wrote: >> Now when resetting stream, if both in and out flags are set, the info >> len can reach: >> sizeof(struct sctp_strreset_outr

[PATCH net] sctp: add wait_buf flag in asoc to avoid the peeloff and wait sndbuf race

2017-11-12 Thread Xin Long
asocs with threads sleeping on it") Suggested-by: Marcelo Ricardo Leitner <marcelo.leit...@gmail.com> Signed-off-by: Xin Long <lucien@gmail.com> --- include/net/sctp/structs.h | 1 + net/sctp/socket.c | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/i

[PATCH net] sctp: check stream reset info len before making reconf chunk

2017-11-12 Thread Xin Long
: add support for generating stream reconf ssn reset request chunk") Reported-by: Dmitry Vyukov <dvyu...@google.com> Signed-off-by: Xin Long <lucien@gmail.com> --- net/sctp/sm_make_chunk.c | 7 +-- net/sctp/stream.c| 8 +--- 2 files changed, 10 insertions(+), 5 de

[PATCH net] sctp: do not free asoc when it is already dead in sctp_sendmsg

2017-11-12 Thread Xin Long
to new_asoc is not nil. An use-after-free issue would be triggered by this. This patch is to fix it by setting new_asoc with nil if the asoc is already dead when cpu schedules back, so that it will not be freed again in sctp_sendmsg. Reported-by: Dmitry Vyukov <dvyu...@google.com> Signed-off-by: Xi

[PATCH net] vxlan: fix the issue that neigh proxy blocks all icmpv6 packets

2017-11-11 Thread Xin Long
6 couldn't work through it. This patch is to bring the icmp6_code and icmp6_type check back and also removed the same check from neigh_reduce(). Fixes: f1fb08f6337c ("vxlan: fix ND proxy when skb doesn't have transport header offset") Reported-by: Jianlin Shi <ji...@redhat.com> Signe

[PATCH net-next 5/5] ip6_tunnel: clean up ip4ip6 and ip6ip6's err_handlers

2017-11-11 Thread Xin Long
redirect to user's sk, it's for lower dst, so just remove it in this patch. Signed-off-by: Xin Long <lucien@gmail.com> --- net/ipv6/ip6_tunnel.c | 42 ++ 1 file changed, 14 insertions(+), 28 deletions(-) diff --git a/net/ipv6/ip6_tunnel.c b/ne

[PATCH net-next 3/5] ip6_tunnel: add the process for redirect in ip6_tnl_err

2017-11-11 Thread Xin Long
The same process for redirect in "ip6_gre: add the process for redirect in ip6gre_err" is needed by ip4ip6 and ip6ip6 as well. Signed-off-by: Xin Long <lucien@gmail.com> --- net/ipv6/ip6_tunnel.c | 15 ++- 1 file changed, 10 insertions(+), 5 deletions(-) diff

[PATCH net-next 0/5] net: improve the process of redirect and toobig for ipv6 tunnels

2017-11-11 Thread Xin Long
of redirect and toobig for ip6gre ip4ip6, ip6ip6 tunnels, as in ipv4 tunnels. Xin Long (5): ip6_gre: add the process for redirect in ip6gre_err ip6_gre: process toobig in a better way ip6_tunnel: add the process for redirect in ip6_tnl_err ip6_tunnel: process toobig in a better way

[PATCH net-next 4/5] ip6_tunnel: process toobig in a better way

2017-11-11 Thread Xin Long
k dst pmtu will be updated in tx path if in need. Signed-off-by: Xin Long <lucien@gmail.com> --- net/ipv6/ip6_tunnel.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/net/ipv6/ip6_tunnel.c b/net/ipv6/ip6_tunnel.c index a1f704c..7e9e205 100644 --- a/net/ipv6/ip

[PATCH net-next 1/5] ip6_gre: add the process for redirect in ip6gre_err

2017-11-11 Thread Xin Long
This patch is to add redirect icmp packet process for ip6gre by calling ip6_redirect() in ip6gre_err(), as in vti6_err. Prior to this patch, there's even no route cache generated after receiving redirect. Reported-by: Jianlin Shi <ji...@redhat.com> Signed-off-by: Xin Long <lucien@

[PATCH net-next 2/5] ip6_gre: process toobig in a better way

2017-11-11 Thread Xin Long
as later sk dst pmtu will be updated in ip6_tnl_xmit, the same way as in ip4gre. Note that gre dev's mtu will not be updated any more, it doesn't make any sense to change dev's mtu after receiving a toobig packet. Signed-off-by: Xin Long <lucien@gmail.com> --- net/ipv6

[PATCH net-next 0/2] ip_gre: add support for i/o_flags update

2017-11-07 Thread Xin Long
or recalculated. These two patch are to add i/o_flags update and then do adjustment on some gre's properties according to the new i/o_flags. Xin Long (2): ip_gre: add the support for i/o_flags update via netlink ip_gre: add the support for i/o_flags update via ioctl net/ipv4/ip_gre.c | 58

[PATCH net-next 1/2] ip_gre: add the support for i/o_flags update via netlink

2017-11-07 Thread Xin Long
..@redhat.com> Signed-off-by: Xin Long <lucien@gmail.com> --- net/ipv4/ip_gre.c | 39 +-- 1 file changed, 37 insertions(+), 2 deletions(-) diff --git a/net/ipv4/ip_gre.c b/net/ipv4/ip_gre.c index c105a31..81e1e20 100644 --- a/net/ipv4/ip_gre.c +++

[PATCH net-next 2/2] ip_gre: add the support for i/o_flags update via ioctl

2017-11-07 Thread Xin Long
-off-by: Xin Long <lucien@gmail.com> --- net/ipv4/ip_gre.c | 19 --- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/net/ipv4/ip_gre.c b/net/ipv4/ip_gre.c index 81e1e20..bb62391 100644 --- a/net/ipv4/ip_gre.c +++ b/net/ipv4/ip_gre.c @@ -800,17 +800,19 @@ stati

Re: kernel BUG at net/core/skbuff.c:LINE! (2)

2017-11-05 Thread Xin Long
On Mon, Oct 30, 2017 at 10:36 PM, syzbot wrote: > Hello, > > syzkaller hit the following crash on > c69fe407803d4b554b7397fad9598a04717ac255 > git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git/master >

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

2017-11-03 Thread Xin Long
On Fri, Nov 3, 2017 at 1:35 AM, syzbot wrote: > Hello, > > syzkaller hit the following crash on > 73d3393ada4f70fa3df5639c8d438f2f034c0ecb > git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/master > compiler:

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

2017-11-02 Thread Xin Long
On Thu, Nov 2, 2017 at 1:55 AM, syzbot wrote: > Hello, > > syzkaller hit the following crash on > 25a5d23b47994cdb451dcd2bc8ac310a1492f71b > git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/master > compiler:

Re: [PATCH net 4/4] sctp: fix some type cast warnings introduced since very beginning

2017-10-30 Thread Xin Long
On Mon, Oct 30, 2017 at 7:12 PM, David Laight <david.lai...@aculab.com> wrote: > From: Xin Long >> Sent: 28 October 2017 12:44 >> These warnings were found by running 'make C=2 M=net/sctp/'. >> They are there since very beginning. > ... >

[PATCH net-next] ip_vti: remove the useless err_count check in vti_xmit

2017-10-28 Thread Xin Long
Unlike ipip and gre, ip_vti never uses err_count in vti4_err, so no need to check err_count in vti_xmit, it's value always 0. Signed-off-by: Xin Long <lucien@gmail.com> --- net/ipv4/ip_vti.c | 9 - 1 file changed, 9 deletions(-) diff --git a/net/ipv4/ip_vti.c b/net/ipv4/ip

[PATCH net 3/4] sctp: fix a type cast warnings that causes a_rwnd gets the wrong value

2017-10-28 Thread Xin Long
d. So fix it by converting to the right value. Fixes: d4d6fb5787a6 ("sctp: Try not to change a_rwnd when faking a SACK from SHUTDOWN.") Reported-by: Eric Dumazet <eduma...@google.com> Signed-off-by: Xin Long <lucien@gmail.com> --- net/sctp/sm_sideeffect.c | 4 ++-- 1

[PATCH net 0/4] sctp: a bunch of fixes for some sparse warnings

2017-10-28 Thread Xin Long
basically according to how they are introduced. Xin Long (4): sctp: fix some type cast warnings introduced by stream reconf sctp: fix some type cast warnings introduced by transport rhashtable sctp: fix a type cast warnings that causes a_rwnd gets the wrong value sctp: fix some type cast

[PATCH net 2/4] sctp: fix some type cast warnings introduced by transport rhashtable

2017-10-28 Thread Xin Long
..@google.com> Signed-off-by: Xin Long <lucien@gmail.com> --- net/sctp/input.c | 22 +++--- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/net/sctp/input.c b/net/sctp/input.c index 34f10e7..621b5ca 100644 --- a/net/sctp/input.c +++ b/net/sctp/input.c @@ -

[PATCH net 1/4] sctp: fix some type cast warnings introduced by stream reconf

2017-10-28 Thread Xin Long
would use it. Fixes: c0d8bab6ae51 ("sctp: add get and set sockopt for reconf_enable") Reported-by: Eric Dumazet <eduma...@google.com> Signed-off-by: Xin Long <lucien@gmail.com> --- include/linux/sctp.h| 32 include/net/sctp/sm.h | 2

[PATCH net 4/4] sctp: fix some type cast warnings introduced since very beginning

2017-10-28 Thread Xin Long
the extra job when merging net-next to net, I will post the fix for it after the merging is done. Reported-by: Eric Dumazet <eduma...@google.com> Signed-off-by: Xin Long <lucien@gmail.com> --- include/linux/sctp.h | 2 +- include/uapi/linux/sctp.h | 2 +- net/sctp/ipv6.c

[PATCH net] sctp: reset owner sk for data chunks on out queues when migrating a sock

2017-10-27 Thread Xin Long
ry Vyukov <dvyu...@google.com> Signed-off-by: Xin Long <lucien@gmail.com> --- net/sctp/socket.c | 32 1 file changed, 32 insertions(+) diff --git a/net/sctp/socket.c b/net/sctp/socket.c index 17841ab..6f45d17 100644 --- a/net/sctp/socket.c +++ b/net/sc

Re: WARNING in refcount_sub_and_test

2017-10-26 Thread Xin Long
On Fri, Oct 27, 2017 at 12:56 AM, Xin Long <lucien@gmail.com> wrote: > On Fri, Oct 27, 2017 at 12:13 AM, Dmitry Vyukov <dvyu...@google.com> wrote: >> On Thu, Oct 26, 2017 at 5:49 PM, Xin Long <lucien@gmail.com> wrote: >>> On Thu, Oct 26, 2017 at 10:49 P

Re: WARNING in refcount_sub_and_test

2017-10-26 Thread Xin Long
On Fri, Oct 27, 2017 at 12:13 AM, Dmitry Vyukov <dvyu...@google.com> wrote: > On Thu, Oct 26, 2017 at 5:49 PM, Xin Long <lucien@gmail.com> wrote: >> On Thu, Oct 26, 2017 at 10:49 PM, Dmitry Vyukov <dvyu...@google.com> wrote: >>> On Thu, Oct 26,

Re: WARNING in refcount_sub_and_test

2017-10-26 Thread Xin Long
On Thu, Oct 26, 2017 at 10:49 PM, Dmitry Vyukov wrote: > On Thu, Oct 26, 2017 at 10:53 AM, ChunYu Wang wrote: >> Hi all, >> >> I am failed to reproduce it on target kernel with the reproducer file >> or replaying the target syzkaller description log file,

[PATCH net] ip6_gre: update dst pmtu if dev mtu has been updated by toobig in __gre6_xmit

2017-10-26 Thread Xin Long
this. Fixes: c12b395a4664 ("gre: Support GRE over IPv6") Reported-by: Jianlin Shi <ji...@redhat.com> Signed-off-by: Xin Long <lucien@gmail.com> --- net/ipv6/ip6_gre.c | 9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/net/ipv6/ip6_gre.c b/net/ipv6/ip6_g

[PATCH net] ip6_gre: only increase err_count for some certain type icmpv6 in ip6gre_err

2017-10-26 Thread Xin Long
..@redhat.com> Signed-off-by: Xin Long <lucien@gmail.com> --- net/ipv6/ip6_gre.c | 11 +++ 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/net/ipv6/ip6_gre.c b/net/ipv6/ip6_gre.c index 1602b49..fb595e8 100644 --- a/net/ipv6/ip6_gre.c +++ b/net/ipv6/ip6_gr

[PATCH net] ipip: only increase err_count for some certain type icmp in ipip_err

2017-10-26 Thread Xin Long
type icmp, just as in ipgre_err() and ipip6_err(). Fixes: fd58156e456d ("IPIP: Use ip-tunneling code.") Reported-by: Jianlin Shi <ji...@redhat.com> Signed-off-by: Xin Long <lucien@gmail.com> --- net/ipv4/ipip.c | 59 -

Re: [PATCH net] Revert "rtnetlink: check DO_SETLINK_NOTIFY correctly in do_setlink"

2017-10-26 Thread Xin Long
he user won't lose an update. > > CC: David Ahern <dsah...@gmail.com> > CC: Xin Long <lucien@gmail.com> > Reported-by: Vlad Yasevich <vyase...@redhat.com> > Signed-off-by: Nicolas Dichtel <nicolas.dich...@6wind.com> > --- > net/core/rtnetlink.c | 2 +-

Re: [PATCH v2] sctp: full support for ipv6 ip_nonlocal_bind & IP_FREEBIND

2017-10-24 Thread Xin Long
inet.freebind || > + net->ipv6.sysctl.ip_nonlocal_bind || > + ipv6_chk_addr(net, >v6.sin6_addr, > + dev, 0))) { > rcu_read_unlock(); > return 0; > } > -- > 2.7.4 > Reviewed-by: Xin Long <lucien@gmail.com> Thanks.

[PATCHv3 net-next 3/4] rtnetlink: bring NETDEV_CHANGELOWERSTATE event process back to rtnetlink_event

2017-10-23 Thread Xin Long
This patch is to bring NETDEV_CHANGELOWERSTATE event process back to rtnetlink_event so that bonding could use it instead of calling rtmsg_ifinfo to send a notification to userspace after netdev lower state is changed in the later patch. Signed-off-by: Xin Long <lucien@gmail.com> --

[PATCHv3 net-next 4/4] bonding: remove rtmsg_ifinfo called after bond_lower_state_changed

2017-10-23 Thread Xin Long
more. So this patch is to remove it from these places after bond_lower_state_changed. Besides, after this, rtmsg_ifinfo is not needed to be exported. Signed-off-by: Xin Long <lucien@gmail.com> --- include/net/bonding.h | 4 net/core/rtnetlink.c | 1 - 2 files changed, 5 deletions(-)

[PATCHv3 net-next 2/4] bonding: remove rtmsg_ifinfo called in bond_master_upper_dev_link

2017-10-23 Thread Xin Long
y more. So this patch is to remove it from bond_master_upper_dev_link as well as bond_upper_dev_unlink to avoid the redundant notifications. Signed-off-by: Xin Long <lucien@gmail.com> --- drivers/net/bonding/bond_main.c | 11 +++ 1 file changed, 3 insertions(+), 8 deletions(-) diff --g

[PATCHv3 net-next 0/4] net: remove rtmsg_ifinfo used in bridge and bonding

2017-10-23 Thread Xin Long
in rtnetlink_event. It could also fix some redundant notifications from bonding and bridge. v1->v2: - post to net-next.git instead of net.git, for it's more like an improvement for bonding v2->v3: - add patch 1/4 to remove rtmsg_ifinfo called in add_del_if Xin Long (4): bridge: remove rtmsg_

[PATCHv3 net-next 1/4] bridge: remove rtmsg_ifinfo called in add_del_if

2017-10-23 Thread Xin Long
by whether netdev_master_upper_dev_link or netdev_upper_dev_unlink. There's no need to call rtmsg_ifinfo to send the notification any more. So this patch is to remove it from add_del_if also to avoid redundant notifications. Signed-off-by: Xin Long <lucien@gmail.com> --- net/bridge/br_ioctl.c | 3 --- 1 file chan

Re: [PATCHv2 net-next 3/3] bonding: remove rtmsg_ifinfo called after bond_lower_state_changed

2017-10-23 Thread Xin Long
On Mon, Oct 23, 2017 at 10:44 PM, kbuild test robot <l...@intel.com> wrote: > Hi Xin, > > [auto build test ERROR on net-next/master] > > url: > https://github.com/0day-ci/linux/commits/Xin-Long/bonding-void-calling-rtmsg_ifinfo-for-netlink-notifications/20171023-2033

[PATCHv2 net-next 3/3] bonding: remove rtmsg_ifinfo called after bond_lower_state_changed

2017-10-23 Thread Xin Long
more. So this patch is to remove it from these places after bond_lower_state_changed. Besides, after this, rtmsg_ifinfo is not needed to be exported. Signed-off-by: Xin Long <lucien@gmail.com> --- include/net/bonding.h | 4 net/core/rtnetlink.c | 1 - 2 files changed, 5 deletions(-)

[PATCHv2 net-next 2/3] rtnetlink: bring NETDEV_CHANGELOWERSTATE event process back to rtnetlink_event

2017-10-23 Thread Xin Long
This patch is to bring NETDEV_CHANGELOWERSTATE event process back to rtnetlink_event so that bonding could use it instead of calling rtmsg_ifinfo to send a notification to userspace after netdev lower state is changed in the later patch. Signed-off-by: Xin Long <lucien@gmail.com> --

[PATCHv2 net-next 0/3] bonding: void calling rtmsg_ifinfo for netlink notifications

2017-10-23 Thread Xin Long
. It could also fix some redundant notifications from bonding. v1->v2: - post to net-next.git instead of net.git, for it's more like an improvement for bonding Xin Long (3): bonding: remove rtmsg_ifinfo called in bond_master_upper_dev_link rtnetlink: bring NETDEV_CHANGELOWERSTATE ev

[PATCHv2 net-next 1/3] bonding: remove rtmsg_ifinfo called in bond_master_upper_dev_link

2017-10-23 Thread Xin Long
y more. So this patch is to remove it from bond_master_upper_dev_link as well as bond_upper_dev_unlink to avoid the redundant notifications. Signed-off-by: Xin Long <lucien@gmail.com> --- drivers/net/bonding/bond_main.c | 11 +++ 1 file changed, 3 insertions(+), 8 deletions(-) diff --g

Re: [PATCH net 0/2] net: diag: fix a potential security issue

2017-10-21 Thread Xin Long
On Sat, Oct 21, 2017 at 4:45 PM, Xin Long <lucien@gmail.com> wrote: > On Sat, Oct 21, 2017 at 3:45 PM, Eric Dumazet <eric.duma...@gmail.com> wrote: >> On Sat, 2017-10-21 at 14:51 +0800, Xin Long wrote: >>> On Sat, Oct 21, 2017 at 2:18 PM, Eric Dumazet <eduma..

Re: [PATCH net 0/2] net: diag: fix a potential security issue

2017-10-21 Thread Xin Long
On Sat, Oct 21, 2017 at 3:45 PM, Eric Dumazet <eric.duma...@gmail.com> wrote: > On Sat, 2017-10-21 at 14:51 +0800, Xin Long wrote: >> On Sat, Oct 21, 2017 at 2:18 PM, Eric Dumazet <eduma...@google.com> wrote: >> > On Fri, Oct 20, 2017 at 11:06 PM, Xin Lon

Re: [PATCH net 0/2] net: diag: fix a potential security issue

2017-10-21 Thread Xin Long
On Sat, Oct 21, 2017 at 2:18 PM, Eric Dumazet <eduma...@google.com> wrote: > On Fri, Oct 20, 2017 at 11:06 PM, Xin Long <lucien@gmail.com> wrote: >> >> >> On Sat, Oct 21, 2017 at 9:27 AM, David Miller <da...@davemloft.net> wrote: >>> >>>

Re: [RFC PATCH 3/5] sctp: Add LSM hooks

2017-10-20 Thread Xin Long
On Fri, Oct 20, 2017 at 8:04 PM, Richard Haines <richard_c_hai...@btinternet.com> wrote: > On Fri, 2017-10-20 at 07:16 -0400, Neil Horman wrote: >> On Wed, Oct 18, 2017 at 11:05:09PM +0800, Xin Long wrote: >> > On Tue, Oct 17, 2017 at 9:58 PM, Richard Haines >> >

[PATCH net 2/2] inet_diag: request _diag module only when the proto has been registered

2017-10-19 Thread Xin Long
Dubroca <s...@queasysnail.net> Signed-off-by: Xin Long <lucien@gmail.com> --- include/net/protocol.h | 1 + net/ipv4/inet_diag.c | 3 ++- net/ipv4/protocol.c| 6 ++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/include/net/protocol.h b/include/net/protocol.h

[PATCH net 1/2] sock_diag: request _diag module only when the family has been registered

2017-10-19 Thread Xin Long
the family or proto loaded, as some symbols in _diag module are from the family or proto moudle. Fixes: 8ef874bfc729 ("sock_diag: Move the sock_ code to net/core/") Reported-by: Sabrina Dubroca <s...@queasysnail.net> Signed-off-by: Xin Long <lucien@gmail.com> --- include/li

[PATCH net 0/2] net: diag: fix a potential security issue

2017-10-19 Thread Xin Long
: request _diag module only when the family or proto has been registered', this patchset fixes the compiling errors when INET is not set, and also split into two patches to make it clear to review. Xin Long (2): sock_diag: request _diag module only when the family has been registered inet_diag

Re: [RFC PATCH 3/5] sctp: Add LSM hooks

2017-10-18 Thread Xin Long
On Tue, Oct 17, 2017 at 9:58 PM, Richard Haines wrote: > Add security hooks to allow security modules to exercise access control > over SCTP. > > Signed-off-by: Richard Haines > --- > include/net/sctp/structs.h | 10 >

[PATCH net] sctp: add the missing sock_owned_by_user check in sctp_icmp_redirect

2017-10-18 Thread Xin Long
sue fixed in commit 45caeaa5ac0b ("dccp/tcp: fix routing redirect race") on sctp also needs this check. Fixes: 55be7a9c6074 ("ipv4: Add redirect support to all protocol icmp error handlers") Reported-by: Eric Dumazet <eduma...@google.com> Signed-off-by: Xin Long <lucien...

Re: [PATCH net] sock_diag: request _diag module only when the family or proto has been registered

2017-10-18 Thread Xin Long
On Wed, Oct 18, 2017 at 5:38 PM, kbuild test robot <l...@intel.com> wrote: > Hi Xin, > > [auto build test ERROR on net/master] > > url: > https://github.com/0day-ci/linux/commits/Xin-Long/sock_diag-request-_diag-module-only-when-the-family-or-proto-has-been-registered/

Re: [RFC] sctp: suspicious rcu_read_lock() in sctp_packet_config()

2017-10-17 Thread Xin Long
; On Tue, Oct 17, 2017 at 09:44:10AM -0700, Eric Dumazet wrote: >> >> On Tue, Oct 17, 2017 at 9:28 AM, Marcelo Ricardo Leitner >> >> <marcelo.leit...@gmail.com> wrote: >> >> > On Tue, Oct 17, 2017 at 11:31:30PM +0800, Xin Long wrote: >> >&

Re: [RFC] sctp: suspicious rcu_read_lock() in sctp_packet_config()

2017-10-17 Thread Xin Long
On Tue, Oct 17, 2017 at 9:45 PM, Eric Dumazet wrote: > SCTP experts. > > syszkaller reported a few crashes in sctp_packet_config() with invalid > access to a deleted dst. > > The rcu_read_lock() in sctp_packet_config() is suspect. > > It does not protect anything at the

[PATCH net] sctp: do not peel off an assoc from one netns to another one

2017-10-17 Thread Xin Long
etc. are usually different. Reported-by: ChunYu Wang <chunw...@redhat.com> Signed-off-by: Xin Long <lucien@gmail.com> --- net/sctp/socket.c | 4 1 file changed, 4 insertions(+) diff --git a/net/sctp/socket.c b/net/sctp/socket.c index d4730ad..17841ab 100644 --- a/net/sctp/socket.c

Re: [PATCH net 0/3] bonding: void calling rtmsg_ifinfo for netlink notifications

2017-10-17 Thread Xin Long
UPPER is not yet in rtnetlink_event in net-next tree. >>patches can only work on net tree by now. >> >>Hi, David, you want me to hold them until the patches for NETDEV_CHANGEUPPER >>are copied to net-next, or you would apply them to net ? > > This patchset is not fix right? I see n

Re: [PATCH net 0/3] bonding: void calling rtmsg_ifinfo for netlink notifications

2017-10-17 Thread Xin Long
-next. NETDEV_CHANGEUPPER is not yet in rtnetlink_event in net-next tree. patches can only work on net tree by now. Hi, David, you want me to hold them until the patches for NETDEV_CHANGEUPPER are copied to net-next, or you would apply them to net ? > > >> >>Xin Long (3): &g

[PATCH net 3/3] bonding: remove rtmsg_ifinfo called after bond_lower_state_changed

2017-10-17 Thread Xin Long
more. So this patch is to remove it from these places after bond_lower_state_changed. Besides, after this, rtmsg_ifinfo is not needed to be exported. Signed-off-by: Xin Long <lucien@gmail.com> --- include/net/bonding.h | 4 net/core/rtnetlink.c | 1 - 2 files changed, 5 deletions(-)

[PATCH net 0/3] bonding: void calling rtmsg_ifinfo for netlink notifications

2017-10-17 Thread Xin Long
. It could also fix some redundant notifications from bonding. Xin Long (3): bonding: remove rtmsg_ifinfo called in bond_master_upper_dev_link rtnetlink: bring NETDEV_CHANGELOWERSTATE event process back to rtnetlink_event bonding: remove rtmsg_ifinfo called after bond_lower_state_changed

[PATCH net 1/3] bonding: remove rtmsg_ifinfo called in bond_master_upper_dev_link

2017-10-17 Thread Xin Long
y more. So this patch is to remove it from bond_master_upper_dev_link as well as bond_upper_dev_unlink to avoid the redundant notifications. Signed-off-by: Xin Long <lucien@gmail.com> --- drivers/net/bonding/bond_main.c | 11 +++ 1 file changed, 3 insertions(+), 8 deletions(-) diff --g

[PATCH net 2/3] rtnetlink: bring NETDEV_CHANGELOWERSTATE event process back to rtnetlink_event

2017-10-17 Thread Xin Long
This patch is to bring NETDEV_CHANGELOWERSTATE event process back to rtnetlink_event so that bonding could use it instead of calling rtmsg_ifinfo to send a notification to userspace after netdev lower state is changed in the later patch. Signed-off-by: Xin Long <lucien@gmail.com> --

[PATCH net] sock_diag: request _diag module only when the family or proto has been registered

2017-10-16 Thread Xin Long
module are from the family or proto moudle. Reported-by: Sabrina Dubroca <s...@queasysnail.net> Signed-off-by: Xin Long <lucien@gmail.com> --- include/linux/net.h | 1 + include/linux/sock_diag.h | 1 + net/core/sock_diag.c | 32 --

[PATCH net] dev_ioctl: add missing NETDEV_CHANGE_TX_QUEUE_LEN event notification

2017-10-16 Thread Xin Long
When changing dev tx_queue_len via netlink or net-sysfs, a NETDEV_CHANGE_TX_QUEUE_LEN event notification will be called. But dev_ioctl missed this event notification, which could cause no userspace notification would be sent. Signed-off-by: Xin Long <lucien@gmail.com> --- ne

[PATCH net 4/6] rtnetlink: bring NETDEV_CHANGEUPPER event process back in rtnetlink_event

2017-10-15 Thread Xin Long
tions for NETDEV_CHANGEUPPER event") Signed-off-by: Xin Long <lucien@gmail.com> --- net/core/rtnetlink.c | 1 + 1 file changed, 1 insertion(+) diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c index 8e44fd5..ab98c1c 100644 --- a/net/core/rtnetlink.c +++ b/net/core/rtnetl

[PATCH net 5/6] rtnetlink: check DO_SETLINK_NOTIFY correctly in do_setlink

2017-10-15 Thread Xin Long
ck would be: (status & DO_SETLINK_NOTIFY) == DO_SETLINK_NOTIFY This would avoid lots of duplicated notifications when setting some properties of a link. Fixes: ba9989069f4e ("rtnl/do_setlink(): notify when a netdev is modified") Signed-off-by: Xin Long <lucien@gmail.com> -

[PATCH net 6/6] rtnetlink: do not set notification for tx_queue_len in do_setlink

2017-10-15 Thread Xin Long
NETDEV_CHANGE_TX_QUEUE_LEN event process in rtnetlink_event would send a notification for userspace and tx_queue_len's setting in do_setlink would trigger NETDEV_CHANGE_TX_QUEUE_LEN. So it shouldn't set DO_SETLINK_NOTIFY status for this change to send a notification any more. Signed-off-by: Xin

[PATCH net 1/6] rtnetlink: bring NETDEV_CHANGEMTU event process back in rtnetlink_event

2017-10-15 Thread Xin Long
e later patch 'rtnetlink: check DO_SETLINK_NOTIFY correctly in do_setlink'. Fixes: 085e1a65f04f ("rtnetlink: Do not generate notifications for MTU events") Signed-off-by: Xin Long <lucien@gmail.com> --- net/core/rtnetlink.c | 1 + 1 file changed, 1 insertion(+) diff --git a/ne

[PATCH net 3/6] rtnetlink: bring NETDEV_POST_TYPE_CHANGE event process back in rtnetlink_event

2017-10-15 Thread Xin Long
be fixed in the later patch 'rtnetlink: check DO_SETLINK_NOTIFY correctly in do_setlink'. Fixes: aef091ae58aa ("rtnetlink: Do not generate notifications for POST_TYPE_CHANGE event") Signed-off-by: Xin Long <lucien@gmail.com> --- net/core/rtnetlink.c | 1 + 1 file changed, 1 in

[PATCH net 2/6] rtnetlink: bring NETDEV_CHANGE_TX_QUEUE_LEN event process back in rtnetlink_event

2017-10-15 Thread Xin Long
for tx_queue_len in do_setlink'. Fixes: 27b3b551d8a7 ("rtnetlink: Do not generate notifications for NETDEV_CHANGE_TX_QUEUE_LEN event") Signed-off-by: Xin Long <lucien@gmail.com> --- net/core/rtnetlink.c | 1 + 1 file changed, 1 insertion(+) diff --git a/net/core/rtnetlink.c b/net/core/r

[PATCH net 0/6] rtnetlink: a bunch of fixes for userspace notifications in changing dev properties

2017-10-15 Thread Xin Long
ways, like ioctl, sysfs, etc. It may cause some user programs doesn't work as expected because of the missing notifications. This patchset will fix it by bringing some of these netdev events back and also fix the old redundant notifications issue with a proper way. Xin Long (6): rtnetl

Re: [net-next 2/3] ip_gre: fix erspan tunnel mtu calculation

2017-10-11 Thread Xin Long
On Tue, Oct 10, 2017 at 8:59 PM, William Tu wrote: >>> @@ -1242,14 +1241,14 @@ static int erspan_tunnel_init(struct net_device >>> *dev) >>> struct ip_tunnel *tunnel = netdev_priv(dev); >>> int t_hlen; >>> >>> - tunnel->tun_hlen = 8; >>> +

Re: [net-next 3/3] ip_gre: cache the device mtu hard_header_len calc

2017-10-11 Thread Xin Long
On Tue, Oct 10, 2017 at 4:47 AM, William Tu wrote: > The patch introduces ip_tunnel->ether_mtu fields to cache the value of > dev->mtu + dev->hard_header_len. This avoids the arithmetic operation > on every packet. > > Signed-off-by: William Tu > Cc:

Re: [net-next 2/3] ip_gre: fix erspan tunnel mtu calculation

2017-10-09 Thread Xin Long
ated is 1450 + 14 = 1464 byte. > > Signed-off-by: William Tu <u9012...@gmail.com> > Cc: Xin Long <lucien@gmail.com> > --- > include/net/erspan.h | 1 + > net/ipv4/ip_gre.c| 11 +-- > 2 files changed, 6 insertions(+), 6 deletions(-) > > diff --git a/i

Re: [net-next,v2] ip_gre: check packet length and mtu correctly in erspan tx

2017-10-06 Thread Xin Long
("gre: add collect_md mode to ERSPAN tunnel") > Fixes: 84e54fe0a5ea ("gre: introduce native tunnel support for ERSPAN") > Signed-off-by: William Tu <u9012...@gmail.com> > Cc: Xin Long <lucien@gmail.com> > Cc: David Laight <david.lai...@aculab.

[PATCH net 4/4] ip_gre: erspan device should keep dst

2017-10-01 Thread Xin Long
The patch 'ip_gre: ipgre_tap device should keep dst' fixed the issue ipgre_tap dev mtu couldn't be updated in tx path. The same fix is needed for erspan as well. Fixes: 84e54fe0a5ea ("gre: introduce native tunnel support for ERSPAN") Signed-off-by: Xin Long <lucien@gmail.com&g

[PATCH net 3/4] ip_gre: set tunnel hlen properly in erspan_tunnel_init

2017-10-01 Thread Xin Long
ich hurts performance a lot. This patch is to fix it by setting tunnel->hlen with: tunnel->tun_hlen + tunnel->encap_hlen + sizeof(struct erspanhdr) Fixes: 84e54fe0a5ea ("gre: introduce native tunnel support for ERSPAN") Signed-off-by: Xin Long <lucien@gmail.com> --- n

[PATCH net 2/4] ip_gre: check packet length and mtu correctly in erspan_xmit

2017-10-01 Thread Xin Long
t. Fixes: 84e54fe0a5ea ("gre: introduce native tunnel support for ERSPAN") Signed-off-by: Xin Long <lucien@gmail.com> --- net/ipv4/ip_gre.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/ipv4/ip_gre.c b/net/ipv4/ip_gre.c index b25b1e5..2a4ef9d 100644 ---

[PATCH net 1/4] ip_gre: get key from session_id correctly in erspan_rcv

2017-10-01 Thread Xin Long
_rcv. This patch is to add 'session_id & ID_MASK' there and also remove the unnecessary variable session_id. Fixes: 84e54fe0a5ea ("gre: introduce native tunnel support for ERSPAN") Signed-off-by: Xin Long <lucien@gmail.com> --- net/ipv4/ip_gre.c | 4 +--- 1 file ch

[PATCH net 0/4] ip_gre: a bunch of fixes for erspan

2017-10-01 Thread Xin Long
This patchset is to fix some issues that could cause 0 or low performance, and even unexpected truncated packets on erspan. Xin Long (4): ip_gre: get key from session_id correctly in erspan_rcv ip_gre: check packet length and mtu correctly in erspan_xmit ip_gre: set tunnel hlen properly

Re: [PATCH net-next 00/10] Introduce SCTP Stream Schedulers

2017-09-30 Thread Xin Long
r piece of idata from another stream. This patchset > *doesn't* include it. It will be posted later by Xin Long. Its > integration with this patchset is very simple and it basically only > requires a tweak in sctp_sched_dequeue_done(), to ignore datamsg > boundaries. > > The first 5

[PATCH net] ip6_tunnel: update mtu properly for ARPHRD_ETHER tunnel device in tx path

2017-09-27 Thread Xin Long
Now when updating mtu in tx path, it doesn't consider ARPHRD_ETHER tunnel device, like ip6gre_tap tunnel, for which it should also subtract ether header to get the correct mtu. Signed-off-by: Xin Long <lucien@gmail.com> --- net/ipv6/ip6_tunnel.c | 5 +++-- 1 file changed, 3 insertions

[PATCH net] ip6_gre: ip6gre_tap device should keep dst

2017-09-27 Thread Xin Long
The patch 'ip_gre: ipgre_tap device should keep dst' fixed a issue that ipgre_tap mtu couldn't be updated in tx path. The same fix is needed for ip6gre_tap as well. Signed-off-by: Xin Long <lucien@gmail.com> --- net/ipv6/ip6_gre.c | 1 + 1 file changed, 1 insertion(+) diff --git a/ne

[PATCH net] ip_gre: ipgre_tap device should keep dst

2017-09-27 Thread Xin Long
p_init, as ipgre does. Reported-by: Jianlin Shi <ji...@redhat.com> Signed-off-by: Xin Long <lucien@gmail.com> --- net/ipv4/ip_gre.c | 1 + 1 file changed, 1 insertion(+) diff --git a/net/ipv4/ip_gre.c b/net/ipv4/ip_gre.c index 0162fb9..8b837f6 100644 --- a/net/ipv4/ip_gre.c +++ b

Re: [PATCH net v2] sctp: Fix a big endian bug in sctp_diag_dump()

2017-09-25 Thread Xin Long
> netlink_callback *cb, > goto done; > > sctp_for_each_transport(sctp_sock_filter, sctp_sock_dump, > - net, (int *)>args[2], ); > + net, , ); > + cb->args[2] = pos; > > done: > cb->args[1] = cb->args[4]; Reviewed-by: Xin Long <lucien@gmail.com>

Re: [PATCH net] sctp: Fix a big endian bug in sctp_for_each_transport()

2017-09-23 Thread Xin Long
On Sat, Sep 23, 2017 at 6:25 PM, Dan Carpenter wrote: > Fundamentally, the "pos" pointer points to "cb->args[2]" which is a long. > In the current code, we only use the high 32 bits and cast it as an > int. That works on little endian systems but will fail on big endian

[PATCH net] ip6_tunnel: do not allow loading ip6_tunnel if ipv6 is disabled in cmdline

2017-09-15 Thread Xin Long
[ 209.589209] system_call+0x38/0xe0 This patch is to return -EOPNOTSUPP in ip6_tunnel_init if ipv6 has been disabled from cmdline. Reported-by: Jianlin Shi <ji...@redhat.com> Signed-off-by: Xin Long <lucien@gmail.com> --- net/ipv6/ip6_tunnel.c | 3 +++ 1 file changed, 3 insertions(+)

[PATCH net] ip6_gre: skb_push ipv6hdr before packing the header in ip6gre_header

2017-09-14 Thread Xin Long
hdr so that ipv6h points to the right position to set ipv6 stuff up. This patch is to skb_push hlen + sizeof(*ipv6h) and also fix some indents in ip6gre_header. Fixes: c12b395a4664 ("gre: Support GRE over IPv6") Reported-by: Jianlin Shi <ji...@redhat.com> Signed-off-by: Xin Long

[PATCH net] sctp: do not mark sk dumped when inet_sctp_diag_fill returns err

2017-09-14 Thread Xin Long
args[3] when inet_sctp_diag_fill() returns err in sctp_sock_dump(). Fixes: 8f840e47f190 ("sctp: add the sctp_diag.c file") Signed-off-by: Xin Long <lucien@gmail.com> --- net/sctp/sctp_diag.c | 1 - 1 file changed, 1 deletion(-) diff --git a/net/sctp/sctp_diag.c b/net/sctp/sct

[PATCH net] sctp: fix an use-after-free issue in sctp_sock_dump

2017-09-14 Thread Xin Long
royed before doing the dump") Reported-by: Paolo Abeni <pab...@redhat.com> Signed-off-by: Xin Long <lucien@gmail.com> --- include/net/sctp/sctp.h | 3 ++- net/sctp/sctp_diag.c| 32 +--- net/sctp/socket.c | 40 +---

Re: [PATCH net] netlink: fix an use-after-free issue for nlk groups

2017-09-10 Thread Xin Long
On Sat, Sep 9, 2017 at 9:56 AM, Cong Wang <xiyou.wangc...@gmail.com> wrote: > On Tue, Sep 5, 2017 at 8:47 PM, Xin Long <lucien@gmail.com> wrote: >> ChunYu found a netlink use-after-free issue by syzkaller: >> >> [28448.842981] BUG: KASAN: use-after-fr

Re: [PATCH net] netlink: access nlk groups safely in netlink bind and getname

2017-09-10 Thread Xin Long
On Sat, Sep 9, 2017 at 7:35 AM, Cong Wang <xiyou.wangc...@gmail.com> wrote: > On Tue, Sep 5, 2017 at 8:53 PM, Xin Long <lucien@gmail.com> wrote: >> Now there is no lock protecting nlk ngroups/groups' accessing in >> netlink bind and getname. It's sa

[PATCH net] netlink: access nlk groups safely in netlink bind and getname

2017-09-05 Thread Xin Long
groups. Acked-by: Florian Westphal <f...@strlen.de> Signed-off-by: Xin Long <lucien@gmail.com> --- net/netlink/af_netlink.c | 16 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c index 94a61e6..32

[PATCH net] netlink: fix an use-after-free issue for nlk groups

2017-09-05 Thread Xin Long
in netlink_seq_show(). This patch is to defer nlk groups' free in deferred_put_nlk_sk. Reported-by: ChunYu Wang <chunw...@redhat.com> Acked-by: Florian Westphal <f...@strlen.de> Signed-off-by: Xin Long <lucien@gmail.com> --- net/netlink/af_netlink.c | 6 +++--- 1 file cha

[PATCH net] ip6_gre: update mtu properly in ip6gre_err

2017-09-05 Thread Xin Long
ETH_HLEN if gre dev'type is ARPHRD_ETHER. Reported-by: Jianlin Shi <ji...@redhat.com> Signed-off-by: Xin Long <lucien@gmail.com> --- net/ipv6/ip6_gre.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/net/ipv6/ip6_gre.c b/net/ipv6/ip6_gre.c index 67ff2aa..b7

[PATCH net] ipv6: do not set sk_destruct in IPV6_ADDRFORM sockopt

2017-08-27 Thread Xin Long
-by: ChunYu Wang <chunw...@redhat.com> Signed-off-by: Xin Long <lucien@gmail.com> --- net/ipv6/ipv6_sockglue.c | 1 - 1 file changed, 1 deletion(-) diff --git a/net/ipv6/ipv6_sockglue.c b/net/ipv6/ipv6_sockglue.c index 02d795f..a5e466d 100644 --- a/net/ipv6/ipv6_sockglue.c +++ b/net/ip

[PATCH net] ipv6: set dst.obsolete when a cached route has expired

2017-08-26 Thread Xin Long
etting it, just like what ipv4 route does. Reported-by: Jianlin Shi <ji...@redhat.com> Signed-off-by: Xin Long <lucien@gmail.com> Acked-by: Hannes Frederic Sowa <han...@stressinduktion.org> --- net/ipv6/ip6_fib.c | 4 +++- net/ipv6/route.c | 3 ++- 2 files changed, 5 in

<    1   2   3   4   5   6   7   8   9   10   >