Commit de51257a authored by Hugh Dickins's avatar Hugh Dickins Committed by Linus Torvalds
Browse files

mm: fix ia64 crash when gcore reads gate area

Debian's ia64 autobuilders have been seeing kernel freeze or reboot
when running the gdb testsuite (Debian bug 588574): dannf bisected to
2.6.32 62eede62

 "mm: ZERO_PAGE without
PTE_SPECIAL"; and reproduced it with gdb's gcore on a simple target.

I'd missed updating the gate_vma handling in __get_user_pages(): that
happens to use vm_normal_page() (nowadays failing on the zero page),
yet reported success even when it failed to get a page - boom when
access_process_vm() tried to copy that to its intermediate buffer.

Fix this, resisting cleanups: in particular, leave it for now reporting
success when not asked to get any pages - very probably safe to change,
but let's not risk it without testing exposure.

Why did ia64 crash with 16kB pages, but succeed with 64kB pages?
Because setup_gate() pads each 64kB of its gate area with zero pages.
Reported-by: default avatarAndreas Barth <>
Bisected-by: default avatardann frazier <>
Signed-off-by: default avatarHugh Dickins <>
Tested-by: default avatardann frazier <>
Signed-off-by: default avatarLinus Torvalds <>
parent 51c20fcc
......@@ -1394,10 +1394,20 @@ int __get_user_pages(struct task_struct *tsk, struct mm_struct *mm,
return i ? : -EFAULT;
if (pages) {
struct page *page = vm_normal_page(gate_vma, start, *pte);
struct page *page;
page = vm_normal_page(gate_vma, start, *pte);
if (!page) {
if (!(gup_flags & FOLL_DUMP) &&
page = pte_page(*pte);
else {
return i ? : -EFAULT;
pages[i] = page;
if (page)
if (vmas)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment