Re: [tipc-discussion] FW: [net 1/1] tipc: sanity check on received netlink buffer

2018-12-21 Thread Xin Long
On Fri, Dec 21, 2018 at 12:35 AM Jon Maloy wrote: > > Hi Ying and Xin, > Any viewpoints on this before I send it in? > It should be noted that skb->tail in the worst case will be the same as > skb->end, which points to the first byte of the skb_shared_info area. > Lucklily, and not only due to

Re: [tipc-discussion] KMSAN: uninit-value in tipc_nl_compat_bearer_enable (2)

2019-03-30 Thread Xin Long
On Thu, Mar 28, 2019 at 1:55 AM syzbot wrote: > > Hello, > > syzbot found the following crash on: > > HEAD commit:9536b452 kmsan: uaccess.h: fix variable name conflicts > git tree: kmsan > console output: https://syzkaller.appspot.com/x/log.txt?x=15f5d58320 > kernel config:

Re: [tipc-discussion] KMSAN: uninit-value in tipc_nl_compat_name_table_dump (2)

2019-03-30 Thread Xin Long
On Fri, Mar 29, 2019 at 12:26 AM syzbot wrote: > > Hello, > > syzbot found the following crash on: > > HEAD commit:a695dc5e kmsan: fixup mm/sl[au]b.[ch] after rebase > git tree: kmsan > console output: https://syzkaller.appspot.com/x/log.txt?x=1683e04d20 > kernel config:

Re: [tipc-discussion] KMSAN: uninit-value in tipc_nl_compat_link_set (3)

2019-03-30 Thread Xin Long
On Thu, Mar 28, 2019 at 1:54 AM syzbot wrote: > > Hello, > > syzbot found the following crash on: > > HEAD commit:c530a275 kmsan: call vmap hooks from vmalloc and ioremap f.. > git tree: kmsan > console output: https://syzkaller.appspot.com/x/log.txt?x=13bd473320 > kernel config:

[tipc-discussion] [PATCH net 0/3] tipc: a batch of uninit-value fixes for netlink_compat

2019-03-31 Thread Xin Long
These issues were all reported by syzbot, and exist since very beginning. See the details on each patch. Xin Long (3): tipc: check bearer name with right length in tipc_nl_compat_bearer_enable tipc: check link name with right length in tipc_nl_compat_link_set tipc: handle the err

[tipc-discussion] [PATCH net 3/3] tipc: handle the err returned from cmd header function

2019-03-31 Thread Xin Long
n't stop calling tipc_nl_compat_name_table_dump(), and the issue will be triggered again. So this patch is to add the process for the err returned from cmd header function in tipc_nl_compat_dumpit(). Reported-by: syzbot+3ce8520484b0d4e26...@syzkaller.appspotmail.com Signed-off-by: Xin Lon

[tipc-discussion] [PATCH net 1/3] tipc: check bearer name with right length in tipc_nl_compat_bearer_enable

2019-03-31 Thread Xin Long
which also includes priority and disc_domain length. This patch is to fix it by checking it with a right length: 'TLV_GET_DATA_LEN(msg->req) - offsetof(struct tipc_bearer_config, name)'. Reported-by: syzbot+8b707430713eb46e1...@syzkaller.appspotmail.com Signed-off-by: Xin Long ---

[tipc-discussion] [PATCH net 2/3] tipc: check link name with right length in tipc_nl_compat_link_set

2019-03-31 Thread Xin Long
ed-by: syzbot+de00a87b8644a582a...@syzkaller.appspotmail.com Signed-off-by: Xin Long --- net/tipc/netlink_compat.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/net/tipc/netlink_compat.c b/net/tipc/netlink_compat.c index 5f8e53c..0bfd03d6 100644 --- a/net/tipc/netlink_compa

[tipc-discussion] [PATCH net] tipc: change to check tipc_own_id to return in tipc_net_stop

2019-03-23 Thread Xin Long
5c85a4 ("tipc: obtain node identity from interface by default") Reported-by: syzbot+a25307ad099309f1c...@syzkaller.appspotmail.com Signed-off-by: Xin Long --- net/tipc/net.c | 5 + 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/net/tipc/net.c b/net/tipc/net.c index f076edb..7

Re: [tipc-discussion] memory leak in tipc_buf_acquire

2019-06-09 Thread Xin Long
On Sat, May 25, 2019 at 5:18 AM syzbot wrote: > > Hello, > > syzbot found the following crash on: > > HEAD commit:4dde821e Merge tag 'xfs-5.2-fixes-1' of git://git.kernel.o.. > git tree: upstream > console output: https://syzkaller.appspot.com/x/log.txt?x=107db73aa0 > kernel config:

[tipc-discussion] [PATCH net] tipc: add dst_cache support for udp media

2019-06-20 Thread Xin Long
As other udp/ip tunnels do, tipc udp media should also have a lockless dst_cache supported on its tx path. Here we add dst_cache into udp_replicast to support dst cache for both rmcast and rcast, and rmcast uses ub->rcast and each rcast uses its own node in ub->rcast.list. Signed-off-b

Re: [tipc-discussion] [PATCH net 0/3] net: fix quite a few dst_cache crashes reported by syzbot

2019-06-20 Thread Xin Long
t; udp4_ufo_fragment() -> skb_udp_tunnel_segment() -> skb_udp_tunnel_segment() -> tipc_gso_fragment() btw, do we have an official ipproto number for TIPC already? > Do you have any comments on this? Could it possibly be done differently? > > ///jon > > > > -Original Message- >

[tipc-discussion] [PATCH net] tipc: change to use register_pernet_device

2019-06-20 Thread Xin Long
necessary for tipc dst_cache, which will hold dsts on tx path and I will introduce in my next patch. Reported-by: Li Shuang Signed-off-by: Xin Long --- net/tipc/core.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/net/tipc/core.c b/net/tipc/core.c index ed536c

Re: [tipc-discussion] KMSAN: uninit-value in tipc_nl_compat_bearer_disable

2019-06-21 Thread Xin Long
On Wed, Jun 19, 2019 at 11:48 PM syzbot wrote: > > Hello, > > syzbot found the following crash on: > > HEAD commit:f75e4cfe kmsan: use kmsan_handle_urb() in urb.c > git tree: kmsan > console output: https://syzkaller.appspot.com/x/log.txt?x=13d0a6fea0 > kernel config:

Re: [tipc-discussion] [PATCH net 0/3] net: fix quite a few dst_cache crashes reported by syzbot

2019-06-21 Thread Xin Long
On Fri, Jun 21, 2019 at 3:48 AM Erik Hugne wrote: > > Commenting on Jon's response fist. > > Den tors 20 juni 2019 kl 13:26 skrev Xin Long : > > > > On Mon, Jun 17, 2019 at 10:28 PM Jon Maloy wrote: > > > Hi Xin, > > > As I remember the discussion ar

[tipc-discussion] [PATCH net] tipc: remove the unnecessary msg->req check from tipc_nl_compat_bearer_set

2019-06-24 Thread Xin Long
tipc_nl_compat_bearer_set() is only called by tipc_nl_compat_link_set() which already does the check for msg->req check, so remove it from tipc_nl_compat_bearer_set(), and do the same in tipc_nl_compat_media_set(). Signed-off-by: Xin Long --- net/tipc/netlink_compat.c | 10 -- 1 f

Re: [tipc-discussion] [PATCH net] tipc: remove the unnecessary msg->req check from tipc_nl_compat_bearer_set

2019-06-24 Thread Xin Long
On Mon, Jun 24, 2019 at 10:35 PM David Miller wrote: > > From: Xin Long > Date: Mon, 24 Jun 2019 16:02:42 +0800 > > > tipc_nl_compat_bearer_set() is only called by tipc_nl_compat_link_set() > > which already does the check for msg->req check, so remove it from &g

Re: [tipc-discussion] [PATCH net] tipc: check msg->req data len in tipc_nl_compat_bearer_disable

2019-06-24 Thread Xin Long
On Mon, Jun 24, 2019 at 4:33 PM Eric Dumazet wrote: > > > > On 6/24/19 12:59 AM, Xin Long wrote: > > This patch is to fix an uninit-value issue, reported by syzbot: > > > > BUG: KMSAN: uninit-value in memchr+0xce/0x110 lib/string.c:981 > > Call Trace: >

[tipc-discussion] [PATCHv2 net] tipc: check msg->req data len in tipc_nl_compat_bearer_disable

2019-06-24 Thread Xin Long
add the missing Fixes tags per Eric's request. Fixes: 0762216c0ad2 ("tipc: fix uninit-value in tipc_nl_compat_bearer_enable") Fixes: 8b66fee7f8ee ("tipc: fix uninit-value in tipc_nl_compat_link_reset_stats") Reported-by: syzbot+30eaa8bf392f7faff...@syzkaller.appspotmail.com

Re: [tipc-discussion] [PATCH net-next] tipc: use rcu dereference functions properly

2019-07-03 Thread Xin Long
On Wed, Jul 3, 2019 at 6:08 AM David Miller wrote: > > From: Xin Long > Date: Tue, 2 Jul 2019 00:54:55 +0800 > > > For these places are protected by rcu_read_lock, we change from > > rcu_dereference_rtnl to rcu_dereference, as there is no need to > &

[tipc-discussion] [PATCH net-next] tipc: use rcu dereference functions properly

2019-07-01 Thread Xin Long
memory barriers are needed under rtnl_lock() which also protects tn->bearer_list[] and dev->tipc_ptr/b->media_ptr updating. rcu_dereference_rtnl will be only used in the places where it could be under rcu_read_lock or rtnl_lock. Signed-off-by: Xin Long --- net/tipc/bearer.

[tipc-discussion] [PATCH net-next] tipc: remove ub->ubsock checks

2019-07-01 Thread Xin Long
Both tipc_udp_enable and tipc_udp_disable are called under rtnl_lock, ub->ubsock could never be NULL in tipc_udp_disable and cleanup_bearer, so remove the check. Also remove the one in tipc_udp_enable by adding "free" label. Signed-off-by: Xin Long --- net/tipc/udp

[tipc-discussion] [PATCH net] tipc: add NULL pointer check before calling kfree_rcu

2019-09-03 Thread Xin Long
+0xa9/0x410 ip_rcv+0x273/0x362 Fixes: 97ede29e80ee ("tipc: convert name table read-write lock to RCU") Reported-by: Li Shuang Signed-off-by: Xin Long --- net/tipc/name_distr.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/net/tipc/name_distr.c b/net/tipc/na

[tipc-discussion] [PATCH net] tipc: purge deferredq list for each grp member in tipc_group_delete

2019-06-16 Thread Xin Long
r's deferredq in tipc_group_delete() when a tipc sk leaves the grp. Fixes: b87a5ea31c93 ("tipc: guarantee group unicast doesn't bypass group broadcast") Reported-by: syzbot+78fbe679c8ca8d264...@syzkaller.appspotmail.com Signed-off-by: Xin Long --- net/tipc/group.c | 1 + 1 file changed, 1 inser

Re: [tipc-discussion] [PATCH net-next] tipc: use rcu dereference functions properly

2019-07-06 Thread Xin Long
On Wed, Jul 3, 2019 at 4:33 PM Xin Long wrote: > > On Wed, Jul 3, 2019 at 6:08 AM David Miller wrote: > > > > From: Xin Long > > Date: Tue, 2 Jul 2019 00:54:55 +0800 > > > > > For these places are protected by rcu_read_lock, we change from > &

Re: [tipc-discussion] [PATCH v2 3/3] tipc: fix issue of calling smp_processor_id() in preemptible

2020-02-20 Thread Xin Long
On Wed, Feb 19, 2020 at 4:34 PM Dmitry Vyukov wrote: > > On Wed, Feb 19, 2020 at 9:29 AM Dmitry Vyukov wrote: > > > > On Mon, Aug 12, 2019 at 9:44 AM Ying Xue wrote: > > > > > > syzbot found the following issue: > > > > > > [ 81.119772][ T8612] BUG: using smp_processor_id() in preemptible >

Re: [tipc-discussion] [PATCH net] tipc: block BH before using dst_cache

2020-05-22 Thread Xin Long
On Fri, May 22, 2020 at 1:55 PM Eric Dumazet wrote: > > Resend to the list in non HTML form > > > On Thu, May 21, 2020 at 10:53 PM Eric Dumazet wrote: > > > > > > > > On Thu, May 21, 2020 at 10:50 PM Xin Long wrote: > >> > >

[tipc-discussion] [PATCH net] tipc: use skb_unshare() instead in tipc_buf_append()

2020-09-13 Thread Xin Long
skb for the cloned frag and it'll be safe to change its frag_list. The similar things were also done in sctp_make_reassembled_event(), which is using skb_copy(). Reported-by: Shuang Li Fixes: 37e22164a8a3 ("tipc: rename and move message reassembly function") Signed-off-by: Xin Long ---

Re: [tipc-discussion] [PATCH net] tipc: not enable tipc when ipv6 works as a module

2020-08-18 Thread Xin Long
On Tue, Aug 18, 2020 at 6:20 AM Cong Wang wrote: > > On Mon, Aug 17, 2020 at 2:39 PM David Miller wrote: > > > > From: Cong Wang > > Date: Mon, 17 Aug 2020 13:59:46 -0700 > > > > > Is this a new Kconfig feature? ipv6_stub was introduced for > > > VXLAN, at that time I don't remember we have

Re: [tipc-discussion] WARNING: suspicious RCU usage in tipc_l2_send_msg

2020-08-19 Thread Xin Long
On Sat, Jun 27, 2020 at 1:25 AM syzbot wrote: > > Hello, > > syzbot found the following crash on: > > HEAD commit:b835a71e usbnet: smsc95xx: Fix use-after-free after removal > git tree: net > console output: https://syzkaller.appspot.com/x/log.txt?x=1095a51d10 > kernel config:

[tipc-discussion] [PATCH net] tipc: call rcu_read_lock() in tipc_aead_encrypt_done()

2020-08-20 Thread Xin Long
e TIPC encryption & authentication") Reported-by: syzbot+47bbc6b678d317ccc...@syzkaller.appspotmail.com Signed-off-by: Xin Long --- net/tipc/crypto.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/net/tipc/crypto.c b/net/tipc/crypto.c index 001bcb0..c38baba 100644 --- a/net/tipc/crypto.c +++ b/ne

[tipc-discussion] [PATCH net] ipv6: some fixes for ipv6_dev_find()

2020-08-17 Thread Xin Long
is passed into ipv6_dev_find(), as link-local addresses from user space has sin6_scope_id set and the dev lookup needs it. Fixes: 81f6cb31222d ("ipv6: add ipv6_dev_find()") Suggested-by: YOSHIFUJI Hideaki Reported-by: David Ahern Signed-off-by: Xin Long --- include/net/addrconf.h | 3 ++-

Re: [tipc-discussion] [PATCH net] tipc: not enable tipc when ipv6 works as a module

2020-08-17 Thread Xin Long
On Mon, Aug 17, 2020 at 2:29 AM Cong Wang wrote: > > On Sun, Aug 16, 2020 at 4:54 AM Xin Long wrote: > > > > When using ipv6_dev_find() in one module, it requires ipv6 not to > > work as a module. Otherwise, this error occurs in build: > > > > undefined refe

Re: [tipc-discussion] KASAN: use-after-free Read in tipc_mcast_xmit (2)

2020-10-03 Thread Xin Long
ada44d90 > C reproducer: https://syzkaller.appspot.com/x/repro.c?x=1400746790 > > The issue was bisected to: > > commit ff48b6222e65ebdba5a403ef1deba6214e749193 > Author: Xin Long > Date: Sun Sep 13 11:37:31 2020 + > > tipc: use skb_unshare() instead in tipc_b

Re: [tipc-discussion] [net v3 1/1] tipc: fix memory leak caused by tipc_buf_append()

2020-10-27 Thread Xin Long
are() returns NULL. > > Fixes: ed42989eab57 ("tipc: fix the skb_unshare() in tipc_buf_append()") > Acked-by: Jon Maloy > Reported-by: Thang Hoang Ngo > Signed-off-by: Tung Nguyen Reviewed-by: Xin Long > --- > net/tipc/msg.c | 5 ++--- > 1 file changed, 2 insertio

Re: [tipc-discussion] [net v1 1/1] tipc: fix memory leak caused by tipc_buf_append()

2020-10-26 Thread Xin Long
patch. Sorry, I realized it was a false one after double-checking. > > Thanks. > Tung Nguyen > > -Original Message- > From: Xin Long > Sent: Monday, October 26, 2020 4:10 PM > To: Tung Quang Nguyen > Cc: tipc-discussion@lists.sourceforge.net; Jon Maloy ; >

Re: [tipc-discussion] [net v1 1/1] tipc: fix memory leak caused by tipc_buf_append()

2020-10-26 Thread Xin Long
On Fri, Oct 23, 2020 at 4:20 PM Tung Nguyen wrote: > > Commit ed42989eab57 ("fix the skb_unshare() in tipc_buf_append()") > replaced skb_unshare() with skb_copy() to not reduce the data reference > counter of the original skb intentionally. This is not the correct > way to handle the cloned skb

[tipc-discussion] [PATCH net 0/2] net: fix a mcast issue for tipc udp media

2020-08-03 Thread Xin Long
Patch 1 is to add a function to get the dev by source address, whcih will be used by Patch 2. Xin Long (2): ipv6: add ipv6_dev_find() tipc: set ub->ifindex for local ipv6 address include/net/addrconf.h | 2 ++ net/ipv6/addrconf.c| 39 +++ net/t

[tipc-discussion] [PATCH net 2/2] tipc: set ub->ifindex for local ipv6 address

2020-08-03 Thread Xin Long
ddress. Reported-by: Shuang Li Signed-off-by: Xin Long --- net/tipc/udp_media.c | 8 1 file changed, 8 insertions(+) diff --git a/net/tipc/udp_media.c b/net/tipc/udp_media.c index 28a283f..9dec596 100644 --- a/net/tipc/udp_media.c +++ b/net/tipc/udp_media.c @@ -738,6 +738,13 @@ stat

[tipc-discussion] [PATCH net 1/2] ipv6: add ipv6_dev_find()

2020-08-03 Thread Xin Long
This is to add an ip_dev_find like function for ipv6, used to find the dev by saddr. It will be used by TIPC protocol. So also export it. Signed-off-by: Xin Long --- include/net/addrconf.h | 2 ++ net/ipv6/addrconf.c| 39 +++ 2 files changed, 41

Re: [tipc-discussion] [PATCH net 1/2] ipv6: add ipv6_dev_find()

2020-08-07 Thread Xin Long
On Thu, Aug 6, 2020 at 10:03 PM David Ahern wrote: > > On 8/6/20 2:55 AM, Xin Long wrote: > > On Thu, Aug 6, 2020 at 10:50 AM Hideaki Yoshifuji > > wrote: > >> > >> Hi, > >> > >> 2020年8月4日(火) 0:35 Xin Long : > >>> > &

Re: [tipc-discussion] [PATCH net 1/2] ipv6: add ipv6_dev_find()

2020-08-09 Thread Xin Long
On Fri, Aug 7, 2020 at 5:26 PM Hideaki Yoshifuji wrote: > > Hi, > > 2020年8月6日(木) 23:03 David Ahern : > > > > On 8/6/20 2:55 AM, Xin Long wrote: > > > On Thu, Aug 6, 2020 at 10:50 AM Hideaki Yoshifuji > > > wrote: > > >&g

Re: [tipc-discussion] [PATCH net 1/2] ipv6: add ipv6_dev_find()

2020-08-13 Thread Xin Long
On Tue, Aug 11, 2020 at 10:26 AM Hideaki Yoshifuji wrote: > > Hi, > > 2020年8月9日(日) 19:52 Xin Long : > > > > On Fri, Aug 7, 2020 at 5:26 PM Hideaki Yoshifuji > > wrote: > > > > > > Hi, > > > > > > 2020年8月6日(木) 23:03 David Ahern : &

Re: [tipc-discussion] [PATCH net 1/2] ipv6: add ipv6_dev_find()

2020-08-06 Thread Xin Long
On Thu, Aug 6, 2020 at 10:50 AM Hideaki Yoshifuji wrote: > > Hi, > > 2020年8月4日(火) 0:35 Xin Long : > > > > This is to add an ip_dev_find like function for ipv6, used to find > > the dev by saddr. > > > > It will be used by TIPC protocol. So also

Re: [tipc-discussion] [net-next] tipc: fix NULL pointer dereference in streaming

2020-07-21 Thread Xin Long
On Wed, Jun 3, 2020 at 1:06 PM Tuong Lien wrote: > > syzbot found the following crash: > > general protection fault, probably for non-canonical address > 0xdc19: [#1] PREEMPT SMP KASAN > KASAN: null-ptr-deref in range [0x00c8-0x00cf] > CPU: 1 PID: 7060

Re: [tipc-discussion] [net-next] tipc: fix NULL pointer dereference in streaming

2020-07-21 Thread Xin Long
On Tue, Jul 21, 2020 at 7:26 PM Tuong Tong Lien wrote: > > > > > -Original Message----- > > From: Xin Long > > Sent: Tuesday, July 21, 2020 6:23 PM > > To: Tuong Tong Lien > > Cc: davem ; jma...@redhat.com; ma...@donjonn.com; Ying >

[tipc-discussion] [PATCH net] tipc: not enable tipc when ipv6 works as a module

2020-08-16 Thread Xin Long
ot;tipc: set ub->ifindex for local ipv6 address") Reported-by: kernel test robot Acked-by: Randy Dunlap Signed-off-by: Xin Long --- net/tipc/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/net/tipc/Kconfig b/net/tipc/Kconfig index 9dd7802..be1c400 100644 --- a/net/tipc/Kconfig

[tipc-discussion] [PATCH net] Documentation: add more details in tipc.rst

2021-06-11 Thread Xin Long
kernel-doc for TIPC is too simple, we need to add more information for it. This patch is to extend the abstract, and add the Features and Links items. Signed-off-by: Xin Long --- Documentation/networking/tipc.rst | 121 +- 1 file changed, 118 insertions(+), 3

[tipc-discussion] [PATCH net] tipc: skb_linearize the head skb when reassembling msgs

2021-05-07 Thread Xin Long
calling skb_unshare(), as __skb_linearize() will avoid skb_copy(). Also, we can not just drop the frag_list either as the early time. Fixes: 45c8b7b175ce ("tipc: allow non-linear first fragment buffer") Reported-by: Li Shuang Signed-off-by: Xin Long --- net/tipc/msg.c | 9 ++--- 1 file

Re: [tipc-discussion] [net] Revert "net:tipc: Fix a double free in tipc_sk_mcast_rcv"

2021-05-15 Thread Xin Long
On Fri, May 14, 2021 at 7:18 PM Jon Maloy wrote: > > > > On 5/14/21 6:10 PM, patchwork-bot+netdev...@kernel.org wrote: > > Hello: > > > > This patch was applied to netdev/net.git (refs/heads/master): > > > > On Fri, 14 May 2021 08:23:03 +0700 you wrote: > >> This reverts commit

[tipc-discussion] [PATCH net] tipc: simplify the finalize work queue

2021-05-17 Thread Xin Long
pc_net_work". Note that it's safe to get net from tn->bcl as bcl is always released after the finalize work queue is done. Signed-off-by: Xin Long Acked-by: Jon Maloy --- net/tipc/core.c | 4 ++-- net/tipc/core.h | 8 +--- net/tipc/discover.c | 4 ++-- net/tipc/link.c |

Re: [tipc-discussion] [PATCH net] tipc: fix a race in tipc_sk_mcast_rcv

2021-05-14 Thread Xin Long
On Thu, May 13, 2021 at 5:15 PM Jon Maloy wrote: > > > > On 4/28/21 3:30 PM, Xin Long wrote: > > After commit cb1b728096f5 ("tipc: eliminate race condition at multicast > > reception"), when processing the multicast reception, the packets are > > fir

[tipc-discussion] [PATCH net] tipc: wait and exit until all work queues are done

2021-05-14 Thread Xin Long
in tipc_net to track the numbers of work queues in schedule, and wait and exit until all work queues are done in tipc_exit_net(). Reported-by: Shuang Li Signed-off-by: Xin Long --- net/tipc/core.c | 2 ++ net/tipc/core.h | 2 ++ net/tipc/udp_media.c | 2 ++ 3 files changed, 6 insertions

[tipc-discussion] [PATCH net] tipc: simplify the finalize work queue

2021-05-14 Thread Xin Long
pc_net_work". Note that it's safe to get net from tn->bcl as bcl is always released after the finalize work queue is done. Signed-off-by: Xin Long --- net/tipc/core.c | 4 ++-- net/tipc/core.h | 8 +--- net/tipc/discover.c | 4 ++-- net/tipc/link.c | 5 +

[tipc-discussion] [PATCH net] tipc: wait and exit until all work queues are done

2021-05-16 Thread Xin Long
in tipc_net to track the numbers of work queues in schedule, and wait and exit until all work queues are done in tipc_exit_net(). Fixes: d0f91938bede ("tipc: add ip/udp media type") Reported-by: Shuang Li Signed-off-by: Xin Long Acked-by: Jon Maloy --- net/tipc/core.c | 2 ++ net/t

Re: [tipc-discussion] DGRAM/STREAM Crossover on Debian?

2021-06-02 Thread Xin Long
On Wed, May 26, 2021 at 11:38 AM Duzan, Gary D via tipc-discussion wrote: > >I'm in the process of enhancing a TIPC DGRAM-based RPC-ish service to > include TIPC STREAM transport for larger messages. To simplify configuration, > I have the server process(es) bind() the same type/range for

[tipc-discussion] [PATCHv2 net-next] tipc: keep the skb in rcv queue until the whole data is read

2021-06-30 Thread Xin Long
old user applications. v1->v2: - To enable this only when the flags with MSG_EOR is passed into recvmsg() to fix the compatibility isssue as Erin noticed. Signed-off-by: Xin Long --- net/tipc/socket.c | 36 +++- 1 file changed, 27 insertions(+), 9 deleti

[tipc-discussion] [PATCH net-next] Documentation: add more details in tipc.rst

2021-06-30 Thread Xin Long
kernel-doc for TIPC is too simple, we need to add more information for it. This patch is to extend the abstract, and add the Features and Links items. Signed-off-by: Xin Long Acked-by: Jon Maloy --- Documentation/networking/tipc.rst | 121 +- 1 file changed, 118

Re: [tipc-discussion] [PATCH net-next] tipc: keep the skb in rcv queue until the whole data is read

2021-06-29 Thread Xin Long
On Tue, Jun 29, 2021 at 3:57 PM Jon Maloy wrote: > > > On 28/06/2021 15:16, Xin Long wrote: > > On Mon, Jun 28, 2021 at 3:03 PM Xin Long wrote: > >> On Sun, Jun 27, 2021 at 3:44 PM Erin Shepherd wrote: > >>> Xin Long writes: > >>> > >>&g

Re: [tipc-discussion] [PATCH net-next] tipc: keep the skb in rcv queue until the whole data is read

2021-06-30 Thread Xin Long
On Wed, Jun 30, 2021 at 10:33 AM Jon Maloy wrote: > > > On 29/06/2021 17:41, Xin Long wrote: > > On Tue, Jun 29, 2021 at 3:57 PM Jon Maloy wrote: > >> > [...] > > Yes, Jon, I mean the opposite. > > > > when MSG_EOR is set, we will go with wh

[tipc-discussion] [PATCH net-next] tipc: keep the skb in rcv queue until the whole data is read

2021-06-25 Thread Xin Long
. This patch to fix it by keeping the skb in rcv queue until the whole data is read by users. Only the last msg of the datagram will be marked with MSG_EOR, just as TCP/SCTP does. Signed-off-by: Xin Long --- net/tipc/socket.c | 30 +- 1 file changed, 21 insertions(+), 9

Re: [tipc-discussion] [PATCH net-next] tipc: keep the skb in rcv queue until the whole data is read

2021-06-28 Thread Xin Long
On Sun, Jun 27, 2021 at 3:44 PM Erin Shepherd wrote: > > Xin Long writes: > > > Currently, when userspace reads a datagram with a buffer that is > > smaller than this datagram, the data will be truncated and only > > part of it can be received by users. It doesn't seem

Re: [tipc-discussion] [PATCH net-next] tipc: keep the skb in rcv queue until the whole data is read

2021-06-28 Thread Xin Long
On Mon, Jun 28, 2021 at 3:03 PM Xin Long wrote: > > On Sun, Jun 27, 2021 at 3:44 PM Erin Shepherd wrote: > > > > Xin Long writes: > > > > > Currently, when userspace reads a datagram with a buffer that is > > > smaller than this datagram, the data will

[tipc-discussion] [PATCH net-next 5/8] tipc: add probe recv and state transition

2021-07-06 Thread Xin Long
This patch is to receive and process the probe ack by checking msg_max_pkt() == l->pl.probe_size then does state transition in tipc_link_pl_recv(). For the details, see: https://lwn.net/Articles/860385/ Signed-off-by: Xin Long --- net/tipc/link.c |

[tipc-discussion] [PATCH net-next 6/8] tipc: add offload base

2021-07-06 Thread Xin Long
This is the base code for tipc gso, and tipc_gso_segment() will only be called after gso packets are built in the next patch. Signed-off-by: Xin Long --- include/linux/skbuff.h | 2 ++ net/tipc/Makefile | 2 +- net/tipc/core.c| 3 +++ net/tipc/msg.h | 2 ++ net/tipc

[tipc-discussion] [PATCH net-next 8/8] tipc: add hardware gso

2021-07-06 Thread Xin Long
Since there's no enough bit in netdev_features_t for NETIF_F_GSO_TIPC_BIT, and tipc is using the simliar code as sctp, this patch will reuse SKB_GSO_SCTP and NETIF_F_GSO_SCTP_BIT for tipc. Signed-off-by: Xin Long --- include/linux/skbuff.h | 2 -- net/tipc/node.c| 15

[tipc-discussion] [PATCH net-next 7/8] tipc: add software gso

2021-07-06 Thread Xin Long
to each skb in the head_skb's frag_list and send them one by one. This supports with both eth media and udp media. Signed-off-by: Xin Long --- net/tipc/bearer.c| 23 +-- net/tipc/msg.h | 1 + net/tipc/offload.c | 41 + net

[tipc-discussion] [PATCH net-next 3/8] tipc: build probe and its reply in tipc_link_build_proto_msg

2021-07-06 Thread Xin Long
This patch is to adjust the code in tipc_link_build_proto_msg() to make it able to build probe packet with a specific size for sender, and probe reply packet with mtu set. Note that to send the probe packet, the df flag has to be set. Signed-off-by: Xin Long --- net/tipc/link.c | 38

[tipc-discussion] [PATCH net-next 0/8] tipc: add PLPMTUD probe and GSO offload

2021-07-06 Thread Xin Long
This patchset is to implement PLPMTUD and GSO for TIPC, Patch 1-5 are for PLPMTUD while 6-8 are for GSO. It gets some ideas from SCTP as their similarities like both are reliable datagram packets and possible to run over IP(v6)/UDP. But also it does some adjustments for TIPC. Xin Long (8

[tipc-discussion] [PATCH net-next 4/8] tipc: add probe send and state transition

2021-07-06 Thread Xin Long
pl.count will make a timer that 'timeout' every after '10 * node timer interval', where it does state transition in tipc_link_pl_send() and sends probe in tipc_link_build_proto_msg(). For the details, see: https://lwn.net/Articles/860385/ Signed-off-by: Xin Long --- net/tipc/link.c | 48

[tipc-discussion] [PATCH net-next 2/8] tipc: add the constants and variables for plpmtud

2021-07-06 Thread Xin Long
' and 'raise' are used for two timers' counting: PROBE_TIMER and PMTU_RAISE_TIMER. 'probe_high' is used for finding the optimal value for pmtu. Signed-off-by: Xin Long --- net/tipc/link.c | 13 + net/tipc/link.h | 20 2 files changed, 33 insertions(+) diff --git

[tipc-discussion] [PATCH net-next 1/8] tipc: set the mtu for bearer properly for udp media

2021-07-06 Thread Xin Long
Instead of using 14000 for ipv4/udp mtu, and 1280 for ipv6/udp mtu, this patch to set mtu according to the lower device's mtu at the beginning. The pmtu will be determined by the PLPMTUD probe in the following patches. Signed-off-by: Xin Long --- include/uapi/linux/tipc_config.h | 6 -- net

[tipc-discussion] [PATCH net] tipc: fix implicit-connect for SYN+

2021-07-10 Thread Xin Long
-connect more implicit. Fixes: b97bf3fd8f6a ("[TIPC] Initial merge") Signed-off-by: Xin Long --- net/tipc/socket.c | 21 + 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/net/tipc/socket.c b/net/tipc/socket.c index 34a97ea36cc8..ebd300c26a44 100644 ---

[tipc-discussion] [PATCHv2 net] tipc: fix a race in tipc_sk_mcast_rcv

2021-04-29 Thread Xin Long
ents from tipc_sk_mcast_rcv() as Tung noticed. Fixes: cb1b728096f5 ("tipc: eliminate race condition at multicast reception") Fixes: 6bf24dc0cc0c ("net:tipc: Fix a double free in tipc_sk_mcast_rcv") Reported-by: Li Shuang Signed-off-by: Xin Long --- net/tipc/msg.h| 1

[tipc-discussion] [PATCH net] tipc: fix a race in tipc_sk_mcast_rcv

2021-04-28 Thread Xin Long
ception") Fixes: 6bf24dc0cc0c ("net:tipc: Fix a double free in tipc_sk_mcast_rcv") Reported-by: Li Shuang Signed-off-by: Xin Long --- net/tipc/node.c | 9 - net/tipc/socket.c | 16 +++- 2 files changed, 7 insertions(+), 18 deletions(-) diff --git a/net/tipc/node.c b

[tipc-discussion] [PATCH net] tipc: increment the tmp aead refcnt before attaching it

2021-04-05 Thread Xin Long
by that in the other thread. This patch is to fix it by incrementing the tmp's refcnt before attaching it instead of calling tipc_aead_get() after attaching it. Fixes: fc1b6d6de220 ("tipc: introduce TIPC encryption & authentication") Reported-by: Li Shuang Signed-off-by: Xin Long --- net/tip

Re: [tipc-discussion] [net-next v2 00/16] tipc: cleanups and simplifications

2021-03-15 Thread Xin Long
+++--- > net/tipc/subscr.c | 84 + > net/tipc/subscr.h | 12 +- > 10 files changed, 573 insertions(+), 525 deletions(-) > > > > _______ > tipc-discussion mailing list > tipc-discussion@lists.sourcef

Re: [tipc-discussion] [net-next 05/16] tipc: simplify call signatures for publication creation

2021-02-24 Thread Xin Long
On Wed, Dec 9, 2020 at 2:51 AM wrote: > > From: Jon Maloy > > We simplify the call signatures for tipc_nametbl_insert_publ() and > tipc_publ_create() so that fewer parameters are passed around. > > Signed-off-by: Jon Maloy > --- > net/tipc/name_distr.c | 23 >

Re: [tipc-discussion] [net-next 13/16] tipc: simplify signature of tipc_find_service()

2021-02-24 Thread Xin Long
On Wed, Dec 9, 2020 at 2:51 AM wrote: > > From: Jon Maloy > > We reduce the signature of tipc_find_service() and > tipc_create_service(). The reason for doing this might not > be obvious, but we plan to let struct tipc_uaddr contain > information that is relevant for these functions in a later >

Re: [tipc-discussion] [net-next 14/16] tipc: simplify api between binding table and topology server

2021-02-24 Thread Xin Long
On Wed, Dec 9, 2020 at 2:51 AM wrote: > > From: Jon Maloy > > The function tipc_report_overlap() is called from the binding table > with numerous parameters taken from an instance of struct publication. > A closer look reveals that it always is safe to send along a pointer > to the instance

Re: [tipc-discussion] [net-next 08/16] tipc: refactor tipc_sendmsg() and tipc_lookup_anycast()

2021-02-24 Thread Xin Long
On Wed, Dec 9, 2020 at 2:51 AM wrote: > > From: Jon Maloy > > We simplify the signature if function tipc_nametbl_lookup_anycast(), > using address structures instead of dicrete integers. > > This also makes it possible to make some improvements to the functions > __tipc_sendmsg() in socket.c and

Re: [tipc-discussion] [net-next 02/16] tipc: move creation of publication item one level up in call chain

2021-02-24 Thread Xin Long
On Wed, Dec 9, 2020 at 2:51 AM wrote: > > From: Jon Maloy > > We instantiante struct publication in tipc_nametbl_insert_publ() > instead of as currently in tipc_service_insert_publ(). This has the > advantage that we can pass a pointer to the publication struct to > the next call levels, instead

Re: [tipc-discussion] [net-next 04/16] tipc: simplify signature of tipc_namtbl_publish()

2021-02-24 Thread Xin Long
On Wed, Dec 9, 2020 at 2:51 AM wrote: > > From: Jon Maloy > > Using the new address structure tipc_uaddr, we simplify the signature > of function tipc_sk_publish() and tipc_namtbl_publish() so that fewer > parameters need to be passed around. > > Signed-off-by: Jon Maloy > --- >

Re: [tipc-discussion] [net-next 00/16] tipc: cleanups and simplifications

2021-02-24 Thread Xin Long
Hi Jon, Sorry for so late to check this patchset, I just came back from Chinese New Year holidays. Overall I like the idea to use one or two new structures to make the parameters passing between functions more clear and readable. Meanwhile I think if the parameters of some function are already

Re: [tipc-discussion] [net-next 06/16] tipc: simplify signature of tipc_nametbl_withdraw() functions

2021-02-24 Thread Xin Long
On Wed, Dec 9, 2020 at 2:51 AM wrote: > > From: Jon Maloy > > Following the priniciples of the preceding commits, we reduce > the number of parameters passed along in tipc_sk_withdraw(), > tipc_nametbl_withdraw() and associated functions. > > Signed-off-by: Jon Maloy > --- >

Re: [tipc-discussion] [net-next v2 0/3] tipc: some small cleanups

2021-04-14 Thread Xin Long
ame_table.h | 4 +- > net/tipc/socket.c | 149 +++--- > 3 files changed, 74 insertions(+), 85 deletions(-) > > -- > 2.29.2 > > > > ___ > tipc-discussion mailing list > tipc-discussion@lists.sourceforge.net &g

[tipc-discussion] [PATCH net] tipc: call tipc_wait_for_connect only when dlen is not 0

2021-08-15 Thread Xin Long
t for SYN+") Reported-by: Shuang Li Signed-off-by: Xin Long Acked-by: Jon Maloy --- net/tipc/socket.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/tipc/socket.c b/net/tipc/socket.c index 75b99b7eda22..8754bd885169 100644 --- a/net/tipc/socket.c +++ b/net/tipc/socket.c @@ -

[tipc-discussion] [PATCH net] tipc: call tipc_wait_for_connect only when dlen is not 0

2021-08-03 Thread Xin Long
t for SYN+") Reported-by: Shuang Li Signed-off-by: Xin Long --- net/tipc/socket.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/tipc/socket.c b/net/tipc/socket.c index 75b99b7eda22..8754bd885169 100644 --- a/net/tipc/socket.c +++ b/net/tipc/socket.c @@ -1518,7 +1518,7

Re: [tipc-discussion] [PATCH net-next 8/8] tipc: add hardware gso

2021-09-22 Thread Xin Long
On Fri, Sep 10, 2021 at 8:08 AM Jon Maloy wrote: > > > > On 06/07/2021 14:22, Xin Long wrote: > > Since there's no enough bit in netdev_features_t for > > NETIF_F_GSO_TIPC_BIT, and tipc is using the simliar > > code as sctp, this patch will reuse SKB_GSO_SCTP and >

[tipc-discussion] [PATCH net-next] tipc: delete the unlikely branch in tipc_aead_encrypt

2021-11-21 Thread Xin Long
as the pages in skbs are not writable, see more on commit 3cf4375a0904 ("tipc: do not write skb_shinfo frags when doing decrytion"). Signed-off-by: Xin Long --- net/tipc/crypto.c | 19 --- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/net/tipc/crypto.c b/net/t

[tipc-discussion] shouldn't unencrypted packets be discarded if any key is set on local node?

2021-11-10 Thread Xin Long
Hi Everyone, Currently in tcp_rcv(), it seems that both unencrypted and encrypted packets can be processed even when key/master_key is set. After the key is set, which means all packets going out will be encrypted, to respond to the unencrypted packets with encrypted packets doesn't seem normal,

Re: [tipc-discussion] [PATCH net] tipc: only accept encrypted MSG_CRYPTO msgs

2021-11-14 Thread Xin Long
the MSG_CRYPTO type") > > ///jon > > > > > On 11/14/21 08:09, Xue, Ying wrote: > > Thanks Xin! The patch looks good to me. > > > > Acked-by: Ying Xue > > > > -Original Message- > > From: Xin Long > > Sent: Saturday, November 13,

[tipc-discussion] [PATCH net-next] tipc: delete the unlikely branch in tipc_aead_encrypt

2021-11-24 Thread Xin Long
as the pages in skbs are not writable, see more on commit 3cf4375a0904 ("tipc: do not write skb_shinfo frags when doing decrytion"). Signed-off-by: Xin Long Acked-by: Jon Maloy --- net/tipc/crypto.c | 19 --- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/net/ti

[tipc-discussion] [PATCH net-next] tipc: discard MSG_CRYPTO msgs when key_exchange_enabled is not set

2021-11-24 Thread Xin Long
When key_exchange is disabled, there is no reason to accept MSG_CRYPTO msgs if it doesn't send MSG_CRYPTO msgs. Signed-off-by: Xin Long --- net/tipc/link.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/net/tipc/link.c b/net/tipc/link.c index 09ae8448f394..8d9e09f48f4c

[tipc-discussion] [PATCH net] tipc: only accept encrypted MSG_CRYPTO msgs

2021-11-12 Thread Xin Long
is to do that by checking TIPC_SKB_CB(skb)->decrypted and discard it if this packet never got decrypted. Fixes: 1ef6f7c9390f ("tipc: add automatic session key exchange") Signed-off-by: Xin Long --- net/tipc/link.c | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --g

[tipc-discussion] [PATCH net] tipc: only accept encrypted MSG_CRYPTO msgs

2021-11-15 Thread Xin Long
") Acked-by: Ying Xue Acked-by: Jon Maloy Signed-off-by: Xin Long --- net/tipc/link.c | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/net/tipc/link.c b/net/tipc/link.c index 1b7a487c8841..09ae8448f394 100644 --- a/net/tipc/link.c +++ b/net/tipc/link.c @@ -12

[tipc-discussion] [PATCH net-next] tipc: discard MSG_CRYPTO msgs when key_exchange_enabled is not set

2021-12-10 Thread Xin Long
When key_exchange is disabled, there is no reason to accept MSG_CRYPTO msgs if it doesn't send MSG_CRYPTO msgs. Signed-off-by: Xin Long Acked-by: Jon Maloy --- net/tipc/link.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/net/tipc/link.c b/net/tipc/link.c index

[tipc-discussion] [PATCH net] tipc: fix implicit-connect for SYN+

2021-07-22 Thread Xin Long
-connect more implicit. Fixes: b97bf3fd8f6a ("[TIPC] Initial merge") Signed-off-by: Xin Long Acked-by: Jon Maloy --- net/tipc/socket.c | 21 + 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/net/tipc/socket.c b/net/tipc/socket.c index 34a97ea36cc8..eb

Re: [tipc-discussion] FW: [syzbot] KASAN: use-after-free Read in tipc_recvmsg

2021-07-22 Thread Xin Long
On Thu, Jul 22, 2021 at 9:55 PM Hoang Huu Le wrote: > > Hi Xin, > > I think the issue caused by your patch: > > f4919ff59c282 ("tipc: keep the skb in rcv queue until the whole data is read) > > 1976 if (!skb_cb->bytes_read) > 1977 tsk_advance_rx_queue(sk); <-- skb

[tipc-discussion] [PATCH net-next] tipc: keep the skb in rcv queue until the whole data is read

2021-07-16 Thread Xin Long
old user applications. Signed-off-by: Xin Long Acked-by: Jon Maloy --- net/tipc/socket.c | 36 +++- 1 file changed, 27 insertions(+), 9 deletions(-) diff --git a/net/tipc/socket.c b/net/tipc/socket.c index 34a97ea36cc8..9b0b311c7ec1 100644 --- a/net/tipc/socket.c

  1   2   >