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]
Date:	Tue, 23 Mar 2010 14:05:39 +0800
From:	Changli Gao <xiaosuo@...il.com>
To:	"David S. Miller" <davem@...emloft.net>
CC:	xiaosuo <xiaosuo@...il.com>, Tom Herbert <therbert@...gle.com>,
	netdev@...r.kernel.org
Subject: [PATCH] rps: memory leak due to forget to release rx queues

memory leak due to forget to release rx queues.

rx queues is allocated in alloc_netdev_mq(), but they aren't released in
free_netdev(), and the field rps_map is also miss.

Signed-off-by: Changli Gao <xiaosuo@...il.com>
----
net/core/dev.c | 8 ++++++++
1 file changed, 8 insertions(+)

diff --git a/net/core/dev.c b/net/core/dev.c
index c0e2608..51b86e0 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -5746,6 +5746,14 @@ void free_netdev(struct net_device *dev)
 
 	release_net(dev_net(dev));
 
+	if (dev->num_rx_queues) {
+		int i;
+
+		for (i = 0; i < dev->num_rx_queues; i++)
+			kfree(dev->_rx[i].rps_map);
+		kfree(dev->_rx);
+	}
+
 	kfree(dev->_tx);
 
 	/* Flush device addresses */


--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ