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: <20240215202949.29879-1-kovalev@altlinux.org>
Date: Thu, 15 Feb 2024 23:29:49 +0300
From: kovalev@...linux.org
To: netdev@...r.kernel.org
Cc: edumazet@...gle.com,
	davem@...emloft.net,
	dsahern@...nel.org,
	kuba@...nel.org,
	pabeni@...hat.com,
	ebiederm@...ssion.com,
	kovalev@...linux.org
Subject: [PATCH] tcp_metrics: fix possible memory leak in tcp_metrics_init()

From: Vasiliy Kovalev <kovalev@...linux.org>

Fixes: 6493517eaea9 ("tcp_metrics: panic when tcp_metrics_init fails.")
Signed-off-by: Vasiliy Kovalev <kovalev@...linux.org>
---
 net/ipv4/tcp_metrics.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/net/ipv4/tcp_metrics.c b/net/ipv4/tcp_metrics.c
index c2a925538542b5..517c7f801dc220 100644
--- a/net/ipv4/tcp_metrics.c
+++ b/net/ipv4/tcp_metrics.c
@@ -1048,6 +1048,8 @@ void __init tcp_metrics_init(void)
 		panic("Could not register tcp_net_metrics_ops\n");
 
 	ret = genl_register_family(&tcp_metrics_nl_family);
-	if (ret < 0)
+	if (ret < 0) {
 		panic("Could not register tcp_metrics generic netlink\n");
+		unregister_pernet_subsys(&tcp_net_metrics_ops);
+	}
 }
-- 
2.33.8


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ