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

[PATCH] m32r: fix ace_handler to pass full 32-bit address

Don't mask the lower 12-bit of the page fault address.

In the current m32r kernel implementation, we use an access exception
to detect page faults.

This patch fixes ace_handler (access exception handler) for m32r. In order to
check userspace address in do_page_fault, we have to pass full 32-bit address
to do_page_fault.

Signed-off-by: Hirokazu Takata <takata@linux-m32r.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

authored by

Hirokazu Takata and committed by
Linus Torvalds
6b8bd3f4 f894cb5c

+2 -4
-2
arch/m32r/kernel/entry.S
··· 596 596 beqz r1, inst 597 597 oprand: 598 598 ld r2, @(low(MDEVA_offset),r2) ; set address 599 - srli r2, #12 600 - slli r2, #12 601 599 srli r1, #1 602 600 bra 1f 603 601 inst:
+2 -2
arch/m32r/mm/fault.c
··· 173 173 goto good_area; 174 174 if (!(vma->vm_flags & VM_GROWSDOWN)) 175 175 goto bad_area; 176 - #if 0 176 + 177 177 if (error_code & ACE_USERMODE) { 178 178 /* 179 179 * accessing the stack below "spu" is always a bug. ··· 184 184 if (address + 4 < regs->spu) 185 185 goto bad_area; 186 186 } 187 - #endif 187 + 188 188 if (expand_stack(vma, address)) 189 189 goto bad_area; 190 190 /*