All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] fix oops in checkpoint/restart error path
@ 2008-10-16 22:51 Dave Hansen
  2008-10-17  3:53 ` Oren Laadan
  0 siblings, 1 reply; 2+ messages in thread
From: Dave Hansen @ 2008-10-16 22:51 UTC (permalink / raw)
  To: containers; +Cc: Dave Hansen


The 'ctx' is kzmalloc()'d.  So, all its contents are zeroed.
It has a list_head, which is walked during cr_ctx_free().
list_for_each() on a non-initalized list_head is bad.  Whoops.


Signed-off-by: Dave Hansen <dave-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>
---

 linux-2.6.git-dave/checkpoint/sys.c |    1 +
 1 file changed, 1 insertion(+)

diff -puN checkpoint/sys.c~fix-cr-oops0 checkpoint/sys.c
--- linux-2.6.git/checkpoint/sys.c~fix-cr-oops0	2008-10-16 15:48:18.000000000 -0700
+++ linux-2.6.git-dave/checkpoint/sys.c	2008-10-16 15:48:35.000000000 -0700
@@ -179,6 +179,7 @@ struct cr_ctx *cr_ctx_alloc(pid_t pid, i
 	ctx = kzalloc(sizeof(*ctx), GFP_KERNEL);
 	if (!ctx)
 		return ERR_PTR(-ENOMEM);
+	INIT_LIST_HEAD(&ctx->pgarr_list);
 
 	ctx->file = fget(fd);
 	if (!ctx->file) {
diff -L checkpoint/ckpt_mem.h -puN /dev/null /dev/null
_

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

* Re: [PATCH] fix oops in checkpoint/restart error path
  2008-10-16 22:51 [PATCH] fix oops in checkpoint/restart error path Dave Hansen
@ 2008-10-17  3:53 ` Oren Laadan
  0 siblings, 0 replies; 2+ messages in thread
From: Oren Laadan @ 2008-10-17  3:53 UTC (permalink / raw)
  To: Dave Hansen; +Cc: containers

Dave -

You must have tested on the wrong version; this line already appears
in the recent patch, in particular in the one that you re-posted !

Also, your reposted the patch-set without the fix to the FPU state.
It's gonna crash as soon as someone tries to use a float variable.

Patience ...

Oren.

Dave Hansen wrote:
> The 'ctx' is kzmalloc()'d.  So, all its contents are zeroed.
> It has a list_head, which is walked during cr_ctx_free().
> list_for_each() on a non-initalized list_head is bad.  Whoops.
> 
> 
> Signed-off-by: Dave Hansen <dave-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>
> ---
> 
>  linux-2.6.git-dave/checkpoint/sys.c |    1 +
>  1 file changed, 1 insertion(+)
> 
> diff -puN checkpoint/sys.c~fix-cr-oops0 checkpoint/sys.c
> --- linux-2.6.git/checkpoint/sys.c~fix-cr-oops0	2008-10-16 15:48:18.000000000 -0700
> +++ linux-2.6.git-dave/checkpoint/sys.c	2008-10-16 15:48:35.000000000 -0700
> @@ -179,6 +179,7 @@ struct cr_ctx *cr_ctx_alloc(pid_t pid, i
>  	ctx = kzalloc(sizeof(*ctx), GFP_KERNEL);
>  	if (!ctx)
>  		return ERR_PTR(-ENOMEM);
> +	INIT_LIST_HEAD(&ctx->pgarr_list);
>  
>  	ctx->file = fget(fd);
>  	if (!ctx->file) {
> diff -L checkpoint/ckpt_mem.h -puN /dev/null /dev/null
> _
> _______________________________________________
> Containers mailing list
> Containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org
> https://lists.linux-foundation.org/mailman/listinfo/containers

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

end of thread, other threads:[~2008-10-17  3:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-10-16 22:51 [PATCH] fix oops in checkpoint/restart error path Dave Hansen
2008-10-17  3:53 ` Oren Laadan

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.