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: <1321518828-4288-1-git-send-email-roy.qing.li@gmail.com>
Date:	Thu, 17 Nov 2011 16:33:48 +0800
From:	roy.qing.li@...il.com
To:	netdev@...r.kernel.org
Subject: [PATCH] ipv4: avoid to double release dst in tcp_v4_connect

From: RongQing.Li <roy.qing.li@...il.com> 

When tcp_connect failed in tcp_v4_connect, the dst will be
released in error handler of tcp_v4_connect, but dst has been
set to sk->sk_dst_cache which will be released again when
destroy this sk.

Signed-off-by: RongQing.Li <roy.qing.li@...il.com>
---
 net/ipv4/tcp_ipv4.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c
index a744315..adc2992 100644
--- a/net/ipv4/tcp_ipv4.c
+++ b/net/ipv4/tcp_ipv4.c
@@ -263,8 +263,10 @@ int tcp_v4_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len)
 
 	err = tcp_connect(sk);
 	rt = NULL;
-	if (err)
+	if (err) {
+		sk->sk_dst_cache = NULL;
 		goto failure;
+	}
 
 	return 0;
 
-- 
1.7.1

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