kernel_optimize_test/net/batman-adv
Xiyu Yang 6f91a3f7af batman-adv: Fix refcnt leak in batadv_v_ogm_process
batadv_v_ogm_process() invokes batadv_hardif_neigh_get(), which returns
a reference of the neighbor object to "hardif_neigh" with increased
refcount.

When batadv_v_ogm_process() returns, "hardif_neigh" becomes invalid, so
the refcount should be decreased to keep refcount balanced.

The reference counting issue happens in one exception handling paths of
batadv_v_ogm_process(). When batadv_v_ogm_orig_get() fails to get the
orig node and returns NULL, the refcnt increased by
batadv_hardif_neigh_get() is not decreased, causing a refcnt leak.

Fix this issue by jumping to "out" label when batadv_v_ogm_orig_get()
fails to get the orig node.

Fixes: 9323158ef9 ("batman-adv: OGMv2 - implement originators logic")
Signed-off-by: Xiyu Yang <xiyuyang19@fudan.edu.cn>
Signed-off-by: Xin Tan <tanxin.ctf@gmail.com>
Signed-off-by: Sven Eckelmann <sven@narfation.org>
Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de>
2020-04-21 10:08:05 +02:00
..
bat_algo.c
bat_algo.h
bat_iv_ogm.c batman-adv: Don't schedule OGM for disabled interface 2020-02-18 09:07:55 +01:00
bat_iv_ogm.h
bat_v_elp.c
bat_v_elp.h
bat_v_ogm.c batman-adv: Fix refcnt leak in batadv_v_ogm_process 2020-04-21 10:08:05 +02:00
bat_v_ogm.h
bat_v.c
bat_v.h
bitarray.c
bitarray.h
bridge_loop_avoidance.c
bridge_loop_avoidance.h
debugfs.c
debugfs.h
distributed-arp-table.c batman-adv: Replace zero-length array with flexible-array member 2020-02-17 22:43:42 +01:00
distributed-arp-table.h
fragmentation.c
fragmentation.h
gateway_client.c
gateway_client.h
gateway_common.c
gateway_common.h
hard-interface.c
hard-interface.h
hash.c
hash.h
icmp_socket.c
icmp_socket.h
Kconfig
log.c
log.h
main.c
main.h batman-adv: Start new development cycle 2020-02-16 16:00:02 +01:00
Makefile
multicast.c
multicast.h
netlink.c
netlink.h
network-coding.c batman-adv: fix batadv_nc_random_weight_tq 2020-04-21 10:08:04 +02:00
network-coding.h
originator.c
originator.h
routing.c
routing.h
send.c
send.h
soft-interface.c
soft-interface.h
sysfs.c batman-adv: Fix refcnt leak in batadv_store_throughput_override 2020-04-21 10:08:05 +02:00
sysfs.h
tp_meter.c
tp_meter.h
trace.c
trace.h
translation-table.c batman-adv: Avoid RCU list-traversal in spinlock 2020-02-17 16:07:50 +01:00
translation-table.h
tvlv.c
tvlv.h
types.h