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:	Thu, 8 May 2014 15:55:05 +0800
From:	Wang Weidong <wangweidong1@...wei.com>
To:	David Miller <davem@...emloft.net>,
	Vlad Yasevich <vyasevich@...il.com>,
	Neil Horman <nhorman@...driver.com>
CC:	Daniel Borkmann <dborkman@...hat.com>,
	<linux-sctp@...r.kernel.org>, <netdev@...r.kernel.org>
Subject: [PATCH net-next] sctp: add a checking for sctp_sysctl_net_register

When register_net_sysctl failed, we should free the
sysctl_table while the net_namespace is not init_net.

Signed-off-by: Wang Weidong <wangweidong1@...wei.com>
---
 net/sctp/sysctl.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/net/sctp/sysctl.c b/net/sctp/sysctl.c
index 844d2b0..4c17694 100644
--- a/net/sctp/sysctl.c
+++ b/net/sctp/sysctl.c
@@ -450,6 +450,11 @@ int sctp_sysctl_net_register(struct net *net)
 	}
 
 	net->sctp.sysctl_header = register_net_sysctl(net, "net/sctp", table);
+	if (net->sctp.sysctl_header == NULL) {
+		if (!net_eq(net, &init_net))
+			kfree(table);
+		return -ENOMEM;
+	}
 	return 0;
 }
 
-- 
1.7.12


--
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