Commit 03db5fde authored by Jeff Dike's avatar Jeff Dike Committed by Linus Torvalds

[PATCH] uml: correctly restore extramask in sigreturn

From: Bodo Stroesser <bstroesser@fujitsu-siemens.com>

Restoring of current->blocked in sys_sigreturn is wrong.
The first (long ) of the mask correctly is fetched from sc->oldmask.
The further longs again come from there, but correctly should be
taken from frame->extramask.
Signed-off-by: default avatarBodo Stroesser <bstroesser@fujitsu-siemens.com>
Signed-off-by: default avatarJeff Dike <jdike@addtoit.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 993ce028
...@@ -307,11 +307,12 @@ long sys_sigreturn(struct pt_regs regs) ...@@ -307,11 +307,12 @@ long sys_sigreturn(struct pt_regs regs)
struct sigframe __user *frame = (struct sigframe *)(sp - 8); struct sigframe __user *frame = (struct sigframe *)(sp - 8);
sigset_t set; sigset_t set;
struct sigcontext __user *sc = &frame->sc; struct sigcontext __user *sc = &frame->sc;
unsigned long __user *mask = &sc->oldmask; unsigned long __user *oldmask = &sc->oldmask;
unsigned long __user *extramask = frame->extramask;
int sig_size = (_NSIG_WORDS - 1) * sizeof(unsigned long); int sig_size = (_NSIG_WORDS - 1) * sizeof(unsigned long);
if(copy_from_user(&set.sig[0], mask, sizeof(&set.sig[0])) || if(copy_from_user(&set.sig[0], oldmask, sizeof(&set.sig[0])) ||
copy_from_user(&set.sig[1], mask, sig_size)) copy_from_user(&set.sig[1], extramask, sig_size))
goto segfault; goto segfault;
sigdelsetmask(&set, ~_BLOCKABLE); sigdelsetmask(&set, ~_BLOCKABLE);
......
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