lkml.org 
[lkml]   [2012]   [Oct]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Subject[PATCH] mm: fix null vm_ops dereference in sys_remap_file_pages
From
Date
This fixes bug introduced in commit "mm: kill vma flag VM_CAN_NONLINEAR",
vma->vm_ops must be checked before checking vm_ops->remap_pages.

Signed-off-by: Konstantin Khlebnikov <khlebnikov@openvz.org>
Reported-by: Sasha Levin <levinsasha928@gmail.com>
---
mm/fremap.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/fremap.c b/mm/fremap.c
index 3899a86..a0aaf0e 100644
--- a/mm/fremap.c
+++ b/mm/fremap.c
@@ -169,7 +169,7 @@ SYSCALL_DEFINE5(remap_file_pages, unsigned long, start, unsigned long, size,
if (vma->vm_private_data && !(vma->vm_flags & VM_NONLINEAR))
goto out;

- if (!vma->vm_ops->remap_pages)
+ if (!vma->vm_ops || !vma->vm_ops->remap_pages)
goto out;

if (start < vma->vm_start || start + size > vma->vm_end)


\
 
 \ /
  Last update: 2012-10-11 12:41    [W:0.053 / U:0.220 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site