diff options
author | Tung Nguyen <tung.q.nguyen@dektech.com.au> | 2018-04-17 21:58:27 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-04-18 19:48:43 +0200 |
commit | 36a50a989ee8267588de520b8704b85f045a3220 (patch) | |
tree | 4814069cc75b778297fe5ff5f16e53f39c167e90 /net/tipc/monitor.c | |
parent | tipc: fix use-after-free in tipc_nametbl_stop (diff) | |
download | linux-36a50a989ee8267588de520b8704b85f045a3220.tar.xz linux-36a50a989ee8267588de520b8704b85f045a3220.zip |
tipc: fix infinite loop when dumping link monitor summary
When configuring the number of used bearers to MAX_BEARER and issuing
command "tipc link monitor summary", the command enters infinite loop
in user space.
This issue happens because function tipc_nl_node_dump_monitor() returns
the wrong 'prev_bearer' value when all potential monitors have been
scanned.
The correct behavior is to always try to scan all monitors until either
the netlink message is full, in which case we return the bearer identity
of the affected monitor, or we continue through the whole bearer array
until we can return MAX_BEARERS. This solution also caters for the case
where there may be gaps in the bearer array.
Signed-off-by: Tung Nguyen <tung.q.nguyen@dektech.com.au>
Signed-off-by: Jon Maloy <jon.maloy@ericsson.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/tipc/monitor.c')
-rw-r--r-- | net/tipc/monitor.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/tipc/monitor.c b/net/tipc/monitor.c index 32dc33a94bc7..5453e564da82 100644 --- a/net/tipc/monitor.c +++ b/net/tipc/monitor.c @@ -777,7 +777,7 @@ int __tipc_nl_add_monitor(struct net *net, struct tipc_nl_msg *msg, ret = tipc_bearer_get_name(net, bearer_name, bearer_id); if (ret || !mon) - return -EINVAL; + return 0; hdr = genlmsg_put(msg->skb, msg->portid, msg->seq, &tipc_genl_family, NLM_F_MULTI, TIPC_NL_MON_GET); |