Skip to contentSkip to conversation

fix oops in checkpoint/restart error path

PATCH In review Dave Hansen 2 participants 2 messages Oct 16, 2008 – Oct 17, 2008

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fix oops in checkpoint/restart error path

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.

---

 linux-2.6.git-dave/checkpoint/sys.c |    1 +
 1 file changed, 1 insertion(+)
checkpoint/sys.c renamed from checkpoint/sys.c~fix-cr-oops0 +1 -0
diff -puN checkpoint/sys.c~fix-cr-oops0 checkpoint/sys.c
@@ -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 _

#1 lore raw

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.

Quoted 28 lines · 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.

---

 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

checkpoint/sys.c renamed from checkpoint/sys.c~fix-cr-oops0 +1 -0
@@ -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