[PATCH] tipc: do sanity check payload of a netlink message

2020-12-14 Thread Hoang Huu Le
From: Hoang Le When we initialize nlmsghdr with no payload inside tipc_nl_compat_dumpit() the parsing function returns -EINVAL. We fix it by making the parsing call conditional. Acked-by: Jon Maloy Signed-off-by: Hoang Le --- net/tipc/netlink_compat.c | 12 +++- 1 file changed, 7 inse

[net-next] tipc: do sanity check payload of a netlink message

2020-12-14 Thread Hoang Huu Le
From: Hoang Le When we initialize nlmsghdr with no payload inside tipc_nl_compat_dumpit() the parsing function returns -EINVAL. We fix it by making the parsing call conditional. Acked-by: Jon Maloy Signed-off-by: Hoang Le --- net/tipc/netlink_compat.c | 12 +++- 1 file changed, 7 inse

[net] tipc: fix NULL pointer dereference in tipc_named_rcv

2020-10-08 Thread Hoang Huu Le
[...] [] CR2: [] ---[ end trace 65c276a8e2e2f310 ]--- To fix this, we need to grab the lock of the 'namedq' list on both path calling. Fixes: cad2929dc432 ("tipc: update a binding service via broadcast") Acked-by: Jon Maloy Signed-off-by: Hoang Huu Le --- net/ti

RE: [net] tipc: fix NULL pointer dereference in tipc_named_rcv

2020-10-08 Thread Hoang Huu Le
t;nametbl_lock); lock(&n->lock#2); lock(&tn->nametbl_lock); *** DEADLOCK *** Regards, Hoang > -Original Message- > From: Jon Maloy > Sent: Friday, October 9, 2020 1:01 AM > To: Jakub Kicinski ; Hoang Huu Le > Cc: ma...@donjonn.c

[net] tipc: re-configure queue limit for broadcast link

2020-10-12 Thread Hoang Huu Le
function to re-calculate queue limit of the broadcast link. Acked-by: Jon Maloy Signed-off-by: Hoang Huu Le --- net/tipc/bcast.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/net/tipc/bcast.c b/net/tipc/bcast.c index 940d176e0e87..c77fd13e2777 100644 --- a/net/tipc/bcast.c

RE: [net] tipc: re-configure queue limit for broadcast link

2020-10-14 Thread Hoang Huu Le
gards, Hoang > -Original Message- > From: Jakub Kicinski > Sent: Thursday, October 15, 2020 7:47 AM > To: Hoang Huu Le > Cc: tipc-discuss...@lists.sourceforge.net; jma...@redhat.com; > ma...@donjonn.com; ying@windriver.com; > netdev@vger.kernel.org > Subject: Re: [

[net 2/2] tipc: fix incorrect setting window for bcast link

2020-10-15 Thread Hoang Huu Le
Acked-by: Jon Maloy Signed-off-by: Hoang Huu Le --- net/tipc/bcast.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/net/tipc/bcast.c b/net/tipc/bcast.c index c77fd13e2777..d4beca895992 100644 --- a/net/tipc/bcast.c +++ b/net/tipc/bcast.c @@ -109,6 +

[net 1/2] tipc: re-configure queue limit for broadcast link

2020-10-15 Thread Hoang Huu Le
function to re-calculate queue limit of the broadcast link. Acked-by: Jon Maloy Signed-off-by: Hoang Huu Le --- net/tipc/bcast.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/net/tipc/bcast.c b/net/tipc/bcast.c index 940d176e0e87..c77fd13e2777 100644 --- a/net/tipc/bcast.c

[net-next v2] tipc: update a binding service via broadcast

2020-06-16 Thread Hoang Huu Le
ly. v1->v2: - fix warning issue reported by kbuild test robot - add santiy check to drop the publication message with a sequence number that is lower than the agreed synch point Signed-off-by: kernel test robot Signed-off-by: Hoang Huu Le Acked-by: Jon Maloy --- net/tipc/bcast.c |

[net] tipc: fix incompatible mtu of transmission

2020-11-29 Thread Hoang Huu Le
From: Hoang Le In commit 682cd3cf946b6 ("tipc: confgiure and apply UDP bearer MTU on running links"), we introduced a function to change UDP bearer MTU and applied this new value across existing per-link. However, we did not apply this new MTU value at node level. This lead to packet dropped at l

[net-next] tipc: support 128bit node identity for peer removing

2020-12-02 Thread Hoang Huu Le
From: Hoang Le We add the support to remove a specific node down with 128bit node identifier, as an alternative to legacy 32-bit node address. example: $tipc peer remove identiy <1001002|1677> Acked-by: Jon Maloy Signed-off-by: Hoang Le --- net/tipc/node.c | 21 ++--- 1 f

[net-next v2] tipc: fix a deadlock when flushing scheduled work

2020-09-06 Thread Hoang Huu Le
ork_sync() helper to make sure ONLY the tipc_net_finalize_work() stopped before releasing bcbase object. Reported-by: syzbot+d5aa7e0385f6a5d0f...@syzkaller.appspotmail.com Fixes: fdeba99b1e58 ("tipc: fix use-after-free in tipc_bcast_get_mode") Acked-by: Jon Maloy Signed-off-by: Hoan

[net-next v2] tipc: fix a deadlock when flushing scheduled work

2020-09-06 Thread Hoang Huu Le
ork_sync() helper to make sure ONLY the tipc_net_finalize_work() stopped before releasing bcbase object. Reported-by: syzbot+d5aa7e0385f6a5d0f...@syzkaller.appspotmail.com Fixes: fdeba99b1e58 ("tipc: fix use-after-free in tipc_bcast_get_mode") Acked-by: Jon Maloy Signed-off-by: Hoan

RE: [net-next] tipc: fix a deadlock when flushing scheduled work

2020-09-07 Thread Hoang Huu Le
> -Original Message- > From: Jakub Kicinski > Sent: Monday, September 7, 2020 12:57 AM > To: Hoang Huu Le > Cc: ying@windriver.com; netdev@vger.kernel.org; jma...@redhat.com; > ma...@donjonn.com; > syzbot+d5aa7e0385f6a5d0f...@syzkaller.appspotmail.com >

[net-next] tipc: remove duplicated code in tipc_msg_create

2021-01-26 Thread Hoang Huu Le
Remove a duplicate code checking for header size in tipc_msg_create() as it's already being done in tipc_msg_init(). Acked-by: Jon Maloy Signed-off-by: Hoang Huu Le --- net/tipc/msg.c | 4 1 file changed, 4 deletions(-) diff --git a/net/tipc/msg.c b/net/tipc/msg.c index 2aca860

[net] tipc: fix NULL deref in tipc_link_xmit()

2021-01-06 Thread Hoang Huu Le
From: Hoang Le The buffer list can have zero skb as following path: tipc_named_node_up()->tipc_node_xmit()->tipc_link_xmit(), so we need to check the list before casting an &sk_buff. Fault report: [] tipc: Bulk publication failure [] general protection fault, probably for non-canonical [#1] PR

[net v2] tipc: fix NULL deref in tipc_link_xmit()

2021-01-07 Thread Hoang Huu Le
From: Hoang Le The buffer list can have zero skb as following path: tipc_named_node_up()->tipc_node_xmit()->tipc_link_xmit(), so we need to check the list before casting an &sk_buff. Fault report: [] tipc: Bulk publication failure [] general protection fault, probably for non-canonical [#1] PR

[net-next 2/2] tipc: clean up warnings detected by sparse

2021-03-10 Thread Hoang Huu Le
ifferent address spaces) net/tipc/crypto.c:1201:9:expected struct tipc_aead [noderef] __rcu *__tmp net/tipc/crypto.c:1201:9:got struct tipc_aead * [...] Acked-by: Jon Maloy Signed-off-by: Hoang Huu Le --- net/tipc/crypto.c | 12 - net/tipc/monitor.c | 63 +

[net-next 1/2] tipc: convert dest node's address to network order

2021-03-10 Thread Hoang Huu Le
From: Hoang Le (struct tipc_link_info)->dest is in network order (__be32), so we must convert the value to network order before assigning. The problem detected by sparse: net/tipc/netlink_compat.c:699:24: warning: incorrect type in assignment (different base types) net/tipc/netlink_compat.c:699

[net-next v2 2/2] tipc: clean up warnings detected by sparse

2021-03-11 Thread Hoang Huu Le
ifferent address spaces) net/tipc/crypto.c:1201:9:expected struct tipc_aead [noderef] __rcu *__tmp net/tipc/crypto.c:1201:9:got struct tipc_aead * [...] v2: switch to use the keyword "__always_inline" for inline function Acked-by: Jon Maloy Signed-off-by: Hoang Huu Le ---

[net-next v2 1/2] tipc: convert dest node's address to network order

2021-03-11 Thread Hoang Huu Le
From: Hoang Le (struct tipc_link_info)->dest is in network order (__be32), so we must convert the value to network order before assigning. The problem detected by sparse: net/tipc/netlink_compat.c:699:24: warning: incorrect type in assignment (different base types) net/tipc/netlink_compat.c:699

RE: [iproute2-next] tipc: add support for the netlink extack

2021-03-25 Thread Hoang Huu Le
> -Original Message- > From: David Ahern > Sent: Thursday, March 25, 2021 10:08 AM > To: Hoang Huu Le ; netdev@vger.kernel.org; > tipc-discuss...@lists.sourceforge.net; > jma...@redhat.com; ma...@donjonn.com; ying@windriver.com; Tuan Anh Vo > ; Tung Quang &g

[net-next] tipc: remove dead code in tipc_net and relatives

2020-10-28 Thread Hoang Huu Le
dist_queue is no longer used since commit 37922ea4a310 ("tipc: permit overlapping service ranges in name table") Acked-by: Jon Maloy Acked-by: Ying Xue Signed-off-by: Hoang Huu Le --- net/tipc/core.c | 2 -- net/tipc/core.h | 3 --- net/tipc/name_di

[iproute2-next] tipc: fixed a compile warning in tipc/link.c

2020-07-08 Thread Hoang Huu Le
Fixes: 5027f233e35b ("tipc: add link broadcast get") Signed-off-by: Hoang Huu Le --- tipc/link.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tipc/link.c b/tipc/link.c index ba77a20152ea..192736eaa154 100644 --- a/tipc/link.c +++ b/tipc/link.c @@ -217,7 +217,7

[iproute2-next] tipc: support 128bit node identity for peer removing

2020-08-26 Thread Hoang Huu Le
. Acked-by: Jon Maloy Signed-off-by: Hoang Huu Le --- tipc/peer.c | 53 - 1 file changed, 52 insertions(+), 1 deletion(-) diff --git a/tipc/peer.c b/tipc/peer.c index f6380777033d..f14ec35e6f71 100644 --- a/tipc/peer.c +++ b/tipc/peer.c

[net-next] tipc: fix use-after-free in tipc_bcast_get_mode

2020-08-26 Thread Hoang Huu Le
9cc557752ab126c1...@syzkaller.appspotmail.com Acked-by: Jon Maloy Signed-off-by: Hoang Huu Le --- net/tipc/core.c | 5 + 1 file changed, 5 insertions(+) diff --git a/net/tipc/core.c b/net/tipc/core.c index 4f6dc74adf45..37d8695548cf 100644 --- a/net/tipc/core.c +++ b/net/tipc/core.c @@ -109,6 +109,1

RE: [net-next] tipc: fix use-after-free in tipc_bcast_get_mode

2020-08-31 Thread Hoang Huu Le
Thanks for pointing that out. I will revert the patch and submit another solution. -Original Message- From: Eric Dumazet Sent: Tuesday, September 1, 2020 12:08 AM To: Hoang Huu Le ; jma...@redhat.com; ma...@donjonn.com; netdev@vger.kernel.org; tipc-discuss...@lists.sourceforge.net Cc

[net-next] tipc: fix a deadlock when flushing scheduled work

2020-09-04 Thread Hoang Huu Le
syzbot+d5aa7e0385f6a5d0f...@syzkaller.appspotmail.com Fixes: fdeba99b1e58 ("tipc: fix use-after-free in tipc_bcast_get_mode") Acked-by: Jon Maloy Signed-off-by: Hoang Huu Le --- net/tipc/core.c | 8 net/tipc/core.h | 1 + net/tipc/net.c | 10 +- 3 files changed, 14 insertio

[net-next] tipc: update a binding service via broadcast

2020-06-06 Thread Hoang Huu Le
her can arrive out of order, also need to be exempt from the initial synchronization and sequence number check, and delivered unconditionally. Therefore, we add another 'is_not_legacy' bit to all new messages so that those can be distinguished from legacy messages and the latter delivered dire