Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

[PATCH] x86_64: access of some bad address

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>

authored by

Hugh Dickins and committed by
Linus Torvalds
690dbe1c 74f9c9c2

+6 -2
+6 -2
mm/memory.c
··· 910 910 pud = pud_offset(pgd, pg); 911 911 BUG_ON(pud_none(*pud)); 912 912 pmd = pmd_offset(pud, pg); 913 - BUG_ON(pmd_none(*pmd)); 913 + if (pmd_none(*pmd)) 914 + return i ? : -EFAULT; 914 915 pte = pte_offset_map(pmd, pg); 915 - BUG_ON(pte_none(*pte)); 916 + if (pte_none(*pte)) { 917 + pte_unmap(pte); 918 + return i ? : -EFAULT; 919 + } 916 920 if (pages) { 917 921 pages[i] = pte_page(*pte); 918 922 get_page(pages[i]);