OpenVZ Forum


Home » Mailing lists » Devel » [PATCH] proc: check vma->vm_file before dereferencing
[PATCH] proc: check vma->vm_file before dereferencing [message #48349] Mon, 15 October 2012 15:30 Go to previous message
Stanislav Kinsbursky is currently offline  Stanislav Kinsbursky
Messages: 683
Registered: October 2011
Senior Member
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);
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: [RFC] Posix timers improvements, requied for CRIU project
Next Topic: [RFC PATCH] posix timers: allocate timer id per task
Goto Forum:
  


Current Time: Mon Nov 18 22:44:55 GMT 2024

Total time taken to generate the page: 0.02897 seconds