lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20180814223657.32101-1-dsahern@kernel.org>
Date:   Tue, 14 Aug 2018 15:36:57 -0700
From:   dsahern@...nel.org
To:     netdev@...r.kernel.org
Cc:     davem@...emloft.net, makita.toshiaki@....ntt.co.jp,
        David Ahern <dsahern@...il.com>
Subject: [PATCH net] veth: Free queues on link delete

From: David Ahern <dsahern@...il.com>

kmemleak reported new suspected memory leaks.
$ cat /sys/kernel/debug/kmemleak
unreferenced object 0xffff880130b6ec00 (size 1024):
  comm "ip", pid 916, jiffies 4296194668 (age 7251.672s)
  hex dump (first 32 bytes):
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
  backtrace:
    [<000000001ed37cc9>] kmemleak_alloc+0x70/0x94
    [<00000000646dfdeb>] slab_post_alloc_hook+0x42/0x52
    [<0000000004aba61b>] __kmalloc+0x101/0x142
    [<0000000054d50e21>] kmalloc_array.constprop.20+0x1e/0x26 [veth]
    [<000000008238855a>] veth_newlink+0x147/0x3ac [veth]
...

The allocation in question is veth_alloc_queues.

Free the queues on a delete.

Fixes: 638264dc90227 ("veth: Support per queue XDP ring")
Signed-off-by: David Ahern <dsahern@...il.com>
---
 drivers/net/veth.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/veth.c b/drivers/net/veth.c
index e3202af72df5..bef7d212f04e 100644
--- a/drivers/net/veth.c
+++ b/drivers/net/veth.c
@@ -1205,6 +1205,7 @@ static void veth_dellink(struct net_device *dev, struct list_head *head)
 	struct veth_priv *priv;
 	struct net_device *peer;
 
+	veth_free_queues(dev);
 	priv = netdev_priv(dev);
 	peer = rtnl_dereference(priv->peer);
 
-- 
2.11.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ