From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753491AbbHMQX4 (ORCPT ); Thu, 13 Aug 2015 12:23:56 -0400 Received: from mail-oi0-f48.google.com ([209.85.218.48]:35720 "EHLO mail-oi0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752604AbbHMQXz (ORCPT ); Thu, 13 Aug 2015 12:23:55 -0400 MIME-Version: 1.0 In-Reply-To: References: <55CA90B4.2010205@list.ru> From: Andy Lutomirski Date: Thu, 13 Aug 2015 09:23:35 -0700 Message-ID: Subject: Re: [regression] x86/signal/64: Fix SS handling for signals delivered to 64-bit programs breaks dosemu To: Linus Torvalds Cc: Stas Sergeev , Linux kernel Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Aug 13, 2015 at 9:19 AM, Linus Torvalds wrote: > On Thu, Aug 13, 2015 at 8:43 AM, Andy Lutomirski wrote: >> >> I'm trying to fix it without reverting. If that doesn't work, then we >> revert. Yesterday, I thought I had a reasonably clean fix, but it >> turned out that it only solved half of the problem. > > The thing is, I actually think that the current situation is crazy. > > Especially given that we don't restore any of the other segment > registers on x86-64 (except CS, of course) > > So how about this "alternate" minimal patch instead. The difference is: > > - we actually leave the > > regs->ss = __USER_DS; > > in __setup_rt_frame, to guarantee that when we take a signal, we do > take it with a valid SS That by itself is enough to break DOSEMU. I think we may be stuck with my hack to only replace regs->ss if the old one was invalid. > > - but it removes all the other games with SS (and treats it exactly > the same as FS/GS). > > So now we don't play games with the actual sigcontext, and > hopefully dosemu is happier. You mean that we always set ss to __USER_DS on sigreturn? The problem is that user code *can't* program SS when calling sigreturn because the SYSCALL instruction zaps it. I'll try to implement something. If this regression were new in 4.2-rc, then I'd say revert first and ask questions later, but the regression is in 4.1 as well :( --Andy