lkml.org 
[lkml]   [2004]   [Dec]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [PATCH] include/asm-x86_64/pgtable.h pgd_offset_gate()
Please ignore my previous posting.

It turns out that there is already a fix for this problem by Andi Kleen:

# ChangeSet
# 2004/11/15 19:53:40-08:00 ak@suse.de
# [PATCH] x86-64: Fix get_user_pages access to vsyscall page
#
# The current kernel oopses on x86-64 when gdb steps into the vsyscall
page.
# This patch fixes it.
#
# I also removed the bogus NULL checks of *_offset and replaced them with
# proper _none checks. I made them BUGs because vsyscall pages should be
# always mapped.
#
# Signed-off-by: Andi Kleen <ak@suse.de>
# Signed-off-by: Andrew Morton <akpm@osdl.org>
# Signed-off-by: Linus Torvalds <torvalds@osdl.org>
#
# mm/memory.c
# 2004/11/15 19:29:06-08:00 ak@suse.de +7 -11
# x86-64: Fix get_user_pages access to vsyscall page
#
diff -Nru a/mm/memory.c b/mm/memory.c
--- a/mm/memory.c 2004-12-14 05:20:10 -08:00
+++ b/mm/memory.c 2004-12-14 05:20:10 -08:00
@@ -739,19 +739,15 @@
pte_t *pte;
if (write) /* user gate pages are read-only */
return i ? : -EFAULT;
- pgd = pgd_offset_gate(mm, pg);
- if (!pgd)
- return i ? : -EFAULT;
+ if (pg > TASK_SIZE)
+ pgd = pgd_offset_k(pg);
+ else
+ pgd = pgd_offset_gate(mm, pg);
+ BUG_ON(pgd_none(*pgd));
pmd = pmd_offset(pgd, pg);
- if (!pmd)
- return i ? : -EFAULT;
+ BUG_ON(pmd_none(*pmd));
pte = pte_offset_map(pmd, pg);
- if (!pte)
- return i ? : -EFAULT;
- if (!pte_present(*pte)) {
- pte_unmap(pte);
- return i ? : -EFAULT;
- }
+ BUG_ON(pte_none(*pte));
if (pages) {
pages[i] = pte_page(*pte);
get_page(pages[i]);
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 14:08    [W:3.924 / U:0.048 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site