diff options
author | Xiyu Yang <xiyuyang19@fudan.edu.cn> | 2020-04-15 10:40:28 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2020-04-18 22:24:20 +0200 |
commit | de058420767df21e2b6b0f3bb36d1616fb962032 (patch) | |
tree | 0735bb70564a33dce45033a01cc227e3e33a37e2 /net/tipc/bcast.c | |
parent | tipc: Fix potential tipc_aead refcnt leak in tipc_crypto_rcv (diff) | |
download | linux-de058420767df21e2b6b0f3bb36d1616fb962032.tar.xz linux-de058420767df21e2b6b0f3bb36d1616fb962032.zip |
tipc: Fix potential tipc_node refcnt leak in tipc_rcv
tipc_rcv() invokes tipc_node_find() twice, which returns a reference of
the specified tipc_node object to "n" with increased refcnt.
When tipc_rcv() returns or a new object is assigned to "n", the original
local reference of "n" becomes invalid, so the refcount should be
decreased to keep refcount balanced.
The issue happens in some paths of tipc_rcv(), which forget to decrease
the refcnt increased by tipc_node_find() and will cause a refcnt leak.
Fix this issue by calling tipc_node_put() before the original object
pointed by "n" becomes invalid.
Signed-off-by: Xiyu Yang <xiyuyang19@fudan.edu.cn>
Signed-off-by: Xin Tan <tanxin.ctf@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/tipc/bcast.c')
0 files changed, 0 insertions, 0 deletions