Skip to contentSkip to conversation

FRV: Fix error handling in is_user_addr_valid()

PATCH In review David Howells 1 participant 2 messages Nov 21, 2008 ptrace support

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 FRV: Fix error handling in is_user_addr_valid()

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.

---

 arch/frv/kernel/ptrace.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
arch/frv/kernel/ptrace.c +1 -1
index e9af8de..5e7d401 100644
@@ -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;
#1 lore raw
Quoted 3 lines · David Howells

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.

Ignore this patch, please. It's dependent on another patch you don't have yet.

David