kernel-fxtec-pro1x/net/batman-adv
Sven Eckelmann 948e8eba65 batman-adv: Avoid free/alloc race when handling OGM buffer
commit 40e220b4218bb3d278e5e8cc04ccdfd1c7ff8307 upstream.

Each slave interface of an B.A.T.M.A.N. IV virtual interface has an OGM
packet buffer which is initialized using data from netdevice notifier and
other rtnetlink related hooks. It is sent regularly via various slave
interfaces of the batadv virtual interface and in this process also
modified (realloced) to integrate additional state information via TVLV
containers.

It must be avoided that the worker item is executed without a common lock
with the netdevice notifier/rtnetlink helpers. Otherwise it can either
happen that half modified/freed data is sent out or functions modifying the
OGM buffer try to access already freed memory regions.

Reported-by: syzbot+0cc629f19ccb8534935b@syzkaller.appspotmail.com
Fixes: c6c8fea297 ("net: Add batman-adv meshing protocol")
Signed-off-by: Sven Eckelmann <sven@narfation.org>
Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-11-06 13:06:22 +01:00
..
bat_algo.c
bat_algo.h
bat_iv_ogm.c batman-adv: Avoid free/alloc race when handling OGM buffer 2019-11-06 13:06:22 +01:00
bat_iv_ogm.h
bat_v.c
bat_v.h
bat_v_elp.c
bat_v_elp.h
bat_v_ogm.c batman-adv: Only read OGM2 tvlv_len after buffer len check 2019-09-21 07:16:59 +02:00
bat_v_ogm.h
bitarray.c
bitarray.h
bridge_loop_avoidance.c
bridge_loop_avoidance.h
debugfs.c
debugfs.h
distributed-arp-table.c
distributed-arp-table.h
fragmentation.c
fragmentation.h
gateway_client.c
gateway_client.h
gateway_common.c
gateway_common.h
hard-interface.c batman-adv: Avoid free/alloc race when handling OGM buffer 2019-11-06 13:06:22 +01:00
hard-interface.h
hash.c
hash.h
icmp_socket.c
icmp_socket.h
Kconfig
log.c
log.h
main.c
main.h
Makefile
multicast.c
multicast.h
netlink.c batman-adv: fix uninit-value in batadv_netlink_get_ifindex() 2019-09-16 08:21:41 +02:00
netlink.h
network-coding.c
network-coding.h
originator.c
originator.h
routing.c
routing.h
send.c
send.h
soft-interface.c
soft-interface.h
sysfs.c
sysfs.h
tp_meter.c
tp_meter.h
translation-table.c batman-adv: fix for leaked TVLV handler. 2019-07-26 09:13:59 +02:00
translation-table.h
tvlv.c
tvlv.h
types.h batman-adv: Avoid free/alloc race when handling OGM buffer 2019-11-06 13:06:22 +01:00