All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH ckpt-v15] allocate checkpoint headers with kzalloc
@ 2009-05-13 15:55 Nathan Lynch
       [not found] ` <m3zldhxai8.fsf-e+AXbWqSrlAAvxtiuMwx3w@public.gmane.org>
  0 siblings, 1 reply; 4+ messages in thread
From: Nathan Lynch @ 2009-05-13 15:55 UTC (permalink / raw)
  To: Linux Containers

In a checkpoint image I noticed a lot of 0x6b (POISON_FREE) bytes
corresponding to checkpoint_restart_block -- this indicates that we
would write uninitialized kernel memory to the image in cases where
slab allocator debugging is not enabled[1].

Use kzalloc in ckpt_hdr_get.

[1] slub's debug mode apparently initializes allocated buffers to
POISON_FREE instead of POISON_INUSE, which confused me for a bit.
Maybe I don't understand the intended meanings of the poison values.

Signed-off-by: Nathan Lynch <ntl-e+AXbWqSrlAAvxtiuMwx3w@public.gmane.org>
---
 checkpoint/sys.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/checkpoint/sys.c b/checkpoint/sys.c
index 255ebc1..34a226c 100644
--- a/checkpoint/sys.c
+++ b/checkpoint/sys.c
@@ -117,7 +117,7 @@ int ckpt_kread(struct ckpt_ctx *ctx, void *addr, int count)
  */
 void *ckpt_hdr_get(struct ckpt_ctx *ctx, int len)
 {
-	return kmalloc(len, GFP_KERNEL);
+	return kzalloc(len, GFP_KERNEL);
 }
 
 /**
-- 
1.6.0.6

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

end of thread, other threads:[~2009-05-14 16:32 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-05-13 15:55 [PATCH ckpt-v15] allocate checkpoint headers with kzalloc Nathan Lynch
     [not found] ` <m3zldhxai8.fsf-e+AXbWqSrlAAvxtiuMwx3w@public.gmane.org>
2009-05-13 17:02   ` Serge E. Hallyn
     [not found]     ` <20090513170257.GA18675-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2009-05-13 17:25       ` Nathan Lynch
2009-05-14 16:32   ` 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.