[iproute2-next 0/2] tipc: add new options for TIPC encryption

2020-10-17 Thread Tuong Lien
- Trigger one (first) rekeying immediately EXAMPLES tipc node set key this_is_a_master_key master tipc node set key 0x746869735F69735F615F6B657931365F73616C74 tipc node set key this_is_a_key16_salt algname "gcm(aes)" nodeid 1001002 tipc node set key rekeying 600 Tuong Li

[iproute2-next 1/2] tipc: add option to set master key for encryption

2020-10-17 Thread Tuong Lien
ER'. For example: $ tipc node set key "this_is_a_master_key" master The command's help menu is also updated to give a better description of all the available options. Acked-by: Jon Maloy Signed-off-by: Tuong Lien --- tipc/node.c | 46 +--

[iproute2-next 2/2] tipc: add option to set rekeying for encryption

2020-10-17 Thread Tuong Lien
d's help menu is also updated with these descriptions for the new command option. Acked-by: Jon Maloy Signed-off-by: Tuong Lien --- tipc/cmdl.c | 2 +- tipc/cmdl.h | 1 + tipc/node.c | 47 +-- 3 files changed, 39 insertions(+), 11 deletions(-)

[net-next v3 2/4] tipc: introduce encryption master key

2020-09-18 Thread Tuong Lien
he user. Acked-by: Jon Maloy Signed-off-by: Tuong Lien --- include/uapi/linux/tipc_netlink.h | 1 + net/tipc/crypto.c | 210 ++ net/tipc/crypto.h | 15 ++- net/tipc/msg.h| 4 +- net/tipc/netli

[net-next v3 1/4] tipc: optimize key switching time and logic

2020-09-18 Thread Tuong Lien
untime. Besides we also optimize the code in some other places as a preparation for later commits. v2: silent more kernel logs, also use 'info->extack' for a message emitted due to netlink operations instead (- David's comments). Acked-by

[net-next v3 4/4] tipc: add automatic rekeying for encryption key

2020-09-18 Thread Tuong Lien
i.e. done every day. There isn't any restriction for the value but user shouldn't set it too small or too large which results in an "ineffective" rekeying (thats ok for testing though). Acked-by: Jon Maloy Signed-off-by: Tuong Lien --- include/uapi/linux/tipc.h |

[net-next v3 3/4] tipc: add automatic session key exchange

2020-09-18 Thread Tuong Lien
comment). Reported-by: kernel test robot Acked-by: Jon Maloy Signed-off-by: Tuong Lien --- net/tipc/crypto.c | 364 +++--- net/tipc/crypto.h | 24 +++ net/tipc/link.c | 5 + net/tipc/msg.h| 4 + net/tipc/node.c | 17 ++- net/tipc/node.h

[net-next v3 0/4] tipc: add more features to TIPC encryption

2020-09-18 Thread Tuong Lien
ink as well. v2: update the "tipc: add automatic session key exchange" patch to fix "implicit declaration" issue when built without "CONFIG_TIPC_CRYPTO". v3: update the patches according to David comments by using the "genl_info->extack" for messages i

[net-next v2 4/4] tipc: add automatic rekeying for encryption key

2020-09-01 Thread Tuong Lien
i.e. done every day. There isn't any restriction for the value but user shouldn't set it too small or too large which results in an "ineffective" rekeying (thats ok for testing though). Acked-by: Jon Maloy Signed-off-by: Tuong Lien --- include/uapi/linux/tipc.h |

[net-next v2 3/4] tipc: add automatic session key exchange

2020-09-01 Thread Tuong Lien
fix the "implicit declaration of function 'tipc_crypto_key_flush'" error in node.c. The function only exists when built with the TIPC "CONFIG_TIPC_CRYPTO" option. Reported-by: kernel test robot Acked-by: Jon Maloy Signed-off-by: Tuong Lien --- net/tipc/crypto.c |

[net-next v2 2/4] tipc: introduce encryption master key

2020-09-01 Thread Tuong Lien
he user. Acked-by: Jon Maloy Signed-off-by: Tuong Lien --- include/uapi/linux/tipc_netlink.h | 1 + net/tipc/crypto.c | 206 ++ net/tipc/crypto.h | 15 ++- net/tipc/msg.h| 4 +- net/tipc/netli

[net-next v2 1/4] tipc: optimize key switching time and logic

2020-09-01 Thread Tuong Lien
untime. Besides we also optimize the code in some other places as a preparation for later commits. This commit does not change the en/decryption functionalities. Acked-by: Jon Maloy Signed-off-by: Tuong Lien --- net/tipc/crypto.c | 344 +++--- 1 file changed,

[net-next v2 0/4] tipc: add more features to TIPC encryption

2020-09-01 Thread Tuong Lien
ink as well. v2: update the "tipc: add automatic session key exchange" patch to fix "implicit declaration" issue when built without "CONFIG_TIPC_CRYPTO". Tuong Lien (4): tipc: optimize key switching time and logic tipc: introduce encryption master key tipc: add a

[net-next 4/4] tipc: add automatic rekeying for encryption key

2020-08-29 Thread Tuong Lien
i.e. done every day. There isn't any restriction for the value but user shouldn't set it too small or too large which results in an "ineffective" rekeying (thats ok for testing though). Acked-by: Jon Maloy Signed-off-by: Tuong Lien --- include/uapi/linux/tipc.h |

[net-next 3/4] tipc: add automatic session key exchange

2020-08-29 Thread Tuong Lien
d-by: Jon Maloy Signed-off-by: Tuong Lien --- net/tipc/crypto.c | 359 +++--- net/tipc/crypto.h | 24 net/tipc/link.c | 5 + net/tipc/msg.h| 4 + net/tipc/node.c | 19 ++- net/tipc/node.h | 2 + net/tipc/sysctl.c | 9 ++ 7 files

[net-next 1/4] tipc: optimize key switching time and logic

2020-08-29 Thread Tuong Lien
untime. Besides we also optimize the code in some other places as a preparation for later commits. This commit does not change the en/decryption functionalities. Acked-by: Jon Maloy Signed-off-by: Tuong Lien --- net/tipc/crypto.c | 344 +++--- 1 file changed,

[net-next 2/4] tipc: introduce encryption master key

2020-08-29 Thread Tuong Lien
he user. Acked-by: Jon Maloy Signed-off-by: Tuong Lien --- include/uapi/linux/tipc_netlink.h | 1 + net/tipc/crypto.c | 206 ++ net/tipc/crypto.h | 15 ++- net/tipc/msg.h| 4 +- net/tipc/netli

[net-next 0/4] tipc: add more features to TIPC encryption

2020-08-29 Thread Tuong Lien
ed between nodes as needed. - Patch 4 ("tipc: add automatic rekeying for encryption key") adds automatic 'rekeying' of session keys a specific interval. The new key will be distributed automatically to peer nodes, so become active then. The rekeying interval is configurable via net

[net] tipc: fix using smp_processor_id() in preemptible

2020-08-29 Thread Tuong Lien
ng the 'get/put_cpu_ptr()' API which consists of a 'preempt_disable()' instead. Fixes: fc1b6d6de220 ("tipc: introduce TIPC encryption & authentication") Acked-by: Jon Maloy Signed-off-by: Tuong Lien --- net/tipc/crypto.c | 12 +--- 1 file changed, 9 ins

[net] tipc: fix NULL pointer dereference in tipc_disc_rcv()

2020-06-11 Thread Tuong Lien
) so leads to the NULL pointer dereference. We solve the problem by simply moving the bearer 'up' setting to later, so make sure everything is ready prior to any message receiving. Acked-by: Jon Maloy Signed-off-by: Tuong Lien --- net/tipc/bearer.c | 2 +- 1 file changed, 1 insertion(

[net] tipc: fix kernel WARNING in tipc_msg_append()

2020-06-11 Thread Tuong Lien
Nagle is enabled for the socket, i.e. 'maxnagle != 0' before calling the 'tipc_msg_append()'. We also reinforce the function to against such a negative values if any. Reported-by: syzbot+75139a7d2605236b0...@syzkaller.appspotmail.com Fixes: c0bceb97db9e ("tipc: add smart nagle f

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

2020-06-02 Thread Tuong Lien
e 'txq' will be never empty and the check of 'skb != NULL' is unnecessary but it is safe anyway. Reported-by: syzbot+8eac6d030e7807c21...@syzkaller.appspotmail.com Fixes: c0bceb97db9e ("tipc: add smart nagle feature") Acked-by: Jon Maloy Signed-off-by: Tuong Lien --- net/

[net 2/2] Revert "tipc: Fix potential tipc_aead refcnt leak in tipc_crypto_rcv"

2020-06-01 Thread Tuong Lien
This reverts commit 441870ee4240cf67b5d3ab8e16216a9ff42eb5d6. Like the previous patch in this series, we revert the above commit that causes similar issues with the 'aead' object. Acked-by: Jon Maloy Signed-off-by: Tuong Lien --- net/tipc/crypto.c | 1 - 1 file changed, 1 deletio

[net 1/2] Revert "tipc: Fix potential tipc_node refcnt leak in tipc_rcv"

2020-06-01 Thread Tuong Lien
node found (i.e. n = NULL) in the 'tipc_rcv()' or a premature release of the node object. This commit solves the issues by reverting the said commit, but keeping one valid case that the 'skb_linearize()' is failed. Acked-by: Jon Maloy Signed-off-by: Tuong Lien --- net/tipc/nod

[net 0/2] tipc: revert two patches

2020-06-01 Thread Tuong Lien
We revert two patches: tipc: Fix potential tipc_node refcnt leak in tipc_rcv tipc: Fix potential tipc_aead refcnt leak in tipc_crypto_rcv which prevented TIPC encryption from working properly and caused kernel panic. Tuong Lien (2): Revert "tipc: Fix potential tipc_node refcnt le

[iproute2-next] tipc: enable printing of broadcast rcv link stats

2020-05-26 Thread Tuong Lien
max:0 avg:0 $ tipc l st re l broadcast-link:1001002 $ tipc l st sh l broadcast-link:1001002 Link Window:50 packets RX packets:0 fragments:0/0 bundles:0/0 TX packets:0 fragments:0/0 bundles:0/0 RX naks:0 defs:0 dups:0 TX naks:0 acks:0 retrans:0 Congestion link:0 Send queue max:0 avg:0 Acked-

[net-next 5/5] tipc: add test for Nagle algorithm effectiveness

2020-05-26 Thread Tuong Lien
s messages without a break, so Nagle would still take in effect. Acked-by: Ying Xue Acked-by: Jon Maloy Signed-off-by: Tuong Lien --- net/tipc/msg.c| 3 --- net/tipc/msg.h| 14 ++-- net/tipc/socket.c | 64 --- 3 files changed,

[net-next 3/5] tipc: enable broadcast retrans via unicast

2020-05-26 Thread Tuong Lien
etruni Default is '0', i.e. the broadcast retransmission still works as usual. Acked-by: Ying Xue Acked-by: Jon Maloy Signed-off-by: Tuong Lien --- net/tipc/bcast.c | 11 --- net/tipc/bcast.h | 4 +++- net/tipc/link.c | 10 ++ net/tipc/link.h | 3 ++- net/ti

[net-next 4/5] tipc: add support for broadcast rcv stats dumping

2020-05-26 Thread Tuong Lien
he 'l->name'. Acked-by: Ying Xue Acked-by: Jon Maloy Signed-off-by: Tuong Lien --- net/tipc/bcast.c | 6 ++--- net/tipc/bcast.h | 5 +++-- net/tipc/link.c| 65 +++--- net/tipc/link.h| 3 +-- net/tipc/msg.c | 9 +++

[net-next 2/5] tipc: add back link trace events

2020-05-26 Thread Tuong Lien
: Ying Xue Acked-by: Jon Maloy Signed-off-by: Tuong Lien --- net/tipc/link.c | 3 +++ net/tipc/trace.h | 13 - 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/net/tipc/link.c b/net/tipc/link.c index d29b9c531171..288c5670cfa5 100644 --- a/net/tipc/link.c +++ b/net/t

[net-next 0/5] tipc: add some improvements

2020-05-26 Thread Tuong Lien
retransmissions via unicast which might be useful in some cases. Besides, the Nagle algorithm can now automatically 'adjust' itself depending on the specific network condition a stream connection runs by the last patch. Tuong Lien (5): tipc: introduce Gap ACK blocks for broadcast lin

[net-next 1/5] tipc: introduce Gap ACK blocks for broadcast link

2020-05-26 Thread Tuong Lien
17.67s Without the patch: $ time tipc-pipe --mc --rdm --data_size 123 --data_num 150 real8m 27.94s user0m 0.55s sys 0m 2.38s Acked-by: Ying Xue Acked-by: Jon Maloy Signed-off-by: Tuong Lien --- net/tipc/bcast.c | 9 +- net/tipc/link.c | 425 +++

[net 3/3] tipc: fix failed service subscription deletion

2020-05-13 Thread Tuong Lien
ime later. Meanwhile, the number of available subscriptions may be exhausted. This commit fixes the two issues above, so as needed a subscription can be deleted correctly. Acked-by: Ying Xue Acked-by: Jon Maloy Signed-off-by: Tuong Lien --- net/tipc/subscr.h | 10 ++ net/tipc/topsrv.

[net 0/3] tipc: add some patches

2020-05-13 Thread Tuong Lien
This series adds patches to fix some issues in TIPC streaming & service subscription. Tuong Lien (3): tipc: fix large latency in smart Nagle streaming tipc: fix memory leak in service subscripting tipc: fix failed service subscription deletion net/tipc/socket.c

[net 2/3] tipc: fix memory leak in service subscripting

2020-05-13 Thread Tuong Lien
ased all references. This commit fixes the issue by simply adding one test if the connection remains in 'connected' state right after we obtain the connection lock, then a subscription object can be created as usual, otherwise we ignore it. Acked-by: Ying Xue Acked-by: Jon Maloy Reported-by:

[net 1/3] tipc: fix large latency in smart Nagle streaming

2020-05-13 Thread Tuong Lien
Xue Acked-by: Jon Maloy Signed-off-by: Tuong Lien --- net/tipc/socket.c | 42 +++--- 1 file changed, 31 insertions(+), 11 deletions(-) diff --git a/net/tipc/socket.c b/net/tipc/socket.c index 87466607097f..e370ad0edd76 100644 --- a/net/tipc/socket.c +++ b/net/

[net] tipc: fix partial topology connection closure

2020-05-03 Thread Tuong Lien
le cannot be removed (unless the objects are somehow forced to release first); The commit fixes the issue by closing the connection if the 'recvmsg()' returns '0' i.e. when the peer is shutdown gracefully. It also includes the other unexpected cases. Acked-by: Jon Maloy Acked

[net] tipc: fix unlimited bundling of small messages

2019-10-02 Thread Tuong Lien
r message comes, a new bundle is created and so on... We will solve this issue radically by another patch. Fixes: 365ad353c256 ("tipc: reduce risk of user starvation during link congestion") Reported-by: Hoang Le Acked-by: Jon Maloy Signed-off-by: Tuong Lien --- net/tipc/link.c |

[net] tipc: fix false detection of retransmit failures

2019-08-14 Thread Tuong Lien
simplify stale link failure criteria") Reported-by: Hoang Le Acked-by: Ying Xue Acked-by: Jon Maloy Signed-off-by: Tuong Lien --- net/tipc/link.c | 92 - net/tipc/msg.h | 8 +++-- 2 files changed, 57 insertions(+), 43 dele

[net-next 1/2] tipc: optimize link synching mechanism

2019-07-23 Thread Tuong Lien
t a header conveying the synch point to the peer. A new node capability flag ("TIPC_TUNNEL_ENHANCED") is introduced for backward compatible! Acked-by: Ying Xue Acked-by: Jon Maloy Suggested-by: Jon Maloy Signed-off-by: Tuong Lien --- net/tipc/link.c | 26 ++

[net-next 0/2] tipc: link changeover issues

2019-07-23 Thread Tuong Lien
This patch series is to resolve some issues found with the current link changeover mechanism, it also includes an optimization for the link synching. Tuong Lien (2): tipc: optimize link synching mechanism tipc: fix changeover issues due to large packet net/tipc/link.c | 119

[net-next 2/2] tipc: fix changeover issues due to large packet

2019-07-23 Thread Tuong Lien
the original message size is too large, it will be fragmented & reassembled at the receiving side. Acked-by: Ying Xue Acked-by: Jon Maloy Signed-off-by: Tuong Lien --- net/tipc/link.c | 93 - net/tipc/msg.c | 59 +

[net-next 1/2] tipc: optimize link synching mechanism

2019-07-11 Thread Tuong Lien
t a header conveying the synch point to the peer. A new node capability flag ("TIPC_TUNNEL_ENHANCED") is introduced for backward compatible! Acked-by: Ying Xue Acked-by: Jon Maloy Suggested-by: Jon Maloy Signed-off-by: Tuong Lien --- net/tipc/link.c | 26 ++

[net-next 0/2] tipc: link changeover issues

2019-07-11 Thread Tuong Lien
This patch series is to resolve some issues found with the current link changeover mechanism, it also includes an optimization for the link synching. Tuong Lien (2): tipc: optimize link synching mechanism tipc: fix changeover issues due to large packet net/tipc/link.c | 119

[net-next 2/2] tipc: fix changeover issues due to large packet

2019-07-11 Thread Tuong Lien
the original message size is too large, it will be fragmented & reassembled at the receiving side. Acked-by: Ying Xue Acked-by: Jon Maloy Signed-off-by: Tuong Lien --- net/tipc/link.c | 93 - net/tipc/msg.c | 59 +

[net-next] tipc: include retrans failure detection for unicast

2019-06-16 Thread Tuong Lien
ies this feature for link unicast retransmissions that has been done via the function - "tipc_link_advance_transmq()". Also, the "tipc_link_retrans()" is renamed to "tipc_link_bc_retrans()" as it is used only for broadcast. Acked-by: Jon Maloy

[net] tipc: fix issues with early FAILOVER_MSG from peer

2019-06-16 Thread Tuong Lien
e function "tipc_node_link_failover()" is toughen to avoid such a situation from happening. Acked-by: Jon Maloy Signed-off-by: Tuong Lien --- net/tipc/link.c | 1 - net/tipc/node.c | 10 +++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/net/tipc/link.c b/net/

[net] tipc: fix link session and re-establish issues

2019-02-10 Thread Tuong Lien
is reset, its state will move to RESET according to the link FSM, along with resetting the 'in_session' flag (and the other data) as a normal link reset, it will also be deleted if requested. The solution is backward compatible. Acked-by: Jon Maloy Acked-by: Ying Xue Signed-off-b

[net-next 3/5] tipc: add trace_events for tipc socket

2018-12-18 Thread Tuong Lien
pc_sk_advance_rx' vs 'tipc_sk_filter_rcv') or actions can be triggerred in the meanwhile to see what is going on with the socket queue. In addition, the 'trace_tipc_sk_dump()' is also placed at the 'TIPC_ERR_OVERLOAD/2' case, so the socket and last skb can be dumpe

[net-next 5/5] tipc: add trace_events for tipc bearer

2018-12-18 Thread Tuong Lien
Acked-by: Jon Maloy Signed-off-by: Tuong Lien --- net/tipc/bearer.c | 2 ++ net/tipc/trace.h | 43 +++ 2 files changed, 45 insertions(+) diff --git a/net/tipc/bearer.c b/net/tipc/bearer.c index e32294f37c29..fb2c0d8f359f 100644 --- a/net/tipc/bearer.c

[net-next 1/5] tipc: enable tracepoints in tipc

2018-12-18 Thread Tuong Lien
race/ftrace.txt MAINTAINERS | add two new files 'trace.h' & 'trace.c' in tipc Acked-by: Ying Xue Tested-by: Ying Xue Acked-by: Jon Maloy Signed-off-by: Tuong Lien --- net/tipc/Makefile | 4 +- net/tipc/bearer.c | 7 +- net/tipc/bearer.h | 2 +- ne

[net-next 2/5] tipc: add trace_events for tipc link

2018-12-18 Thread Tuong Lien
ct when the failure happens. The same approach is also applied for the faulty case that the validation of protocol message is failed. Acked-by: Ying Xue Tested-by: Ying Xue Acked-by: Jon Maloy Signed-off-by: Tuong Lien --- net/tipc/link.c | 33 ++- net/tipc/link.h | 1 + net

[net-next 0/5] tipc: tracepoints and trace_events in TIPC

2018-12-18 Thread Tuong Lien
rful kernel tracepoints, trace events features along with particular dump functions to trace the TIPC object data and events (incl. bearer, link, socket, node, etc.). The tracing code should generate zero-load to TIPC when the trace events are not enabled. Tuong Lien (5): tipc: enable tracepoints in

[net-next 4/5] tipc: add trace_events for tipc node

2018-12-18 Thread Tuong Lien
checked/updated. Acked-by: Ying Xue Tested-by: Ying Xue Acked-by: Jon Maloy Signed-off-by: Tuong Lien --- net/tipc/node.c | 15 +++ net/tipc/trace.h | 9 + 2 files changed, 24 insertions(+) diff --git a/net/tipc/node.c b/net/tipc/node.c index cff42c95cef8..a67c40bf6e6c