[PATCH net-next 3/5] sctp: add sockopt SCTP_AUTH_DEACTIVATE_KEY

2018-03-14 Thread Xin Long
by an association can be deleted, but for the backward compatibility, it is not to check deactivated when deleting or replacing one sh_key. Signed-off-by: Xin Long <lucien@gmail.com> --- include/net/sctp/auth.h | 12 ++-- include/uapi/linux/sctp.h | 1 + net/sctp/auth.c

[PATCH net-next 0/5] sctp: add support for some sctp auth APIs from RFC6458

2018-03-14 Thread Xin Long
for AUTHENTICATION_EVENT described in RFC6458: 6.1.8. SCTP_AUTHENTICATION_EVENT: - SCTP_AUTH_NO_AUTH - SCTP_AUTH_FREE_KEY After this patchset, we have fully support for sctp_sendv in kernel. Note that this patchset won't touch that sctp options merge conflict. Xin Long

[PATCH net-next 1/5] sctp: add refcnt support for sh_key

2018-03-14 Thread Xin Long
be grown due to that performance drop issue on slow cpu, so it just reuses head_skb memory for shkey in sctp_chunk. Signed-off-by: Xin Long <lucien@gmail.com> --- include/net/sctp/auth.h| 9 +++-- include/net/sctp/sm.h | 3 +- include/net/sctp/structs.h | 9 +++-- net/sctp/

Re: BUG: corrupted list in sctp_association_free

2018-03-13 Thread Xin Long
On Tue, Mar 13, 2018 at 3:34 PM, syzbot wrote: > Hello, > > syzbot hit the following crash on net-next commit > fd372a7a9e5e9d8011a0222d10edd3523abcd3b1 (Thu Mar 8 19:43:48 2018 +) > Merge tag 'mlx5-updates-2018-02-28-2' of >

Re: [PATCH v2] sctp: Fix double free in sctp_sendmsg_to_asoc

2018-03-13 Thread Xin Long
ng the ordering of > sctp_primitive_ASSOCIATE and sctp_wait_for_sndbuf to the old order, to > ensure that EPIPE will not happen. > > Tested by myself using the syzbot reproducers with positive results > > Signed-off-by: Neil Horman <nhor...@tuxdriver.com> > CC: da...@davemloft.

Re: [PATCH net-next v2] sctp: fix error return code in sctp_sendmsg_new_asoc()

2018-03-13 Thread Xin Long
struct in6_addr)) { > + err = -EINVAL; > goto free; > + } > > dlen = sizeof(struct in6_addr); > daddr->v6.sin6_family = AF_INET6; > Reviewed-by: Xin Long <lucien@gmail.com>

Re: [PATCH net-next] sctp: fix error return code in sctp_sendmsg_new_asoc()

2018-03-12 Thread Xin Long
On Mon, Mar 12, 2018 at 11:19 PM, David Miller wrote: > From: Wei Yongjun > Date: Mon, 12 Mar 2018 12:16:04 + > >> Return error code -EINVAL in the address len check error handling >> case since 'err' can be overwrite to 0 by 'err =

Re: [PATCH net-next] sctp: fix error return code in sctp_sendmsg_new_asoc()

2018-03-12 Thread Xin Long
On Mon, Mar 12, 2018 at 8:16 PM, Wei Yongjun wrote: > Return error code -EINVAL in the address len check error handling > case since 'err' can be overwrite to 0 by 'err = sctp_verify_addr()' > in the for loop. > > Fixes: 2c0dbaa0c43d ("sctp: add support for

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

2018-03-12 Thread Xin Long
On Sun, Mar 11, 2018 at 3:04 AM, Neil Horman <nhor...@tuxdriver.com> wrote: > On Sun, Mar 11, 2018 at 12:22:32AM +0800, Xin Long wrote: >> On Sat, Mar 10, 2018 at 9:13 PM, Neil Horman <nhor...@tuxdriver.com> wrote: >> > On Sat, Mar 10, 2018 at 03:58:04PM +0800, Xin Lo

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

2018-03-10 Thread Xin Long
On Sat, Mar 10, 2018 at 9:13 PM, Neil Horman <nhor...@tuxdriver.com> wrote: > On Sat, Mar 10, 2018 at 03:58:04PM +0800, Xin Long wrote: >> On Sat, Mar 10, 2018 at 6:08 AM, Neil Horman <nhor...@tuxdriver.com> wrote: >> > On Fri, Mar 09, 2018 at 12:59:06PM -0

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

2018-03-10 Thread Xin Long
it...@gmail.com> Acked-by: Phil Sutter <p...@nwl.cc> Acked-by: Sabrina Dubroca <s...@queasysnail.net> Signed-off-by: Xin Long <lucien@gmail.com> --- include/linux/net.h | 1 + include/net/sock.h | 1 + net/core/sock.c | 21 + net/core/sock_diag.c | 1

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

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

Re: linux-next: manual merge of the selinux tree with the net-next tree

2018-03-08 Thread Xin Long
On Thu, Mar 8, 2018 at 10:07 AM, Stephen Rothwell wrote: > Hi all, > > On Mon, 5 Mar 2018 12:40:54 +1100 Stephen Rothwell > wrote: >> >> Today's linux-next merge of the selinux tree got a conflict in: >> >> net/sctp/socket.c >> >> between several

Re: linux-next: manual merge of the selinux tree with the net-next tree

2018-03-08 Thread Xin Long
oned to your upstream maintainer >>> when your tree is submitted for merging. You may also want to consider >>> cooperating with the maintainer of the conflicting tree to minimise any >>> particularly complex conflicts. >>> >>> -- >>> Cheers, >>>

Re: [PATCH net-next 2/3] sctp: add support for SCTP_DSTADDRV4/6 Information for sendmsg

2018-03-05 Thread Xin Long
On Tue, Mar 6, 2018 at 7:39 AM, Marcelo Ricardo Leitner <marcelo.leit...@gmail.com> wrote: > On Mon, Mar 05, 2018 at 08:44:19PM +0800, Xin Long wrote: >> This patch is to add support for Destination IPv4/6 Address options >> for sendmsg, as described in sectio

[PATCH net-next 3/3] sctp: add support for snd flag SCTP_SENDALL process in sendmsg

2018-03-05 Thread Xin Long
This patch is to add support for snd flag SCTP_SENDALL process in sendmsg, as described in section 5.3.4 of RFC6458. With this flag, you can send the same data to all the asocs of this sk once. Signed-off-by: Xin Long <lucien@gmail.com> --- include/uapi/linux/sctp.h | 2 ++ ne

[PATCH net-next 1/3] sctp: add support for PR-SCTP Information for sendmsg

2018-03-05 Thread Xin Long
This patch is to add support for PR-SCTP Information for sendmsg, as described in section 5.3.7 of RFC6458. With this option, you can specify pr_policy and pr_value for user data in sendmsg. It's also a necessary send info for sctp_sendv. Signed-off-by: Xin Long <lucien@gmail.

[PATCH net-next 2/3] sctp: add support for SCTP_DSTADDRV4/6 Information for sendmsg

2018-03-05 Thread Xin Long
. Signed-off-by: Xin Long <lucien@gmail.com> --- include/net/sctp/structs.h | 1 + include/uapi/linux/sctp.h | 6 net/sctp/socket.c | 77 ++ 3 files changed, 84 insertions(+) diff --git a/include/net/sctp/structs.h b/include/ne

[PATCH net-next 0/3] sctp: add support for some msg_control options from RFC6458

2018-03-05 Thread Xin Long
: 5.3.8. SCTP AUTH Information Structure (SCTP_AUTHINFO) It's a little complicated, I will post it in another patchset after this. Xin Long (3): sctp: add support for PR-SCTP Information for sendmsg sctp: add support for SCTP_DSTADDRV4/6 Information for sendmsg sctp: add support for snd

Re: linux-next: manual merge of the selinux tree with the net-next tree

2018-03-04 Thread Xin Long
On Mon, Mar 5, 2018 at 9:40 AM, Stephen Rothwell wrote: > Hi Paul, > > Today's linux-next merge of the selinux tree got a conflict in: > > net/sctp/socket.c > > between several refactoring commits from the net-next tree and commit: > > 2277c7cd75e3 ("sctp: Add LSM

[PATCH net-next 9/9] sctp: adjust some codes in a better order in sctp_sendmsg

2018-03-01 Thread Xin Long
sctp_sendmsg_new_asoc and SCTP_ADDR_OVER check is only necessary when daddr is set, so move them up to if (daddr) statement. Signed-off-by: Xin Long <lucien@gmail.com> --- net/sctp/socket.c | 36 ++-- 1 file changed, 18 insertions(+), 18 deletions(-)

[PATCH net-next 8/9] sctp: improve some variables in sctp_sendmsg

2018-03-01 Thread Xin Long
the 'out_nounlock:' as 'out', shorter and nicer. - remove associd, only one place is using it now, just use sinfo->sinfo_assoc_id directly. - remove 'cmsgs' initialization in sctp_sendmsg, as it will be done in sctp_sendmsg_parse. Signed-off-by: Xin Long <lucien@gmail.com> ---

[PATCH net-next 7/9] sctp: remove the unnecessary transport looking up from sctp_sendmsg

2018-03-01 Thread Xin Long
SCTP_ADDR_OVER is not set for UDP type socket. Signed-off-by: Xin Long <lucien@gmail.com> --- net/sctp/socket.c | 24 ++-- 1 file changed, 6 insertions(+), 18 deletions(-) diff --git a/net/sctp/socket.c b/net/sctp/socket.c index bd1a657..4260310 100644 --- a/net/sctp/socket.c

[PATCH net-next 5/9] sctp: factor out sctp_sendmsg_parse from sctp_sendmsg

2018-03-01 Thread Xin Long
ck can be removed from sctp_sendmsg. Signed-off-by: Xin Long <lucien@gmail.com> --- net/sctp/socket.c | 172 ++ 1 file changed, 69 insertions(+), 103 deletions(-) diff --git a/net/sctp/socket.c b/net/sctp/socket.c index 68691d2..bf089e5 1006

[PATCH net-next 6/9] sctp: factor out sctp_sendmsg_update_sinfo from sctp_sendmsg

2018-03-01 Thread Xin Long
This patch is to move the codes for trying to get sinfo from asoc into sctp_sendmsg_update_sinfo. Signed-off-by: Xin Long <lucien@gmail.com> --- net/sctp/socket.c | 26 +- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/net/sctp/socket.c b/ne

[PATCH net-next 4/9] sctp: factor out sctp_sendmsg_get_daddr from sctp_sendmsg

2018-03-01 Thread Xin Long
This patch is to move the codes for trying to get daddr from msg->msg_name into sctp_sendmsg_get_daddr. Note that after adding 'daddr', 'to' and 'msg_name' can be deleted. Signed-off-by: Xin Long <lucien@gmail.com> --- net/sctp/sock

[PATCH net-next 3/9] sctp: factor out sctp_sendmsg_check_sflags from sctp_sendmsg

2018-03-01 Thread Xin Long
This patch is to move the codes for checking sinfo_flags on one asoc after this asoc has been found into sctp_sendmsg_check_sflags. Signed-off-by: Xin Long <lucien@gmail.com> --- net/sctp/socket.c | 72 +++ 1 file changed, 36 inse

[PATCH net-next 2/9] sctp: factor out sctp_sendmsg_new_asoc from sctp_sendmsg

2018-03-01 Thread Xin Long
This patch is to move the codes for creating a new asoc if no asoc was found into sctp_sendmsg_new_asoc. Signed-off-by: Xin Long <lucien@gmail.com> --- net/sctp/socket.c | 201 +++--- 1 file changed, 86 insertions(+), 115 deletions(-)

[PATCH net-next 1/9] sctp: factor out sctp_sendmsg_to_asoc from sctp_sendmsg

2018-03-01 Thread Xin Long
This patch is to move the codes for checking and sending on one asoc after this asoc has been found or created into sctp_sendmsg_to_asoc. Note that 'err != -ESRCH' check is for the case that asoc is freed when waiting for tx buffer in sctp_sendmsg_to_asoc. Signed-off-by: Xin Long <luc

[PATCH net-next 0/9] sctp: clean up sctp_sendmsg

2018-03-01 Thread Xin Long
err = security_sctp_bind_connect(sk, SCTP_SENDMSG_CONNECT, +(struct sockaddr *)daddr, +af->sockaddr_len); + if (err < 0) + return err; + asoc = sctp_association_new(ep, sk, scope, GFP_KERNEL); if (!asoc)

[PATCH net 3/3] sit: fix IFLA_MTU ignored on NEWLINK

2018-02-27 Thread Xin Long
nnel, it can't call ip6_tnl_change_mtu to set mtu. Reported-by: Jianlin Shi <ji...@redhat.com> Signed-off-by: Xin Long <lucien@gmail.com> --- net/ipv6/sit.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/net/ipv6/sit.c b/net/ipv6/sit.c index 3a1775a..0195598 100644 --- a/net/

[PATCH net 1/3] ip_gre: fix IFLA_MTU ignored on NEWLINK

2018-02-27 Thread Xin Long
this patch is to remove them to make IFLA_MTU work, as in other ipv4 tunnels. [1]: https://patchwork.ozlabs.org/patch/823504/ Fixes: c54419321455 ("GRE: Refactor GRE tunneling code.") Reported-by: Eric Garver <e...@erig.me> Signed-off-by: Xin Long <lucien@gmail.com> ---

[PATCH net 2/3] ip6_tunnel: fix IFLA_MTU ignored on NEWLINK

2018-02-27 Thread Xin Long
by: Jianlin Shi <ji...@redhat.com> Signed-off-by: Xin Long <lucien@gmail.com> --- net/ipv6/ip6_tunnel.c | 12 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/net/ipv6/ip6_tunnel.c b/net/ipv6/ip6_tunnel.c index 4b15fe9..6e0f21e 100644 --- a/net/ipv6/ip6_tunne

[PATCH net 0/3] net: fix IFLA_MTU ignored on NEWLINK for some ip and ipv6 tunnels

2018-02-27 Thread Xin Long
it can't get the tb[IFLA_MTU]. Xin Long (3): ip_gre: fix IFLA_MTU ignored on NEWLINK ip6_tunnel: fix IFLA_MTU ignored on NEWLINK sit: fix IFLA_MTU ignored on NEWLINK net/ipv4/ip_gre.c | 5 - net/ipv6/ip6_tunnel.c | 12 net/ipv6/sit.c| 7 +++ 3 files changed, 15

Re: WARNING: refcount bug in sock_wfree

2018-02-22 Thread Xin Long
On Wed, Feb 21, 2018 at 9:59 PM, syzbot wrote: > Hello, > > syzbot hit the following crash on upstream commit > 79c0ef3e85c015b0921a8fd5dd539d1480e9cd6c (Mon Feb 19 19:58:19 2018 +) > Merge

[PATCH net] xfrm: do not call rcu_read_unlock when afinfo is NULL in xfrm_get_tos

2018-02-16 Thread Xin Long
When xfrm_policy_get_afinfo returns NULL, it will not hold rcu read lock. In this case, rcu_read_unlock should not be called in xfrm_get_tos, just like other places where it's calling xfrm_policy_get_afinfo. Fixes: f5e2bb4f5b22 ("xfrm: policy: xfrm_get_tos cannot fail") Signed-off-by

Re: [PATCH net] netfilter: unlock xt_table earlier in __do_replace

2018-02-16 Thread Xin Long
On Fri, Feb 16, 2018 at 12:02 PM, Florian Westphal <f...@strlen.de> wrote: > Xin Long <lucien@gmail.com> wrote: >> Now it's doing cleanup_entry for oldinfo under the xt_table lock, >> but it's not really necessary. After the replacement job is done >> in xt_r

[PATCH net] netfilter: unlock xt_table earlier in __do_replace

2018-02-16 Thread Xin Long
, just as do_replace_finish does for ebtables. Signed-off-by: Xin Long <lucien@gmail.com> --- net/ipv4/netfilter/arp_tables.c | 3 ++- net/ipv4/netfilter/ip_tables.c | 3 ++- net/ipv6/netfilter/ip6_tables.c | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/ne

[PATCH net] sctp: remove the left unnecessary check for chunk in sctp_renege_events

2018-02-16 Thread Xin Long
23403536ea ("sctp: remove the useless check in sctp_renege_events") Reported-by: Dan Carpenter <dan.carpen...@oracle.com> Signed-off-by: Xin Long <lucien@gmail.com> --- net/sctp/stream_interleave.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/ne

[PATCH net] xfrm: reuse uncached_list to track xdsts

2018-02-14 Thread Xin Long
ly. Fixes: 52df157f17e5 ("xfrm: take refcnt of dst when creating struct xfrm_dst bundle") Reported-by: Jianlin Shi <ji...@redhat.com> Reported-by: Hangbin Liu <liuhang...@gmail.com> Tested-by: Eyal Birger <eyal.bir...@gmail.com> Signed-off-by: Xin Long <lucien@gma

Re: [PATCH ipsec,v3] net: xfrm_policy: fix device unregistration hang

2018-02-14 Thread Xin Long
On Wed, Feb 14, 2018 at 5:24 PM, Steffen Klassert <steffen.klass...@secunet.com> wrote: > On Tue, Feb 13, 2018 at 08:23:14PM +0200, Eyal Birger wrote: >> Hi Xin Long, >> >> On Tue, 13 Feb 2018 23:18:14 +0800 >> Xin Long <lucien@gmail.com> wrote: >&g

Re: [PATCH ipsec,v3] net: xfrm_policy: fix device unregistration hang

2018-02-13 Thread Xin Long
On Tue, Feb 13, 2018 at 6:54 PM, Eyal Birger wrote: > In setups like the following: > >Host A --Host B > tun0 -- ipsec -- eth0 -- eth0 -- ipsec -- tun0 > > where tun0 are tunnel devices using dst_cache (ipip, ipip6, etc...). > > Unregistration of

[PATCHv2 net 1/2] sctp: rename sctp_diag.c as diag.c

2018-02-13 Thread Xin Long
Remove 'sctp_' prefix for diag file, to keep consistent with other files' names. Signed-off-by: Xin Long <lucien@gmail.com> --- net/sctp/Makefile| 2 + net/sctp/diag.c | 526 +++ net/sctp/sctp_diag.c

[PATCHv2 net 2/2] sctp: add file comments in diag.c

2018-02-13 Thread Xin Long
This patch is to add the missing file comments for sctp diag file. Signed-off-by: Xin Long <lucien@gmail.com> --- net/sctp/diag.c | 31 +++ 1 file changed, 31 insertions(+) diff --git a/net/sctp/diag.c b/net/sctp/diag.c index a72a7d9..078f01a 100644 ---

[PATCHv2 net 0/2] sctp: rename sctp diag file and add file comments for it

2018-02-13 Thread Xin Long
This patchset is to remove the sctp_ prefix for sctp diag file, and also to add the missing file comments for it. v1->v2: split them into two patches as Marcelo suggested. Xin Long (2): sctp: rename sctp_diag.c as diag.c sctp: add file comments in diag.c net/sctp/Makefile| 2 +

[PATCHv2 net] sctp: fix some copy-paste errors for file comments

2018-02-13 Thread Xin Long
ment make_datafrag for sctp_stream_interleave") Signed-off-by: Xin Long <lucien@gmail.com> --- net/sctp/stream.c| 2 +- net/sctp/stream_interleave.c | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/net/sctp/stream.c b/net/sctp/stream.c index cedf672..f799043 100644 --- a/net

Re: [PATCH net] sctp: rename sctp_diag.c as diag.c

2018-02-12 Thread Xin Long
On Mon, Feb 12, 2018 at 11:12 PM, David Miller <da...@davemloft.net> wrote: > From: Marcelo Ricardo Leitner <marcelo.leit...@gmail.com> > Date: Mon, 12 Feb 2018 10:37:04 -0200 > >> On Mon, Feb 12, 2018 at 06:32:30PM +0800, Xin Long wrote: >>> Remove sctp_ pref

Re: [PATCH net] sctp: fix some copy-paste errors for file comments

2018-02-12 Thread Xin Long
On Mon, Feb 12, 2018 at 10:12 PM, Neil Horman <nhor...@tuxdriver.com> wrote: > On Mon, Feb 12, 2018 at 06:30:34PM +0800, Xin Long wrote: >> This patch is to fix the file comments in stream.c and >> stream_interleave.c >> >> Fixes: a83863174a61 ("sctp:

[PATCH net] sctp: rename sctp_diag.c as diag.c

2018-02-12 Thread Xin Long
Remove sctp_ prefix for diag file, to keep consistent with other files' names, while at it, also to add file comments for diag.c. Signed-off-by: Xin Long <lucien@gmail.com> --- net/sctp/Makefile| 2 + net/sctp/diag.c | 557 ++

[PATCH net] sctp: remove the useless check in sctp_renege_events

2018-02-12 Thread Xin Long
leave") Signed-off-by: Xin Long <lucien@gmail.com> --- net/sctp/stream_interleave.c | 8 ++-- 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/net/sctp/stream_interleave.c b/net/sctp/stream_interleave.c index c19fd42..65ac03b 100644 --- a/net/sctp/stream_interleave.

[PATCH net] sctp: fix some copy-paste errors for file comments

2018-02-12 Thread Xin Long
This patch is to fix the file comments in stream.c and stream_interleave.c Fixes: a83863174a61 ("sctp: prepare asoc stream for stream reconf") Fixes: 0c3f6f655487 ("sctp: implement make_datafrag for sctp_stream_interleave") Signed-off-by: Xin Long <lucien@gmail.com&

[PATCH net] sctp: add SCTP_CID_I_DATA and SCTP_CID_I_FWD_TSN conversion in sctp_cname

2018-02-12 Thread Xin Long
After the support for SCTP_CID_I_DATA and SCTP_CID_I_FWD_TSN chunks, the corresp conversion in sctp_cname should also be added. Otherwise, in some places, pr_debug will print them as "unknown chunk". Signed-off-by: Xin Long <lucien@gmail.com> --- net/sctp/debug.c | 6 ++

[PATCH net] sctp: do not pr_err for the duplicated node in transport rhlist

2018-02-12 Thread Xin Long
r any kmsg. Fixes: cd2b70875058 ("sctp: check duplicate node before inserting a new transport") Reported-by: Wei Chen <weic...@redhat.com> Signed-off-by: Xin Long <lucien@gmail.com> --- net/sctp/input.c | 5 + 1 file changed, 1 insertion(+), 4 deletions(-) diff --g

[PATCH net] bridge: check brport attr show in brport_show

2018-02-12 Thread Xin Long
473c85 ("bridge: add sysfs hook to flush forwarding table") Reported-by: Xiong Zhou <xz...@redhat.com> Signed-off-by: Xin Long <lucien@gmail.com> --- net/bridge/br_sysfs_if.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/net/bridge/br_sysfs_if.c b/net/bridge

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

2018-02-10 Thread Xin Long
On Fri, Feb 2, 2018 at 3:21 AM, syzbot wrote: > Hello, > > syzbot hit the following crash on net-next commit > b2fe5fa68642860e7de76167c3111623aa0d5de1 (Wed Jan 31 22:31:10 2018 +) > Merge

Re: possible deadlock in rtnl_lock (4)

2018-02-08 Thread Xin Long
On Thu, Feb 8, 2018 at 9:25 PM, Dmitry Vyukov <dvyu...@google.com> wrote: > On Thu, Feb 8, 2018 at 10:54 AM, Xin Long <lucien@gmail.com> wrote: >> On Thu, Feb 8, 2018 at 6:58 AM, syzbot >> <syzbot+ddde1c7b7ff7442d7...@syzkaller.appspotmail.com> wro

Re: [PATCH net v2] netfilter: drop outermost socket lock in getsockopt()

2018-02-08 Thread Xin Long
err = compat_nf_getsockopt(sk, PF_INET6, > - optname, optval, ); > - release_sock(sk); > + err = compat_nf_getsockopt(sk, PF_INET6, optname, optval, > ); > if (err >= 0) > err = put_user(len, optlen); > } > -- > 2.14.3 > Reviewed-by: Xin Long <lucien@gmail.com>

Re: [Patch net] ipt_CLUSTERIP: fix a race condition of proc file creation

2018-02-08 Thread Xin Long
CLUSTERIP: check duplicate config when > initializing") > Tested-by: Paolo Abeni <pab...@redhat.com> > Cc: Xin Long <lucien@gmail.com> > Cc: Pablo Neira Ayuso <pa...@netfilter.org> > Signed-off-by: Cong Wang <xiyou.wangc...@gmail.com> > --- > net

Re: [PATCH net] netfilter: on setsockopt() acquire sock lock only in the required scope

2018-02-08 Thread Xin Long
On Thu, Feb 8, 2018 at 6:38 PM, Paolo Abeni wrote: > The Syzbot reported a possible deadlock in the netfilter area caused by > rtnl lock, xt lock and socket lock being acquired with a different order > on different code paths, leading to the following backtrace: > >

Re: possible deadlock in rtnl_lock (4)

2018-02-08 Thread Xin Long
On Thu, Feb 8, 2018 at 6:58 AM, syzbot wrote: > Hello, > > syzbot hit the following crash on upstream commit > a2e5790d841658485d642196dbb0927303d6c22f (Wed Feb 7 06:15:42 2018 +) > Merge branch 'akpm' (patches from Andrew) > > So far

Re: [PATCH net v3] sctp: fix dst refcnt leak in sctp_v4_get_dst

2018-02-05 Thread Xin Long
On Tue, Feb 6, 2018 at 7:20 AM, David Ahern wrote: > On 2/5/18 12:48 PM, Tommi Rantala wrote: >> Fix dst reference count leak in sctp_v4_get_dst() introduced in commit >> 410f03831 ("sctp: add routing output fallback"): >> >> When walking the address_list, successive

Re: net: hang in unregister_netdevice: waiting for lo to become free

2018-02-03 Thread Xin Long
On Thu, Feb 1, 2018 at 1:49 AM, Xin Long <lucien@gmail.com> wrote: > On Tue, Jan 30, 2018 at 11:59 PM, David Ahern <dsah...@gmail.com> wrote: >> On 1/30/18 1:57 PM, David Ahern wrote: >>> On 1/30/18 1:08 PM, Daniel Borkmann wrote: >>>> On 01/30/2018 07

Re: possible deadlock in rtnl_lock (2)

2018-02-03 Thread Xin Long
On Thu, Feb 1, 2018 at 7:58 PM, syzbot wrote: > Hello, > > syzbot hit the following crash on upstream commit > 255442c93843f52b6891b21d0b485bf2c97f93c3 (Thu Feb 1 03:25:25 2018 +) > Merge tag 'docs-4.16' of git://git.lwn.net/linux > > So

Re: net: hang in unregister_netdevice: waiting for lo to become free

2018-01-31 Thread Xin Long
quot;net: tcp: close >>> sock if net namespace is exiting") in net/net-next from 5 days ago, maybe >>> fixed due to that? >>> >> >> This appears to be the commit introducing the refcnt leak: >> >> $ git bisect bad >> dbc2b5e9a09e9a666467

Re: [PATCH] net: make sure skb_dst is valid before using

2018-01-24 Thread Xin Long
On Wed, Jan 24, 2018 at 6:42 AM, Roman Kapl wrote: > Tunnel devices often use skb_dst(skb)->ops, but ops are not implemented > for metadata tunnel destinations. Use skb_valid_dst to check if skb_dst > is a real (non-metadata) destination. > > Such packets can easily be crafted

[PATCH net-next] sctp: reset ret in again path in sctp_for_each_transport

2018-01-23 Thread Xin Long
g sctpdiag testcase in sctp-tests. Note that this issue doesn't affect net.git yet. Fixes: 97a6ec4ac021 ("rhashtable: Change rhashtable_walk_start to return void") Signed-off-by: Xin Long <lucien@gmail.com> --- net/sctp/socket.c | 3 ++- 1 file changed, 2 insertions(+), 1 del

Re: [PATCH net] pppoe: take ->needed_headroom of lower device into account on xmit

2018-01-23 Thread Xin Long
gt; } > > /* Reserve space for headers. */ > - skb_reserve(skb, dev->hard_header_len); > + skb_reserve(skb, hlen); > skb_reset_network_header(skb); > > skb->dev = dev; > @@ -930,7 +931,7 @@ static int __pppoe_xmit(struct sock *sk, struct sk_buff > *skb) > /* Copy the data if there is no space for the header or if it's > * read-only. > */ > - if (skb_cow_head(skb, sizeof(*ph) + dev->hard_header_len)) > + if (skb_cow_head(skb, LL_RESERVED_SPACE(dev) + sizeof(*ph))) > goto abort; > > __skb_push(skb, sizeof(*ph)); Reviewed-by: Xin Long <lucien@gmail.com> > -- > 2.15.1 >

Re: [PATCH net] vxlan: update skb dst pmtu on tx path

2018-01-23 Thread Xin Long
On Tue, Jan 23, 2018 at 6:35 AM, Roman Kapl <c...@rkapl.cz> wrote: > On 12/18/2017 07:20 AM, Xin Long wrote: >> >> Unlike ip tunnels, now vxlan doesn't do any pmtu update for >> upper dst pmtu, even if it doesn't match the lower dst pmtu >> any more. >>

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

2018-01-19 Thread Xin Long
On Sat, Jan 20, 2018 at 1:19 AM, Guillaume Nault <g.na...@alphalink.fr> wrote: > On Tue, Jan 16, 2018 at 04:21:40PM +0800, Xin Long wrote: >> ipv4 tunnels don't really set dev->hard_header_len properly, >> we may should fix it in pppoe by using needed_headroom, >> as

Re: general protection fault in strlen

2018-01-18 Thread Xin Long
On Thu, Jan 18, 2018 at 11:58 PM, syzbot wrote: > Hello, > > syzbot hit the following crash on upstream commit > 8cbab92dff778e516064c13113ca15d4869ec883 > > So far this crash happened 19 times on linux-next, net-next, upstream. > C

[PATCH net] netlink: reset extack earlier in netlink_rcv_skb

2018-01-17 Thread Xin Long
by: syzbot+03bee3680a3746677...@syzkaller.appspotmail.com Signed-off-by: Xin Long <lucien@gmail.com> --- net/netlink/af_netlink.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c index 47ef2d8..84a4e4c 100644 --- a/net/netl

Re: KASAN: stack-out-of-bounds Read in __nla_put

2018-01-17 Thread Xin Long
On Thu, Jan 18, 2018 at 12:59 AM, David Ahern <dsah...@gmail.com> wrote: > On 1/17/18 2:39 AM, Xin Long wrote: >> I guess you need to move up your memset(0) a little bit: >> >> @@ -2427,6 +2443,7 @@ int netlink_rcv_skb(struct sk_buff *skb, int >> (*cb)(struct

Re: tun: memory leak in tun_set_iff

2018-01-17 Thread Xin Long
On Wed, Jan 10, 2018 at 2:20 AM, Dmitry Vyukov wrote: > Hello, > > syzkaller has hit the following memory leak on 4.15-rc7. > Reproducer is attached. > > unreeferenced object 0x88002c9ac400 (size 4096): > comm "syz-executor0", pid 12349, jiffies 4295751114 (age 10.067s)

Re: KASAN: stack-out-of-bounds Read in __nla_put

2018-01-17 Thread Xin Long
On Wed, Jan 17, 2018 at 1:58 AM, syzbot wrote: > Hello, > > syzkaller hit the following crash on > fdddade65d7b5f8779374eb73d09889185280f60 > git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/master > compiler: gcc (GCC) 7.1.1

Re: [PATCH net] sctp: return error if the asoc has been peeled off in sctp_wait_for_sndbuf

2018-01-16 Thread Xin Long
On Tue, Jan 16, 2018 at 8:32 PM, Neil Horman <nhor...@tuxdriver.com> wrote: > On Tue, Jan 16, 2018 at 02:12:50PM +0800, Xin Long wrote: >> On Tue, Jan 16, 2018 at 2:58 AM, Neil Horman <nhor...@tuxdriver.com> wrote: >> > On Tue, Jan 16, 2018 at 01:20:28AM +0800, Xin Lo

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

2018-01-16 Thread Xin Long
On Tue, Jan 16, 2018 at 4:22 AM, syzbot wrote: > syzkaller has found reproducer for the following crash on > b625c1ff82272e26c76570d3c7123419ec345b20 >

Re: [PATCH net] sctp: return error if the asoc has been peeled off in sctp_wait_for_sndbuf

2018-01-15 Thread Xin Long
On Tue, Jan 16, 2018 at 2:58 AM, Neil Horman <nhor...@tuxdriver.com> wrote: > On Tue, Jan 16, 2018 at 01:20:28AM +0800, Xin Long wrote: >> On Mon, Jan 15, 2018 at 9:06 PM, Neil Horman <nhor...@tuxdriver.com> wrote: >> > On Mon, Jan 15, 2018 at 05:01:36PM +0800, Xin

Re: [PATCH net] sctp: return error if the asoc has been peeled off in sctp_wait_for_sndbuf

2018-01-15 Thread Xin Long
On Mon, Jan 15, 2018 at 9:06 PM, Neil Horman <nhor...@tuxdriver.com> wrote: > On Mon, Jan 15, 2018 at 05:01:36PM +0800, Xin Long wrote: >> After commit cea0cc80a677 ("sctp: use the right sk after waking up from >> wait_buf sleep"), it may change to lock another sk

[PATCH net] sctp: do not allow the v4 socket to bind a v4mapped v6 address

2018-01-15 Thread Xin Long
it by doing the common sa.sa_family check first, then AF_INET check for v4mapped v6 addrs. Fixes: 7dab83de50c7 ("sctp: Support ipv6only AF_INET6 sockets.") Reported-by: syzbot+7b7b518b1228d2743...@syzkaller.appspotmail.com Acked-by: Neil Horman <nhor...@tuxdriver.com> Signed-off-by:

[PATCH net] sctp: reinit stream if stream outcnt has been change by sinit in sendmsg

2018-01-15 Thread Xin Long
value is not updated, the sinit_num_ostreams of sinit could not really work. This patch is to fix it by updating stream->outcnt and reiniting stream if stream outcnt has been change by sinit in sendmsg. Fixes: a83863174a61 ("sctp: prepare asoc stream for stream reconf") Signed-off-b

[PATCH net] sctp: return error if the asoc has been peeled off in sctp_wait_for_sndbuf

2018-01-15 Thread Xin Long
677 ("sctp: use the right sk after waking up from wait_buf sleep") Reported-by: syzbot+ac6ea7baa4432811e...@syzkaller.appspotmail.com Signed-off-by: Xin Long <lucien@gmail.com> --- net/sctp/socket.c | 16 ++-- 1 file changed, 6 insertions(+), 10 deletions(-) diff -

Re: [PATCH net] sctp: removed unused var from sctp_make_auth

2018-01-12 Thread Xin Long
m this list: send the line "unsubscribe linux-sctp" in > the body of a message to majord...@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html Reviewed-by: Xin Long <lucien@gmail.com>

Re: [PATCH net] sctp: avoid compiler warning on implicit fallthru

2018-01-12 Thread Xin Long
we are sending these, then we can > -- > 2.14.3 > > -- > To unsubscribe from this list: send the line "unsubscribe linux-sctp" in > the body of a message to majord...@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html Reviewed-by: Xin Long <lucien@gmail.com>

Re: WARNING in netlink_ack (2)

2018-01-12 Thread Xin Long
On Thu, Jan 11, 2018 at 1:31 AM, syzbot wrote: > Hello, > > syzkaller hit the following crash on > cf1fb158230edce8a0482bfb2e59b9c390477fb6 > git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/master > compiler: gcc (GCC) 7.1.1

Re: general protection fault in sctp_v6_get_dst

2018-01-11 Thread Xin Long
On Thu, Jan 11, 2018 at 2:15 AM, syzbot wrote: > syzkaller has found reproducer for the following crash on > 61ad64080e039dce99a7f8d89b729bbea995e2f7 > git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git/master > compiler: gcc

Re: WARNING: held lock freed!

2018-01-08 Thread Xin Long
On Mon, Jan 8, 2018 at 8:09 PM, Marcelo Ricardo Leitner <marcelo.leit...@gmail.com> wrote: > On Mon, Jan 08, 2018 at 06:01:14PM +0800, Xin Long wrote: >> On Mon, Jan 8, 2018 at 6:58 AM, syzbot >> <syzbot+ac6ea7baa4432811e...@syzkaller.appspotmail.com> wrote: >>

Re: WARNING: held lock freed!

2018-01-08 Thread Xin Long
; BUG: KASAN: use-after-free in do_raw_spin_lock+0x1e0/0x220 > kernel/locking/spinlock_debug.c:112 > Read of size 4 at addr 8801c17ab08c by task syzkaller065230/3505 It seems this commit is buggy: commit cea0cc80a6777beb6eb643d4ad53690e1ad1d4ff Author: Xin Long <lucien@gmail.com> D

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

2018-01-05 Thread Xin Long
On Sat, Jan 6, 2018 at 6:07 AM, syzbot wrote: > Hello, > > syzkaller hit the following crash on > 8a4816cad00bf14642f0ed6043b32d29a05006ce > git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git/master > compiler: gcc (GCC) 7.1.1

Re: [PATCH net v3 0/2] SCTP PMTU discovery fixes

2018-01-05 Thread Xin Long
include/net/sctp/structs.h | 2 +- > net/sctp/input.c | 28 > net/sctp/transport.c | 29 +++-- > 3 files changed, 36 insertions(+), 23 deletions(-) > > -- > 2.14.3 > Reviewed-by: Xin Long <lucien@gmail.com>

Re: [PATCH net v2 1/2] sctp: do not retransmit upon FragNeeded if PMTU discovery is disabled

2018-01-04 Thread Xin Long
On Thu, Jan 4, 2018 at 7:23 PM, Marcelo Ricardo Leitner <marcelo.leit...@gmail.com> wrote: > On Thu, Jan 04, 2018 at 12:52:32PM +0800, Xin Long wrote: >> On Thu, Jan 4, 2018 at 6:59 AM, Marcelo Ricardo Leitner >> <marcelo.leit...@gmail.com> wrote: >> > Curr

Re: [PATCH net v2 1/2] sctp: do not retransmit upon FragNeeded if PMTU discovery is disabled

2018-01-03 Thread Xin Long
On Thu, Jan 4, 2018 at 6:59 AM, Marcelo Ricardo Leitner wrote: > Currently, if PMTU discovery is disabled on a given transport, but the > configured value is higher than the actual PMTU, it is likely that we > will get some icmp Frag Needed. The issue is, if PMTU

Re: [PATCH net] sctp: fix handling of ICMP Frag Needed for too small MTUs

2018-01-03 Thread Xin Long
On Wed, Jan 3, 2018 at 9:35 PM, Marcelo Ricardo Leitner <marcelo.leit...@gmail.com> wrote: > On Wed, Jan 03, 2018 at 03:31:00PM +0800, Xin Long wrote: >> On Wed, Jan 3, 2018 at 5:44 AM, Marcelo Ricardo Leitner >> <marcelo.leit...@gmail.com> wrote: >> > s

Re: [PATCH net] sctp: fix handling of ICMP Frag Needed for too small MTUs

2018-01-02 Thread Xin Long
On Wed, Jan 3, 2018 at 5:44 AM, Marcelo Ricardo Leitner wrote: > syzbot reported a hang involving SCTP, on which it kept flooding dmesg > with the message: > [ 246.742374] sctp: sctp_transport_update_pmtu: Reported pmtu 508 too > low, using default minimum of 512 > >

Re: [PATCH net] sctp: fix error path in sctp_stream_init

2018-01-02 Thread Xin Long
gt;outcnt, it made a for() in sctp_stream_free() > think that it had elements to free, but not, leading to the panic. > > As suggested by Xin Long, this patch also simplifies the error path by > moving it to the only if() that uses it. > > See-also: https://www.spinics.net/lists/netdev/msg473756.html

Re: general protection fault in skb_segment

2017-12-31 Thread Xin Long
On Sun, Dec 31, 2017 at 10:25 AM, Marcelo Ricardo Leitner wrote: > On Sat, Dec 30, 2017 at 10:52:20PM -0200, Marcelo Ricardo Leitner wrote: >> On Sat, Dec 30, 2017 at 08:42:41AM +0100, Willem de Bruijn wrote: > [...] >> > Somewhat tangential, but any PF_PACKET socket

Re: general protection fault in skb_segment

2017-12-30 Thread Xin Long
On Sat, Dec 30, 2017 at 7:54 PM, Willem de Bruijn wrote: >> So this is a packet socket writing something that apparently looks >> like an SCTP packet, is only 42 bytes long, but has GSO set in its >> virtio_net_hdr struct. >> >> It crashes in skb_segment seemingly

[PATCH net] ip6_tunnel: allow ip6gre dev mtu to be set below 1280

2017-12-24 Thread Xin Long
below 1280, the same issue also exists on ip6gre. This patch is to fix it by simply changing to check if parms.proto is IPPROTO_IPV6 in ip6_tnl_change_mtu instead, to make ip6gre to go to 'else' branch. Signed-off-by: Xin Long <lucien@gmail.com> --- net/ipv6/ip6_tunnel.c | 6 +++--- 1

[PATCH net] geneve: update skb dst pmtu on tx path

2017-12-24 Thread Xin Long
n creating it. The performance is very low later when netperfing over it without fixing the mtu manually. This patch could also avoid this issue. Signed-off-by: Xin Long <lucien@gmail.com> --- drivers/net/geneve.c | 14 ++ 1 file changed, 14 insertions(+) diff --git a/drivers/net/geneve

Re: BUG: unable to handle kernel NULL pointer dereference in sctp_stream_free

2017-12-21 Thread Xin Long
On Thu, Dec 21, 2017 at 9:13 PM, Marcelo Ricardo Leitner wrote: > On Wed, Dec 20, 2017 at 12:51:01PM -0800, syzbot wrote: > > from the log: > [ 89.451366] FAULT_INJECTION: forcing a failure.^M > [ 89.451366] name failslab, interval 1, probability 0, space 0, > times

Re: [PATCH net] vxlan: update skb dst pmtu on tx path

2017-12-21 Thread Xin Long
On Wed, Dec 20, 2017 at 2:38 AM, David Miller <da...@davemloft.net> wrote: > From: Xin Long <lucien@gmail.com> > Date: Wed, 20 Dec 2017 01:05:32 +0800 > >> On Wed, Dec 20, 2017 at 12:12 AM, David Miller <da...@davemloft.net> wrote: >>> You're going

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