From: Dave Hansen <dave-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>
To: containers
<containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org>
Cc: Dave Hansen <dave-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>
Subject: [PATCH] fix oops in checkpoint/restart error path
Date: Thu, 16 Oct 2008 15:51:28 -0700 [thread overview]
Message-ID: <20081016225128.43636F12@kernel> (raw)
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
_
next reply other threads:[~2008-10-16 22:51 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-10-16 22:51 Dave Hansen [this message]
2008-10-17 3:53 ` [PATCH] fix oops in checkpoint/restart error path Oren Laadan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20081016225128.43636F12@kernel \
--to=dave-23vcf4htsmix0ybbhkvfkdbpr1lh4cv8@public.gmane.org \
--cc=containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.