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_64.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_64.c')
-rw-r--r-- | arch/sparc/kernel/sigutil_64.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/arch/sparc/kernel/sigutil_64.c b/arch/sparc/kernel/sigutil_64.c index 387834a9c56a..36aadcbeac69 100644 --- a/arch/sparc/kernel/sigutil_64.c +++ b/arch/sparc/kernel/sigutil_64.c @@ -37,7 +37,10 @@ int restore_fpu_state(struct pt_regs *regs, __siginfo_fpu_t __user *fpu) unsigned long fprs; int err; - err = __get_user(fprs, &fpu->si_fprs); + if (((unsigned long) fpu) & 7) + return -EFAULT; + + err = get_user(fprs, &fpu->si_fprs); fprs_write(0); regs->tstate &= ~TSTATE_PEF; if (fprs & FPRS_DL) @@ -72,7 +75,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) & 7) + return -EFAULT; + + get_user(wsaved, &rp->wsaved); if (wsaved > NSWINS) return -EFAULT; |