Skip to content

Commit

Permalink
[PATCH] x86_64: access of some bad address
Browse files Browse the repository at this point in the history
x86_64 has a large sparse gate area between VSYSCALL_START and
VSYSCALL_END, not all of it presently backed by pmds.  Alexander Nyberg has
found that in some circumstances gdb may try to ptrace here, and hit
get_user_pages BUG_ON.  It seems odd that gdb should be accessing here, but
it certainly shouldn't crash in this way: relax BUG_ON to -EFAULT.  Fixes
kernel bugzilla #4801.

Signed-off-by: Hugh Dickins <hugh@veritas.com>
Cc: Andi Kleen <ak@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
Hugh Dickins authored and Linus Torvalds committed Aug 2, 2005
1 parent 74f9c9c commit 690dbe1
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions mm/memory.c
Expand Up @@ -910,9 +910,13 @@ int get_user_pages(struct task_struct *tsk, struct mm_struct *mm,
pud = pud_offset(pgd, pg);
BUG_ON(pud_none(*pud));
pmd = pmd_offset(pud, pg);
BUG_ON(pmd_none(*pmd));
if (pmd_none(*pmd))
return i ? : -EFAULT;
pte = pte_offset_map(pmd, pg);
BUG_ON(pte_none(*pte));
if (pte_none(*pte)) {
pte_unmap(pte);
return i ? : -EFAULT;
}
if (pages) {
pages[i] = pte_page(*pte);
get_page(pages[i]);
Expand Down

0 comments on commit 690dbe1

Please sign in to comment.