1
0
Fork 0
alistair23-linux/drivers/net
Petr Machata fc4aa1ca16 net: vxlan: Free a leaked vetoed multicast rdst
When an rdst is rejected by a driver, the current code removes it from
the remote list, but neglects to free it. This is triggered by
tools/testing/selftests/drivers/net/mlxsw/vxlan_fdb_veto.sh and shows as
the following kmemleak trace:

unreferenced object 0xffff88817fa3d888 (size 96):
  comm "softirq", pid 0, jiffies 4372702718 (age 165.252s)
  hex dump (first 32 bytes):
    02 00 00 00 c6 33 64 03 80 f5 a2 61 81 88 ff ff  .....3d....a....
    06 df 71 ae ff ff ff ff 0c 00 00 00 04 d2 6a 6b  ..q...........jk
  backtrace:
    [<00000000296b27ac>] kmem_cache_alloc_trace+0x1ae/0x370
    [<0000000075c86dc6>] vxlan_fdb_append.part.12+0x62/0x3b0 [vxlan]
    [<00000000e0414b63>] vxlan_fdb_update+0xc61/0x1020 [vxlan]
    [<00000000f330c4bd>] vxlan_fdb_add+0x2e8/0x3d0 [vxlan]
    [<0000000008f81c2c>] rtnl_fdb_add+0x4c2/0xa10
    [<00000000bdc4b270>] rtnetlink_rcv_msg+0x6dd/0x970
    [<000000006701f2ce>] netlink_rcv_skb+0x290/0x410
    [<00000000c08a5487>] rtnetlink_rcv+0x15/0x20
    [<00000000d5f54b1e>] netlink_unicast+0x43f/0x5e0
    [<00000000db4336bb>] netlink_sendmsg+0x789/0xcd0
    [<00000000e1ee26b6>] sock_sendmsg+0xba/0x100
    [<00000000ba409802>] ___sys_sendmsg+0x631/0x960
    [<000000003c332113>] __sys_sendmsg+0xea/0x180
    [<00000000f4139144>] __x64_sys_sendmsg+0x78/0xb0
    [<000000006d1ddc59>] do_syscall_64+0x94/0x410
    [<00000000c8defa9a>] entry_SYSCALL_64_after_hwframe+0x49/0xbe

Move vxlan_dst_free() up and schedule a call thereof to plug this leak.

Fixes: 61f46fe8c6 ("vxlan: Allow vetoing of FDB notifications")
Signed-off-by: Petr Machata <petrm@mellanox.com>
Acked-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2019-02-07 11:17:08 -08:00
..
appletalk drivers/net: appletalk/cops: remove redundant if statement and mask 2018-12-24 14:48:26 -08:00
arcnet
bonding bonding: count master 3ad stats separately 2019-01-24 22:18:48 -08:00
caif net: caif: call dev_consume_skb_any when skb xmit done 2019-01-29 10:09:28 -08:00
can can: flexcan: fix NULL pointer exception during bringup 2019-01-22 11:35:33 +01:00
dsa net: dsa: mv88e6xxx: Prevent suspend to RAM 2019-02-06 17:16:09 -08:00
ethernet net/mlx5e: Add tx timeout support for mlx5e tx reporter 2019-02-07 10:34:29 -08:00
fddi cross-tree: phase out dma_zalloc_coherent() 2019-01-08 07:58:37 -05:00
fjes fjes: convert to DEFINE_SHOW_ATTRIBUTE 2018-12-10 12:05:20 -08:00
hamradio net/hamradio/6pack: use mod_timer() to rearm timers 2019-01-02 10:27:01 -08:00
hippi
hyperv hv_netvsc: fix typos in code comments 2019-01-23 13:21:34 -05:00
ieee802154 Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2018-12-20 11:53:36 -08:00
ipvlan net: ipvlan: Issue NETDEV_PRE_CHANGEADDR 2018-12-13 18:41:38 -08:00
netdevsim netdevsim: Implement ndo_get_port_parent_id() 2019-02-06 14:17:03 -08:00
phy net: phy: fixed_phy: Fix fixed_phy not checking GPIO 2019-02-07 09:49:49 -08:00
plip
ppp net: Fix usage of pskb_trim_rcsum 2019-01-18 14:05:14 -08:00
slip
team net: dev: Add extack argument to dev_set_mac_address() 2018-12-13 18:41:38 -08:00
usb net: phy: fixed-phy: Drop GPIO from fixed_phy_add() 2019-02-04 18:33:36 -08:00
vmxnet3 cross-tree: phase out dma_zalloc_coherent() 2019-01-08 07:58:37 -05:00
wan net: lmc: remove -I. header search path 2019-01-26 18:27:04 -08:00
wimax
wireless wireless-drivers-next patches for 5.1 2019-02-06 09:36:36 -08:00
xen-netback net: xenbus: convert to DEFINE_SHOW_ATTRIBUTE 2018-12-10 12:05:20 -08:00
Kconfig net: Fix typo in NET_FAILOVER help text 2019-01-18 14:06:29 -08:00
LICENSE.SRC
Makefile
Space.c
dummy.c
eql.c
geneve.c
gtp.c
ifb.c
loopback.c
macsec.c
macvlan.c macvlan: use netif_is_macvlan_port() 2019-01-31 09:26:31 -08:00
macvtap.c
mdio.c
mii.c
net_failover.c net: core: dev: Add extack argument to dev_open() 2018-12-06 13:26:06 -08:00
netconsole.c
nlmon.c
ntb_netdev.c
rionet.c rapidio/rionet: do not free skb before reading its length 2018-11-28 10:38:48 -08:00
sb1000.c sb1000: fix a couple of indentation issues and remove assignment in if statements 2019-01-17 21:51:36 -08:00
sungem_phy.c
tap.c tap: call skb_probe_transport_header after setting skb->dev 2019-01-01 12:01:02 -08:00
thunderbolt.c
tun.c tun: publish tfile after it's fully initialized 2019-01-10 09:24:38 -05:00
veth.c
virtio_net.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2019-01-21 14:41:32 -08:00
vrf.c net: core: dev: Add extack argument to dev_change_flags() 2018-12-06 13:26:07 -08:00
vsockmon.c
vxlan.c net: vxlan: Free a leaked vetoed multicast rdst 2019-02-07 11:17:08 -08:00
xen-netfront.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2018-12-20 11:53:36 -08:00