diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2016-05-31 22:20:56 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2016-05-31 22:20:56 -0700 |
commit | 58c1f9950ffc6acbb907051b0a4e56aaf4baa9ce (patch) | |
tree | a24d739eead7f29c345c6cd72f32a8309ea473da /arch/sparc/kernel/sigutil_32.c | |
parent | 367d3fd50566a313946fa9c5b2116a81bf3807e4 (diff) | |
parent | 7cafc0b8bf130f038b0ec2dcdd6a9de6dc59b65a (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc
Pull sparc fixes from David Miller:
"sparc64 mmu context allocation and trap return bug fixes"
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc:
sparc64: Fix return from trap window fill crashes.
sparc: Harden signal return frame checks.
sparc64: Take ctx_alloc_lock properly in hugetlb_setup().
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; |