[PATCH] UML - correctly restore extramask in sigreturn

From: Jeff Dike
Date: Fri Dec 03 2004 - 15:27:42 EST


From: Bodo Stroesser <bstroesser@xxxxxxxxxxxxxxxxxxx>

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: Bodo Stroesser <bstroesser@xxxxxxxxxxxxxxxxxxx>
Signed-off-by: Jeff Dike <jdike@xxxxxxxxxxx>

Index: 2.6.9/arch/um/sys-i386/signal.c
===================================================================
--- 2.6.9.orig/arch/um/sys-i386/signal.c 2004-12-01 14:03:31.000000000 -0500
+++ 2.6.9/arch/um/sys-i386/signal.c 2004-12-01 14:10:26.000000000 -0500
@@ -307,11 +307,12 @@
struct sigframe __user *frame = (struct sigframe *)(sp - 8);
sigset_t set;
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);

- if(copy_from_user(&set.sig[0], mask, sizeof(&set.sig[0])) ||
- copy_from_user(&set.sig[1], mask, sig_size))
+ if(copy_from_user(&set.sig[0], oldmask, sizeof(&set.sig[0])) ||
+ copy_from_user(&set.sig[1], extramask, sig_size))
goto segfault;

sigdelsetmask(&set, ~_BLOCKABLE);

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/