netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/3] flex_array: fix the panic issue when calling flex_array_alloc() without __GFP_ZERO
@ 2010-04-09  4:05 Changli Gao
  2010-04-09 17:09 ` David Rientjes
  0 siblings, 1 reply; 2+ messages in thread
From: Changli Gao @ 2010-04-09  4:05 UTC (permalink / raw)
  To: Patrick McHardy; +Cc: Linux Kernel Mailing List, netfilter-devel, xiaosuo

fix the panic issue when calling flex_array_alloc() without __GFP_ZERO.

memset is called with the wrong address, then kernel panics.

Signed-off-by: Changli Gao <xiaosuo@gmail.com>
----
lib/flex_array.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/flex_array.c b/lib/flex_array.c
index 66eef2e..6fbb514 100644
--- a/lib/flex_array.c
+++ b/lib/flex_array.c
@@ -99,7 +99,7 @@ struct flex_array *flex_array_alloc(int element_size, unsigned int total,
 	ret->element_size = element_size;
 	ret->total_nr_elements = total;
 	if (elements_fit_in_base(ret) && !(flags & __GFP_ZERO))
-		memset(ret->parts[0], FLEX_ARRAY_FREE,
+		memset(&ret->parts[0], FLEX_ARRAY_FREE,
 						FLEX_ARRAY_BASE_BYTES_LEFT);
 	return ret;
 }



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH 1/3] flex_array: fix the panic issue when calling flex_array_alloc() without __GFP_ZERO
  2010-04-09  4:05 [PATCH 1/3] flex_array: fix the panic issue when calling flex_array_alloc() without __GFP_ZERO Changli Gao
@ 2010-04-09 17:09 ` David Rientjes
  0 siblings, 0 replies; 2+ messages in thread
From: David Rientjes @ 2010-04-09 17:09 UTC (permalink / raw)
  To: Changli Gao; +Cc: Patrick McHardy, Linux Kernel Mailing List, netfilter-devel

On Fri, 9 Apr 2010, Changli Gao wrote:

> fix the panic issue when calling flex_array_alloc() without __GFP_ZERO.
> 
> memset is called with the wrong address, then kernel panics.
> 
> Signed-off-by: Changli Gao <xiaosuo@gmail.com>

Acked-by: David Rientjes <rientjes@google.com>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-04-09 17:09 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-04-09  4:05 [PATCH 1/3] flex_array: fix the panic issue when calling flex_array_alloc() without __GFP_ZERO Changli Gao
2010-04-09 17:09 ` David Rientjes

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).