Commit c0ab4540 authored by David S. Miller's avatar David S. Miller

[SPARC64]: Fix lvalue casting in signal32.c

parent d9c0cf1a
......@@ -394,7 +394,7 @@ asmlinkage void do_sigreturn32(struct pt_regs *regs)
asmlinkage void do_rt_sigreturn32(struct pt_regs *regs)
{
struct rt_signal_frame32 __user *sf;
unsigned int psr, pc, npc, fpu_save;
unsigned int psr, pc, npc, fpu_save, u_ss_sp;
mm_segment_t old_fs;
sigset_t set;
compat_sigset_t seta;
......@@ -448,7 +448,8 @@ asmlinkage void do_rt_sigreturn32(struct pt_regs *regs)
if (fpu_save)
err |= restore_fpu_state32(regs, &sf->fpu_state);
err |= copy_from_user(&seta, &sf->mask, sizeof(compat_sigset_t));
err |= __get_user((long)st.ss_sp, &sf->stack.ss_sp);
err |= __get_user(u_ss_sp, &sf->stack.ss_sp);
st.ss_sp = (void *) (long) u_ss_sp;
err |= __get_user(st.ss_flags, &sf->stack.ss_flags);
err |= __get_user(st.ss_size, &sf->stack.ss_size);
if (err)
......@@ -977,7 +978,7 @@ asmlinkage int svr4_setcontext(svr4_ucontext_t __user *c, struct pt_regs *regs)
{
svr4_gregset_t __user *gr;
mm_segment_t old_fs;
u32 pc, npc, psr;
u32 pc, npc, psr, u_ss_sp;
sigset_t set;
svr4_sigset_t setv;
int i, err;
......@@ -1017,7 +1018,8 @@ asmlinkage int svr4_setcontext(svr4_ucontext_t __user *c, struct pt_regs *regs)
if (_NSIG_WORDS >= 2)
set.sig[1] = setv.sigbits[2] | (((long)setv.sigbits[3]) << 32);
err |= __get_user((long)st.ss_sp, &c->stack.sp);
err |= __get_user(u_ss_sp, &c->stack.sp);
st.ss_sp = (void *) (long) u_ss_sp;
err |= __get_user(st.ss_flags, &c->stack.flags);
err |= __get_user(st.ss_size, &c->stack.size);
if (err)
......@@ -1310,9 +1312,9 @@ asmlinkage int do_sys32_sigstack(u32 u_ssptr, u32 u_ossptr, unsigned long sp)
/* Now see if we want to update the new state. */
if (ssptr) {
void *ss_sp;
u32 ss_sp;
if (get_user((long)ss_sp, &ssptr->the_stack))
if (get_user(ss_sp, &ssptr->the_stack))
goto out;
/* If the current stack was set with sigaltstack, don't
......@@ -1338,13 +1340,15 @@ asmlinkage int do_sys32_sigstack(u32 u_ssptr, u32 u_ossptr, unsigned long sp)
asmlinkage int do_sys32_sigaltstack(u32 ussa, u32 uossa, unsigned long sp)
{
stack_t uss, uoss;
u32 u_ss_sp = 0;
int ret;
mm_segment_t old_fs;
if (ussa && (get_user((long)uss.ss_sp, &((stack_t32 __user *)(long)ussa)->ss_sp) ||
if (ussa && (get_user(u_ss_sp, &((stack_t32 __user *)(long)ussa)->ss_sp) ||
__get_user(uss.ss_flags, &((stack_t32 __user *)(long)ussa)->ss_flags) ||
__get_user(uss.ss_size, &((stack_t32 __user *)(long)ussa)->ss_size)))
return -EFAULT;
uss.ss_sp = (void *) (long) u_ss_sp;
old_fs = get_fs();
set_fs(KERNEL_DS);
ret = do_sigaltstack(ussa ? &uss : NULL, uossa ? &uoss : NULL, sp);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment