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 for Android: free password hash cracker in your pocket
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <5287C114.3040306@gmail.com>
Date:	Sat, 16 Nov 2013 14:01:40 -0500
From:	Vlad Yasevich <vyasevich@...il.com>
To:	"netdev@...r.kernel.org" <netdev@...r.kernel.org>
CC:	Hannes Frederic Sowa <hannes@...essinduktion.org>,
	lorenzo@...gle.com, Fabio Estevam <fabio.estevam@...escale.com>
Subject: [PATCH] ipv6: Fix inet6_init() cleanup order

Commit 6d0bfe22611602f36617bc7aa2ffa1bbb2f54c67
	net: ipv6: Add IPv6 support to the ping socket

introduced a change in the cleanup logic of inet6_init and
has a bug in that ipv6_packet_cleanup() may not be called.
Fix the cleanup ordering and add __maybe_unused to pingv6_exit
since it may not be called if CONFIG_SYSCTL is turned off.

CC: Hannes Frederic Sowa <hannes@...essinduktion.org>
CC: Lorenzo Colitti <lorenzo@...gle.com>
CC: Fabio Estevam <fabio.estevam@...escale.com>
Suggested-by: Hannes Frederic Sowa <hannes@...essinduktion.org>
Signed-off-by: Vlad Yasevich <vyasevich@...il.com>
---
 net/ipv6/af_inet6.c | 4 ++--
 net/ipv6/ping.c     | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/net/ipv6/af_inet6.c b/net/ipv6/af_inet6.c
index 6468bda..56ca35b 100644
--- a/net/ipv6/af_inet6.c
+++ b/net/ipv6/af_inet6.c
@@ -958,10 +958,10 @@ out:
  #ifdef CONFIG_SYSCTL
 sysctl_fail:
-	ipv6_packet_cleanup();
+	pingv6_exit();
 #endif
 pingv6_fail:
-	pingv6_exit();
+	ipv6_packet_cleanup();
 ipv6_packet_fail:
 	tcpv6_exit();
 tcpv6_fail:
diff --git a/net/ipv6/ping.c b/net/ipv6/ping.c
index 8815e31..5da68ae 100644
--- a/net/ipv6/ping.c
+++ b/net/ipv6/ping.c
@@ -263,7 +263,7 @@ int __init pingv6_init(void)
 /* This never gets called because it's not possible to unload the ipv6
module,
  * but just in case.
  */
-void pingv6_exit(void)
+void __maybe_unused pingv6_exit(void)
 {
 	pingv6_ops.ipv6_recv_error = dummy_ipv6_recv_error;
 	pingv6_ops.ip6_datagram_recv_ctl = dummy_ip6_datagram_recv_ctl;
-- 
1.8.4.2

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