From: YOSHIFUJI Hideaki Date: Wed, 25 Jul 2007 04:47:05 +0000 (-0700) Subject: Fix TCP IPV6 MD5 bug. X-Git-Tag: v2.6.22.2~66 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=668df9fe157abbc90efc0ca054048300afb5937c;p=karo-tx-linux.git Fix TCP IPV6 MD5 bug. [TCPv6] MD5SIG: Ensure to reset allocation count to avoid panic. After clearing all passwords for IPv6 peers, we need to set allocation count to zero as well as we free the storage. Otherwise, we panic when a user trys to (re)add a password. Discovered and fixed by MIYAJIMA Mitsuharu . Signed-off-by: YOSHIFUJI Hideaki Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c index 193d9d60bb7a..17bbdc3d4fea 100644 --- a/net/ipv6/tcp_ipv6.c +++ b/net/ipv6/tcp_ipv6.c @@ -644,6 +644,7 @@ static int tcp_v6_md5_do_del(struct sock *sk, struct in6_addr *peer) if (tp->md5sig_info->entries6 == 0) { kfree(tp->md5sig_info->keys6); tp->md5sig_info->keys6 = NULL; + tp->md5sig_info->alloced6 = 0; tcp_free_md5sig_pool();