]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
Fix TCP IPV6 MD5 bug.
authorYOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Wed, 25 Jul 2007 04:47:05 +0000 (21:47 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 9 Aug 2007 21:27:30 +0000 (14:27 -0700)
[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 <miyajima.mitsuharu@anchor.jp>.

Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
net/ipv6/tcp_ipv6.c

index 193d9d60bb7a8fabb0ab3eec481e1a7ce0ff1b86..17bbdc3d4fea5ae704e5f5959eca2f2277dd095a 100644 (file)
@@ -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();