aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sparc/mm/fault_32.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/sparc/mm/fault_32.c')
-rw-r--r--arch/sparc/mm/fault_32.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/arch/sparc/mm/fault_32.c b/arch/sparc/mm/fault_32.c
index bd8601601afa..5b836f5aea90 100644
--- a/arch/sparc/mm/fault_32.c
+++ b/arch/sparc/mm/fault_32.c
@@ -539,6 +539,12 @@ do_sigbus:
539 __do_fault_siginfo(BUS_ADRERR, SIGBUS, tsk->thread.kregs, address); 539 __do_fault_siginfo(BUS_ADRERR, SIGBUS, tsk->thread.kregs, address);
540} 540}
541 541
542static void check_stack_aligned(unsigned long sp)
543{
544 if (sp & 0x7UL)
545 force_sig(SIGILL, current);
546}
547
542void window_overflow_fault(void) 548void window_overflow_fault(void)
543{ 549{
544 unsigned long sp; 550 unsigned long sp;
@@ -547,6 +553,8 @@ void window_overflow_fault(void)
547 if(((sp + 0x38) & PAGE_MASK) != (sp & PAGE_MASK)) 553 if(((sp + 0x38) & PAGE_MASK) != (sp & PAGE_MASK))
548 force_user_fault(sp + 0x38, 1); 554 force_user_fault(sp + 0x38, 1);
549 force_user_fault(sp, 1); 555 force_user_fault(sp, 1);
556
557 check_stack_aligned(sp);
550} 558}
551 559
552void window_underflow_fault(unsigned long sp) 560void window_underflow_fault(unsigned long sp)
@@ -554,6 +562,8 @@ void window_underflow_fault(unsigned long sp)
554 if(((sp + 0x38) & PAGE_MASK) != (sp & PAGE_MASK)) 562 if(((sp + 0x38) & PAGE_MASK) != (sp & PAGE_MASK))
555 force_user_fault(sp + 0x38, 0); 563 force_user_fault(sp + 0x38, 0);
556 force_user_fault(sp, 0); 564 force_user_fault(sp, 0);
565
566 check_stack_aligned(sp);
557} 567}
558 568
559void window_ret_fault(struct pt_regs *regs) 569void window_ret_fault(struct pt_regs *regs)
@@ -564,4 +574,6 @@ void window_ret_fault(struct pt_regs *regs)
564 if(((sp + 0x38) & PAGE_MASK) != (sp & PAGE_MASK)) 574 if(((sp + 0x38) & PAGE_MASK) != (sp & PAGE_MASK))
565 force_user_fault(sp + 0x38, 0); 575 force_user_fault(sp + 0x38, 0);
566 force_user_fault(sp, 0); 576 force_user_fault(sp, 0);
577
578 check_stack_aligned(sp);
567} 579}