[TCP]: Fix oops caused by tcp_v4_md5_do_del
authorLeigh Brown <leigh@solinno.co.uk>
Mon, 18 Dec 2006 01:12:30 +0000 (17:12 -0800)
committerDavid S. Miller <davem@sunset.davemloft.net>
Mon, 18 Dec 2006 05:59:25 +0000 (21:59 -0800)
md5sig_info.alloced4 must be set to zero when freeing keys4, otherwise
it will not be alloc'd again when another key is added to the same
socket by tcp_v4_md5_do_add.

Signed-off-by: Leigh Brown <leigh@solinno.co.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/tcp_ipv4.c

index a1222d6..fa814fc 100644 (file)
@@ -928,6 +928,7 @@ int tcp_v4_md5_do_del(struct sock *sk, __be32 addr)
                        if (tp->md5sig_info->entries4 == 0) {
                                kfree(tp->md5sig_info->keys4);
                                tp->md5sig_info->keys4 = NULL;
+                               tp->md5sig_info->alloced4 = 0;
                        } else if (tp->md5sig_info->entries4 != i) {
                                /* Need to do some manipulation */
                                memcpy(&tp->md5sig_info->keys4[i],