From: Stanislav Kinsbursky <skinsbursky@parallels.com>
To: akpm@linux-foundation.org, viro@zeniv.linux.org.uk
Cc: linux-kernel@vger.kernel.org, criu@openvz.org,
ebiederm@xmission.com, rientjes@google.com, gorcunov@openvz.org,
devel@openvz.org
Subject: [PATCH] proc: check vma->vm_file before dereferencing
Date: Mon, 15 Oct 2012 19:30:03 +0400 [thread overview]
Message-ID: <20121015152957.24859.7960.stgit@localhost.localdomain> (raw)
It can be equal to NULL.
Signed-off-by: Stanislav Kinsbursky <skinsbursky@parallels.com>
---
fs/proc/base.c | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/fs/proc/base.c b/fs/proc/base.c
index 144a967..74fc562 100644
--- a/fs/proc/base.c
+++ b/fs/proc/base.c
@@ -1770,8 +1770,9 @@ static struct dentry *proc_map_files_lookup(struct inode *dir,
if (!vma)
goto out_no_vma;
- result = proc_map_files_instantiate(dir, dentry, task,
- (void *)(unsigned long)vma->vm_file->f_mode);
+ if (vma->vm_file)
+ result = proc_map_files_instantiate(dir, dentry, task,
+ (void *)(unsigned long)vma->vm_file->f_mode);
out_no_vma:
up_read(&mm->mmap_sem);
next reply other threads:[~2012-10-15 15:28 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-10-15 15:30 Stanislav Kinsbursky [this message]
2012-10-15 15:30 ` Cyrill Gorcunov
2012-10-15 21:40 ` Andrew Morton
2012-10-15 21:52 ` Cyrill Gorcunov
2012-10-15 22:04 ` Andrew Morton
2012-10-16 7:26 ` Stanislav Kinsbursky
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=20121015152957.24859.7960.stgit@localhost.localdomain \
--to=skinsbursky@parallels.com \
--cc=akpm@linux-foundation.org \
--cc=criu@openvz.org \
--cc=devel@openvz.org \
--cc=ebiederm@xmission.com \
--cc=gorcunov@openvz.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rientjes@google.com \
--cc=viro@zeniv.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
Powered by JetHome