Commit 07dcf0db authored by Oleg Nesterov's avatar Oleg Nesterov Committed by Pavel Emelyanov

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: 's avatarAndrey Wagin <avagin@gmail.com>
Signed-off-by: 's avatarOleg Nesterov <oleg@redhat.com>
Acked-by: 's avatarCyrill Gorcunov <gorcunov@openvz.org>
Acked-by: 's avatarAndrew Vagin <avagin@openvz.org>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent 044011e5
......@@ -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);
......
......@@ -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;
......
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