From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753572AbbHMQnY (ORCPT ); Thu, 13 Aug 2015 12:43:24 -0400 Received: from mail-ig0-f180.google.com ([209.85.213.180]:35459 "EHLO mail-ig0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753538AbbHMQnW (ORCPT ); Thu, 13 Aug 2015 12:43:22 -0400 MIME-Version: 1.0 In-Reply-To: References: <55CA90B4.2010205@list.ru> Date: Thu, 13 Aug 2015 09:43:21 -0700 X-Google-Sender-Auth: peDoZfzb7ka4kqUVspmbaB4r5pI Message-ID: Subject: Re: [regression] x86/signal/64: Fix SS handling for signals delivered to 64-bit programs breaks dosemu From: Linus Torvalds To: Andy Lutomirski 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:34 AM, Linus Torvalds wrote: > > Are you sure? From the description by Stas, the problem is literally > the *restoring* action of the sigcontext, and trying to restore a SS > value that is no longer valid. > > "The crash happens when DOS program terminates. > At that point dosemu subverts the execution flow by > replacing segregs and cs/ip ss/sp in sigcontext with its own. > But __pad0 still has DOS SS, which crash because (presumably) > the DOS LDT have been just removed" Side note: if this is the main issue, and the problem is the "iret" faulting when trying to restore SS (and causing an unexpected SIGSEGV that dosemu crashes on), then an alternate model might be to keep the save/restore SS code, but do a "VERW" on the SS descriptor in restore_sigcontext(), and silently just replacing it with __USER_DS if that fails. Linus