diff options
author | David S. Miller <davem@davemloft.net> | 2016-05-29 06:21:31 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-05-29 20:24:05 +0200 |
commit | d11c2a0de2824395656cf8ed15811580c9dd38aa (patch) | |
tree | 1a2024f157752d35d4ac42807c6ca1da7b52b58c /arch/sparc/kernel/sigutil_32.c | |
parent | sparc64: Take ctx_alloc_lock properly in hugetlb_setup(). (diff) | |
download | linux-d11c2a0de2824395656cf8ed15811580c9dd38aa.tar.xz linux-d11c2a0de2824395656cf8ed15811580c9dd38aa.zip |
sparc: Harden signal return frame checks.
All signal frames must be at least 16-byte aligned, because that is
the alignment we explicitly create when we build signal return stack
frames.
All stack pointers must be at least 8-byte aligned.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/sparc/kernel/sigutil_32.c')
-rw-r--r-- | arch/sparc/kernel/sigutil_32.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/arch/sparc/kernel/sigutil_32.c b/arch/sparc/kernel/sigutil_32.c index 0f6eebe71e6c..e5fe8cef9a69 100644 --- a/arch/sparc/kernel/sigutil_32.c +++ b/arch/sparc/kernel/sigutil_32.c @@ -48,6 +48,10 @@ int save_fpu_state(struct pt_regs *regs, __siginfo_fpu_t __user *fpu) int restore_fpu_state(struct pt_regs *regs, __siginfo_fpu_t __user *fpu) { int err; + + if (((unsigned long) fpu) & 3) + return -EFAULT; + #ifdef CONFIG_SMP if (test_tsk_thread_flag(current, TIF_USEDFPU)) regs->psr &= ~PSR_EF; @@ -97,7 +101,10 @@ int restore_rwin_state(__siginfo_rwin_t __user *rp) struct thread_info *t = current_thread_info(); int i, wsaved, err; - __get_user(wsaved, &rp->wsaved); + if (((unsigned long) rp) & 3) + return -EFAULT; + + get_user(wsaved, &rp->wsaved); if (wsaved > NSWINS) return -EFAULT; |