linux-stable/net/x25
Xiyu Yang 4becb7ee5b net/x25: Fix x25_neigh refcnt leak when x25 disconnect
x25_connect() invokes x25_get_neigh(), which returns a reference of the
specified x25_neigh object to "x25->neighbour" with increased refcnt.

When x25 connect success and returns, the reference still be hold by
"x25->neighbour", so the refcount should be decreased in
x25_disconnect() to keep refcount balanced.

The reference counting issue happens in x25_disconnect(), which forgets
to decrease the refcnt increased by x25_get_neigh() in x25_connect(),
causing a refcnt leak.

Fix this issue by calling x25_neigh_put() before x25_disconnect()
returns.

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>
2020-04-27 11:20:30 -07:00
..
af_x25.c
Kconfig
Makefile
sysctl_net_x25.c
x25_dev.c
x25_facilities.c
x25_forward.c
x25_in.c
x25_link.c
x25_out.c
x25_proc.c
x25_route.c
x25_subr.c net/x25: Fix x25_neigh refcnt leak when x25 disconnect 2020-04-27 11:20:30 -07:00
x25_timer.c