diff options
author | Oleg Nesterov <oleg@redhat.com> | 2015-03-19 19:14:00 +0300 |
---|---|---|
committer | Pavel Emelyanov <xemul@parallels.com> | 2015-03-30 12:30:33 +0300 |
commit | 4620eab51c56951c88db06b1366796e7108c811e (patch) | |
tree | 6d991fd2926d85ea3526fbb09cdaba4b5a8ddb8f | |
parent | 9f0e6c0e593186aeb2eafac7b57f44be9b5dbc4f (diff) |
restore/x86: restore_gpregs() needs to initialize ->ss as well
Before the recent "x86_64,signal: Fix SS handling for signals delivered
to 64-bit programs" kernel patch, sigreturn paths forgot to restore ->ss
after return from the signal handler.
Now that the kernel was fixed, restore_gpregs() has to initialize ->ss
too, it is no longer ignored.
Note: this is the minimal fix. In the long term we probably should not
dump/restore the segment registers at all. We can use sigcontext filled
by the target kernel and modify the general-purpose regs.
Reported-and-tested-by: Andrey Wagin <avagin@gmail.com>
Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Acked-by: Cyrill Gorcunov <gorcunov@openvz.org>
Acked-by: Andrew Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
-rw-r--r-- | arch/x86/crtools.c | 1 | ||||
-rw-r--r-- | arch/x86/include/asm/restorer.h | 2 |
2 files changed, 2 insertions, 1 deletions
diff --git a/arch/x86/crtools.c b/arch/x86/crtools.c index cbbcb9df0..29e18d686 100644 --- a/arch/x86/crtools.c +++ b/arch/x86/crtools.c @@ -475,6 +475,7 @@ int restore_gpregs(struct rt_sigframe *f, UserX86RegsEntry *r) CPREG2(rip, ip); CPREG2(eflags, flags); CPREG1(cs); + CPREG1(ss); CPREG1(gs); CPREG1(fs); diff --git a/arch/x86/include/asm/restorer.h b/arch/x86/include/asm/restorer.h index 70199fb86..c04fb9426 100644 --- a/arch/x86/include/asm/restorer.h +++ b/arch/x86/include/asm/restorer.h @@ -53,7 +53,7 @@ struct rt_sigcontext { unsigned short cs; unsigned short gs; unsigned short fs; - unsigned short __pad0; + unsigned short ss; unsigned long err; unsigned long trapno; unsigned long oldmask; |