Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753400AbeAQOpU (ORCPT + 1 other); Wed, 17 Jan 2018 09:45:20 -0500 Received: from mx1.redhat.com ([209.132.183.28]:45258 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753051AbeAQOpT (ORCPT ); Wed, 17 Jan 2018 09:45:19 -0500 Date: Wed, 17 Jan 2018 08:45:03 -0600 From: Josh Poimboeuf To: Joerg Roedel Cc: Brian Gerst , Andy Lutomirski , Thomas Gleixner , Ingo Molnar , "H . Peter Anvin" , X86 ML , LKML , Linux-MM , Linus Torvalds , Dave Hansen , Juergen Gross , Peter Zijlstra , Borislav Petkov , Jiri Kosina , Boris Ostrovsky , David Laight , Denys Vlasenko , Eduardo Valentin , Greg KH , Will Deacon , "Liguori, Anthony" , Daniel Gruss , Hugh Dickins , Kees Cook , Andrea Arcangeli , Waiman Long , Joerg Roedel Subject: Re: [PATCH 03/16] x86/entry/32: Leave the kernel via the trampoline stack Message-ID: <20180117144503.62e47m6e5yyyze3d@treble> References: <1516120619-1159-1-git-send-email-joro@8bytes.org> <1516120619-1159-4-git-send-email-joro@8bytes.org> <20180117092442.GJ28161@8bytes.org> <20180117141418.GS28161@8bytes.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20180117141418.GS28161@8bytes.org> User-Agent: Mutt/1.6.0.1 (2016-04-01) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Wed, 17 Jan 2018 14:45:19 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: On Wed, Jan 17, 2018 at 03:14:18PM +0100, Joerg Roedel wrote: > On Wed, Jan 17, 2018 at 06:00:07AM -0800, Brian Gerst wrote: > > On Wed, Jan 17, 2018 at 5:57 AM, Brian Gerst wrote: > > But then again, you could take a fault on the trampoline stack if you > > get a bad segment. Perhaps just pushing the new stack pointer onto > > the process stack before user segment loads will be the right move. > > User segment loads pop from the stack, so having anything on-top also > doesn't work. > > Maybe I can leave some space at the bottom of the task-stack at entry > time and store the pointer there on exit, if that doesn't confuse the > stack unwinder too much. If you put it at the end of the stack page, I _think_ all you'd have to do is just adjust TOP_OF_KERNEL_STACK_PADDING. -- Josh