From: Fengguang Wu <wfg@mail.ustc.edu.cn>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: linux-kernel <linux-kernel@vger.kernel.org>,
Al Viro <viro@ftp.linux.org.uk>
Subject: [PATCH] seqfile: fix uninitialized memory allocation in mounts_open()
Date: Wed, 15 Aug 2007 16:56:37 +0800 [thread overview]
Message-ID: <387168197.02674@ustc.edu.cn> (raw)
Message-ID: <20070815085637.GA19293@mail.ustc.edu.cn> (raw)
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);
next reply other threads:[~2007-08-15 8:56 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20070815085637.GA19293@mail.ustc.edu.cn>
2007-08-15 8:56 ` Fengguang Wu [this message]
2007-08-15 9:04 ` [PATCH] seqfile: fix uninitialized memory allocation in mounts_open() Alexey Dobriyan
[not found] ` <20070815090855.GB19293@mail.ustc.edu.cn>
2007-08-15 9:08 ` Fengguang Wu
[not found] ` <20070815090116.GA19893@mail.ustc.edu.cn>
2007-08-15 9:01 ` Fengguang Wu
[not found] ` <20070815090549.GB19893@mail.ustc.edu.cn>
2007-08-15 9:05 ` [PATCH] seqfile: merge duplite code to seq_open_private() Fengguang Wu
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=387168197.02674@ustc.edu.cn \
--to=wfg@mail.ustc.edu.cn \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=viro@ftp.linux.org.uk \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox