android_kernel_motorola_sm6225/net/batman-adv
Remi Pommarel 64453d60e6 batman-adv: Fix batadv_v_ogm_aggr_send memory leak
commit 421d467dc2d483175bad4fb76a31b9e5a3d744cf upstream.

When batadv_v_ogm_aggr_send is called for an inactive interface, the skb
is silently dropped by batadv_v_ogm_send_to_if() but never freed causing
the following memory leak:

  unreferenced object 0xffff00000c164800 (size 512):
    comm "kworker/u8:1", pid 2648, jiffies 4295122303 (age 97.656s)
    hex dump (first 32 bytes):
      00 80 af 09 00 00 ff ff e1 09 00 00 75 01 60 83  ............u.`.
      1f 00 00 00 b8 00 00 00 15 00 05 00 da e3 d3 64  ...............d
    backtrace:
      [<0000000007ad20f6>] __kmalloc_track_caller+0x1a8/0x310
      [<00000000d1029e55>] kmalloc_reserve.constprop.0+0x70/0x13c
      [<000000008b9d4183>] __alloc_skb+0xec/0x1fc
      [<00000000c7af5051>] __netdev_alloc_skb+0x48/0x23c
      [<00000000642ee5f5>] batadv_v_ogm_aggr_send+0x50/0x36c
      [<0000000088660bd7>] batadv_v_ogm_aggr_work+0x24/0x40
      [<0000000042fc2606>] process_one_work+0x3b0/0x610
      [<000000002f2a0b1c>] worker_thread+0xa0/0x690
      [<0000000059fae5d4>] kthread+0x1fc/0x210
      [<000000000c587d3a>] ret_from_fork+0x10/0x20

Free the skb in that case to fix this leak.

Cc: stable@vger.kernel.org
Fixes: 0da0035942 ("batman-adv: OGMv2 - add basic infrastructure")
Signed-off-by: Remi Pommarel <repk@triplefau.lt>
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>
2023-08-30 16:31:55 +02:00
..
bat_algo.c
bat_algo.h
bat_iv_ogm.c
bat_iv_ogm.h
bat_v.c
bat_v.h
bat_v_elp.c batman-adv: Do not get eth header before batadv_check_management_packet 2023-08-30 16:31:55 +02:00
bat_v_elp.h
bat_v_ogm.c batman-adv: Fix batadv_v_ogm_aggr_send memory leak 2023-08-30 16:31:55 +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 batman-adv: Broken sync while rescheduling delayed work 2023-06-14 10:57:13 +02:00
distributed-arp-table.h
fragmentation.c batman-adv: Don't skb_split skbuffs with frag_list 2022-05-18 09:42:47 +02:00
fragmentation.h
gateway_client.c
gateway_client.h
gateway_common.c
gateway_common.h
hard-interface.c batman-adv: Don't increase MTU when set by user 2023-08-30 16:31:55 +02: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
netlink.h
network-coding.c
network-coding.h
originator.c
originator.h
routing.c
routing.h
send.c
send.h
soft-interface.c batman-adv: Don't increase MTU when set by user 2023-08-30 16:31:55 +02:00
soft-interface.h
sysfs.c
sysfs.h
tp_meter.c
tp_meter.h
translation-table.c batman-adv: Fix TT global entry leak when client roamed back 2023-08-30 16:31:55 +02:00
translation-table.h
tvlv.c
tvlv.h
types.h batman-adv: Don't increase MTU when set by user 2023-08-30 16:31:55 +02:00