From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753377AbbCISdQ (ORCPT ); Mon, 9 Mar 2015 14:33:16 -0400 Received: from mail-qc0-f173.google.com ([209.85.216.173]:41202 "EHLO mail-qc0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752344AbbCISdO (ORCPT ); Mon, 9 Mar 2015 14:33:14 -0400 MIME-Version: 1.0 In-Reply-To: References: <1425909943-14687-1-git-send-email-dvlasenk@redhat.com> <54FDDB90.9010706@zytor.com> From: Denys Vlasenko Date: Mon, 9 Mar 2015 19:32:53 +0100 Message-ID: Subject: Re: [PATCH] x86: entry_32.S: change ESPFIX test to not touch PT_OLDSS(%esp) To: Linus Torvalds Cc: Andy Lutomirski , "H. Peter Anvin" , Denys Vlasenko , Steven Rostedt , Ingo Molnar , Borislav Petkov , Oleg Nesterov , Frederic Weisbecker , Alexei Starovoitov , Will Drewry , Kees Cook , "the arch/x86 maintainers" , Linux Kernel Mailing List 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 Mon, Mar 9, 2015 at 7:16 PM, Linus Torvalds wrote: > On Mon, Mar 9, 2015 at 11:04 AM, Andy Lutomirski wrote: >> >> One option would be to change the NMI entry code to move itself down 8 >> bytes if this happens (came from kernel mode or sp == sp0 - 12, >> perhaps). > > Hmm. That whole code currently depends on the stack setup being just a > single instruction (the move to esp). And that simplifies things, I'd > like to keep it that way. > > I'd *much* rather just keep the 8-byte padding. What was so > problematic with that? It worked. It's been around forever. Removing > it is the bug. Unfortunately, looks like keeping the gap is the safest thing to do. Hopes that tss.sp0 was true top of the stack, sans "a few little problems", died so quickly :/ (and we didn't even touch vm86 yet). We probably better off to give that 8 a name. Now it's just another magic constant in the entry.S maze.