Skip to content

Commit 6b8bd3f

Browse files
htakataLinus Torvalds
authored andcommitted
[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>
1 parent f894cb5 commit 6b8bd3f

2 files changed

Lines changed: 2 additions & 4 deletions

File tree

‎arch/m32r/kernel/entry.S‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -596,8 +596,6 @@ ENTRY(ace_handler)
596596
beqz r1, inst
597597
oprand:
598598
ld r2, @(low(MDEVA_offset),r2) ; set address
599-
srli r2, #12
600-
slli r2, #12
601599
srli r1, #1
602600
bra 1f
603601
inst:

‎arch/m32r/mm/fault.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ asmlinkage void do_page_fault(struct pt_regs *regs, unsigned long error_code,
173173
goto good_area;
174174
if (!(vma->vm_flags & VM_GROWSDOWN))
175175
goto bad_area;
176-
#if 0
176+
177177
if (error_code & ACE_USERMODE) {
178178
/*
179179
* accessing the stack below "spu" is always a bug.
@@ -184,7 +184,7 @@ asmlinkage void do_page_fault(struct pt_regs *regs, unsigned long error_code,
184184
if (address + 4 < regs->spu)
185185
goto bad_area;
186186
}
187-
#endif
187+
188188
if (expand_stack(vma, address))
189189
goto bad_area;
190190
/*

0 commit comments

Comments
 (0)