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: <20180109182116.olzb5rroeazq4ufv@xylophone.i.decadent.org.uk>
Date:   Tue, 9 Jan 2018 18:21:16 +0000
From:   Ben Hutchings <ben.hutchings@...ethink.co.uk>
To:     netdev@...r.kernel.org
Cc:     WANG Cong <xiyou.wangcong@...il.com>,
        Andrey Konovalov <andreyknvl@...gle.com>
Subject: [PATCH net] ipv6: Fix cleanup ordering on inet6_init() error path

Commit 15e668070a64 reordered the initialisation in inet6_init() to
fix a crash on an error path further down the call stack.  It also
reordered cleanup on the error path in inet6_init(), but the result
is not the reverse of the initialisation order.  This presumably
can result in a resource leak or crash in some error cases.  Reorder
cleanup again to fix this.

Fixes: 15e668070a64 ("ipv6: reorder icmpv6_init() and ip6_mr_init()")
Signed-off-by: Ben Hutchings <ben.hutchings@...ethink.co.uk>
---
This fix is untested and based only on my review of the earlier commit.

Ben.

 net/ipv6/af_inet6.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/net/ipv6/af_inet6.c b/net/ipv6/af_inet6.c
index c9441ca45399..fbaa70d95d7f 100644
--- a/net/ipv6/af_inet6.c
+++ b/net/ipv6/af_inet6.c
@@ -1074,11 +1074,11 @@ static int __init inet6_init(void)
 igmp_fail:
 	ndisc_cleanup();
 ndisc_fail:
-	ip6_mr_cleanup();
+	icmpv6_cleanup();
 icmp_fail:
-	unregister_pernet_subsys(&inet6_net_ops);
+	ip6_mr_cleanup();
 ipmr_fail:
-	icmpv6_cleanup();
+	unregister_pernet_subsys(&inet6_net_ops);
 register_pernet_fail:
 	sock_unregister(PF_INET6);
 	rtnl_unregister_all(PF_INET6);
-- 
2.15.0.rc0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ