lkml.org 
[lkml]   [2008]   [Nov]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] FRV: Fix error handling in is_user_addr_valid()
Date
Fix error handling in is_user_addr_valid() in NOMMU mode to check whether
find_vma() actually worked or not. This checks whether ptrace() is allowed to
access an address.

Signed-off-by: David Howells <dhowells@redhat.com>
---

arch/frv/kernel/ptrace.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)


diff --git a/arch/frv/kernel/ptrace.c b/arch/frv/kernel/ptrace.c
index e9af8de..5e7d401 100644
--- a/arch/frv/kernel/ptrace.c
+++ b/arch/frv/kernel/ptrace.c
@@ -83,7 +83,7 @@ static inline int is_user_addr_valid(struct task_struct *child,
struct vm_area_struct *vma;

vma = find_vma(child->mm, start);
- if (start >= vma->vm_start && start + len <= vma->vm_end)
+ if (vma && start >= vma->vm_start && start + len <= vma->vm_end)
return 0;

return -EIO;


\
 
 \ /
  Last update: 2008-11-21 17:11    [W:0.936 / U:0.260 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site