Commit 96e14e54 authored by Stuart Menefy's avatar Stuart Menefy Committed by Paul Mundt

sh: vmalloc pgtable sync fix.

This fixes a problem in the code which copies the vmalloc portion of the
kernel's page table into the current user space page table. The addition
of the four level page table code breaks on folded page tables, because
the pud level is always present (although folded). This updates the code
to use the same style of updates for the pud as is used for the pgd
level.
Signed-off-by: default avatarStuart Menefy <stuart.menefy@st.com>
Signed-off-by: default avatarPaul Mundt <lethal@linux-sh.org>
parent 28d6e52c
...@@ -61,7 +61,6 @@ asmlinkage void __kprobes do_page_fault(struct pt_regs *regs, ...@@ -61,7 +61,6 @@ asmlinkage void __kprobes do_page_fault(struct pt_regs *regs,
pgd = get_TTB() + offset; pgd = get_TTB() + offset;
pgd_k = swapper_pg_dir + offset; pgd_k = swapper_pg_dir + offset;
/* This will never happen with the folded page table. */
if (!pgd_present(*pgd)) { if (!pgd_present(*pgd)) {
if (!pgd_present(*pgd_k)) if (!pgd_present(*pgd_k))
goto bad_area_nosemaphore; goto bad_area_nosemaphore;
...@@ -71,9 +70,13 @@ asmlinkage void __kprobes do_page_fault(struct pt_regs *regs, ...@@ -71,9 +70,13 @@ asmlinkage void __kprobes do_page_fault(struct pt_regs *regs,
pud = pud_offset(pgd, address); pud = pud_offset(pgd, address);
pud_k = pud_offset(pgd_k, address); pud_k = pud_offset(pgd_k, address);
if (pud_present(*pud) || !pud_present(*pud_k))
goto bad_area_nosemaphore; if (!pud_present(*pud)) {
set_pud(pud, *pud_k); if (!pud_present(*pud_k))
goto bad_area_nosemaphore;
set_pud(pud, *pud_k);
return;
}
pmd = pmd_offset(pud, address); pmd = pmd_offset(pud, address);
pmd_k = pmd_offset(pud_k, address); pmd_k = pmd_offset(pud_k, address);
......
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