From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752484AbbHNHWL (ORCPT ); Fri, 14 Aug 2015 03:22:11 -0400 Received: from mail-lb0-f169.google.com ([209.85.217.169]:34970 "EHLO mail-lb0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751255AbbHNHWJ (ORCPT ); Fri, 14 Aug 2015 03:22:09 -0400 Date: Fri, 14 Aug 2015 10:22:05 +0300 From: Cyrill Gorcunov To: Linus Torvalds , Andy Lutomirski Cc: Pavel Emelyanov , Stas Sergeev , Linux kernel Subject: Re: [regression] x86/signal/64: Fix SS handling for signals delivered to 64-bit programs breaks dosemu Message-ID: <20150814072205.GA2129@uranus> References: <55CA90B4.2010205@list.ru> <55CCD921.4040301@list.ru> <20150813200823.GS2059@uranus> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Aug 13, 2015 at 01:09:47PM -0700, Linus Torvalds wrote: > On Thu, Aug 13, 2015 at 1:08 PM, Cyrill Gorcunov 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 | 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.