Re: [regression] x86/signal/64: Fix SS handling for signals delivered to 64-bit programs breaks dosemu

From: Cyrill Gorcunov
Date: Fri Aug 14 2015 - 03:22:16 EST

On Thu, Aug 13, 2015 at 01:09:47PM -0700, Linus Torvalds wrote:
> On Thu, Aug 13, 2015 at 1:08 PM, Cyrill Gorcunov <gorcunov@xxxxxxxxx> wrote:
> >
> > If only I'm not missin something obvious this should not hurt us.
> > But I gonna build test kernel and check to be sure tomorrow, ok?

Managed to test it. And criu works fine with the revert as expected.
Actually it's because of commit c6f2062935c8 Oleg made us a patch:

| commit 07dcf0dbb6ff97c255bc6b06569255a9479bccdd
| Author: Oleg Nesterov <oleg@xxxxxxxxxx>
| Date: Thu Mar 19 19:14:00 2015 +0300
| 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.
| ...
| +++ 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;

IOW we've been not setting up __pad0 which became ss
inside the kernel (in result we've been passing 0 here,
which caused the problem).

fwiw, we declare that new criu versions may require new
kernels to work but never promised that new criu gonna
be compatible with old kernels. That said if something
get changed inside sigcontext structure in future
we may update criu code as well.
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at
Please read the FAQ at