Commit 58989e77 authored by Alexander Viro's avatar Alexander Viro Committed by Linus Torvalds

[PATCH] sparse: rt_sigsuspend/sigaltstack sanitized

rt_sigsuspend() and sigaltstack() prototype changed; instead of
playing games with casts of argument address to struct pt_regs * and
digging through it, we declare them as

	int <fn>(struct pt_regs regs)

instead.
parent 56177d2a
...@@ -56,16 +56,15 @@ sys_sigsuspend(int history0, int history1, old_sigset_t mask) ...@@ -56,16 +56,15 @@ sys_sigsuspend(int history0, int history1, old_sigset_t mask)
} }
asmlinkage int asmlinkage int
sys_rt_sigsuspend(sigset_t __user *unewset, size_t sigsetsize) sys_rt_sigsuspend(struct pt_regs regs)
{ {
struct pt_regs * regs = (struct pt_regs *) &unewset;
sigset_t saveset, newset; sigset_t saveset, newset;
/* XXX: Don't preclude handling different sized sigset_t's. */ /* XXX: Don't preclude handling different sized sigset_t's. */
if (sigsetsize != sizeof(sigset_t)) if (regs.ecx != sizeof(sigset_t))
return -EINVAL; return -EINVAL;
if (copy_from_user(&newset, unewset, sizeof(newset))) if (copy_from_user(&newset, (sigset_t __user *)regs.ebx, sizeof(newset)))
return -EFAULT; return -EFAULT;
sigdelsetmask(&newset, ~_BLOCKABLE); sigdelsetmask(&newset, ~_BLOCKABLE);
...@@ -75,11 +74,11 @@ sys_rt_sigsuspend(sigset_t __user *unewset, size_t sigsetsize) ...@@ -75,11 +74,11 @@ sys_rt_sigsuspend(sigset_t __user *unewset, size_t sigsetsize)
recalc_sigpending(); recalc_sigpending();
spin_unlock_irq(&current->sighand->siglock); spin_unlock_irq(&current->sighand->siglock);
regs->eax = -EINTR; regs.eax = -EINTR;
while (1) { while (1) {
current->state = TASK_INTERRUPTIBLE; current->state = TASK_INTERRUPTIBLE;
schedule(); schedule();
if (do_signal(regs, &saveset)) if (do_signal(&regs, &saveset))
return -EINTR; return -EINTR;
} }
} }
...@@ -117,10 +116,11 @@ sys_sigaction(int sig, const struct old_sigaction __user *act, ...@@ -117,10 +116,11 @@ sys_sigaction(int sig, const struct old_sigaction __user *act,
} }
asmlinkage int asmlinkage int
sys_sigaltstack(const stack_t __user *uss, stack_t __user *uoss) sys_sigaltstack(struct pt_regs regs)
{ {
struct pt_regs *regs = (struct pt_regs *) &uss; const stack_t __user *uss = (const stack_t __user *)regs.ebx;
return do_sigaltstack(uss, uoss, regs->esp); stack_t __user *uoss = (stack_t __user *)regs.ecx;
return do_sigaltstack(uss, uoss, regs.esp);
} }
......
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