Skip to content

Commit

Permalink
[PARISC] fix user-triggerable panic on parisc
Browse files Browse the repository at this point in the history
int sys32_rt_sigprocmask(int how, compat_sigset_t __user *set, compat_sigset_t __user *oset,
                                    unsigned int sigsetsize)
{
        sigset_t old_set, new_set;
        int ret;

        if (set && get_sigset32(set, &new_set, sigsetsize))

...
static int
get_sigset32(compat_sigset_t __user *up, sigset_t *set, size_t sz)
{
        compat_sigset_t s;
        int r;

        if (sz != sizeof *set) panic("put_sigset32()");

In other words, rt_sigprocmask(69, (void *)69, 69) done by 32bit process
will promptly panic the box.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Cc: <stable@vger.kernel.org>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
  • Loading branch information
Al Viro authored and James Bottomley committed Nov 22, 2012
1 parent 949a05d commit 441a179
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions arch/parisc/kernel/signal32.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ put_sigset32(compat_sigset_t __user *up, sigset_t *set, size_t sz)
{
compat_sigset_t s;

if (sz != sizeof *set) panic("put_sigset32()");
if (sz != sizeof *set)
return -EINVAL;
sigset_64to32(&s, set);

return copy_to_user(up, &s, sizeof s);
Expand All @@ -77,7 +78,8 @@ get_sigset32(compat_sigset_t __user *up, sigset_t *set, size_t sz)
compat_sigset_t s;
int r;

if (sz != sizeof *set) panic("put_sigset32()");
if (sz != sizeof *set)
return -EINVAL;

if ((r = copy_from_user(&s, up, sz)) == 0) {
sigset_32to64(set, &s);
Expand Down

0 comments on commit 441a179

Please sign in to comment.