| From stable-bounces@linux.kernel.org Mon Nov 21 02:06:49 2005 |
| Date: Mon, 21 Nov 2005 19:07:25 +0900 (JST) |
| Message-Id: <20051121.190725.16741184.yoshfuji@linux-ipv6.org> |
| To: stable@kernel.org |
| From: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org> |
| Cc: yoshfuji@linux-ipv6.org |
| Subject: [PATCH] [IPV6]: Fix memory management error during setting up new advapi sockopts. |
| |
| Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org> |
| Signed-off-by: Chris Wright <chrisw@osdl.org> |
| Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> |
| --- |
| net/ipv6/exthdrs.c | 3 ++- |
| 1 file changed, 2 insertions(+), 1 deletion(-) |
| |
| --- linux-2.6.14.2.orig/net/ipv6/exthdrs.c |
| +++ linux-2.6.14.2/net/ipv6/exthdrs.c |
| @@ -628,6 +628,7 @@ ipv6_renew_options(struct sock *sk, stru |
| if (!tot_len) |
| return NULL; |
| |
| + tot_len += sizeof(*opt2); |
| opt2 = sock_kmalloc(sk, tot_len, GFP_ATOMIC); |
| if (!opt2) |
| return ERR_PTR(-ENOBUFS); |
| @@ -668,7 +669,7 @@ ipv6_renew_options(struct sock *sk, stru |
| |
| return opt2; |
| out: |
| - sock_kfree_s(sk, p, tot_len); |
| + sock_kfree_s(sk, opt2, opt2->tot_len); |
| return ERR_PTR(err); |
| } |
| |