All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] seqfile: fix uninitialized memory allocation in mounts_open()
@ 2007-08-15  8:56 ` Fengguang Wu
  2007-08-15  9:04   ` Alexey Dobriyan
  0 siblings, 1 reply; 5+ messages in thread
From: Fengguang Wu @ 2007-08-15  8:56 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-kernel, Al Viro

proc_mounts.m.buf is not explicitly zeroed at allocation time, which
may later confuse the seqfile code and triggle an kfree(m->buf).

Signed-off-by: Fengguang Wu <wfg@mail.ustc.edu.cn>
---

--- linux.orig/fs/proc/base.c
+++ linux/fs/proc/base.c
@@ -380,7 +380,7 @@ static int mounts_open(struct inode *ino
 
 	if (ns) {
 		ret = -ENOMEM;
-		p = kmalloc(sizeof(struct proc_mounts), GFP_KERNEL);
+		p = kzalloc(sizeof(struct proc_mounts), GFP_KERNEL);
 		if (p) {
 			file->private_data = &p->m;
 			ret = seq_open(file, &mounts_op);


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

end of thread, other threads:[~2007-08-15  9:09 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-08-15  8:56 [PATCH] seqfile: fix uninitialized memory allocation in mounts_open() Fengguang Wu
2007-08-15  8:56 ` Fengguang Wu
2007-08-15  9:04   ` Alexey Dobriyan
2007-08-15  9:08     ` Fengguang Wu
2007-08-15  9:08       ` Fengguang Wu
2007-08-15  9:01 ` Fengguang Wu
2007-08-15  9:01   ` Fengguang Wu
2007-08-15  9:05 ` [PATCH] seqfile: merge duplite code to seq_open_private() Fengguang Wu
2007-08-15  9:05   ` Fengguang Wu

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.