From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756350AbbCRRup (ORCPT ); Wed, 18 Mar 2015 13:50:45 -0400 Received: from mx1.redhat.com ([209.132.183.28]:60876 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754563AbbCRRuk (ORCPT ); Wed, 18 Mar 2015 13:50:40 -0400 Date: Wed, 18 Mar 2015 18:48:43 +0100 From: Oleg Nesterov To: Andrey Wagin Cc: Andy Lutomirski , Ingo Molnar , Andi Kleen , "H. Peter Anvin" , Al Viro , X86 ML , LKML , Linus Torvalds , Borislav Petkov , Andy Lutomirski , Cyrill Gorcunov , Pavel Emelyanov Subject: Re: [PATCH v3 1/2] x86_64,signal: Fix SS handling for signals delivered to 64-bit programs Message-ID: <20150318174843.GA32238@redhat.com> References: <405594361340a2ec32f8e2b115c142df0e180d8e.1426193719.git.luto@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.18 (2008-05-17) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 03/18, Andrey Wagin wrote: > > This commit breaks CRIU. I don't have any details yet. I'm going to > investigate this issue and provide more details tomorrow. > > [root@avagin-fc19-cr criu]# setsid sleep 1000 & > [1] 1225 > [root@avagin-fc19-cr criu]# ps -C sleep > PID TTY TIME CMD > 1226 ? 00:00:00 sleep > [root@avagin-fc19-cr criu]# ./criu dump -t 1226 -D dump --shell-job > [root@avagin-fc19-cr criu]# ./criu restore -D dump --shell-job > Error (parasite-syscall.c:923): Task is in unexpected state: b7f (SIGSEGV) This is funny. Because currenty I am looking into criu sources for quite different reason (and I HATE this reason ;) Shot in a dark afer a quick grep: restore_gpregs() should initialize ->ss? perhaps something like below... obviously uncompiled/untested. And my grep can't find the definition of UserX86RegsEntry in crtools... Perhaps the change below needs CPREG1(ss, anothername). Seriously, where is UserX86RegsEntry? Oleg. --- 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 70199fb..c04fb94 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;