From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753880AbdKXTKL (ORCPT ); Fri, 24 Nov 2017 14:10:11 -0500 Received: from mail.skyhub.de ([5.9.137.197]:44390 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752530AbdKXTKK (ORCPT ); Fri, 24 Nov 2017 14:10:10 -0500 Date: Fri, 24 Nov 2017 20:10:05 +0100 From: Borislav Petkov To: Ingo Molnar Cc: linux-kernel@vger.kernel.org, Dave Hansen , Andy Lutomirski , Thomas Gleixner , "H . Peter Anvin" , Peter Zijlstra , Linus Torvalds Subject: Re: [PATCH 14/43] x86/asm/64: Return to userspace from the trampoline stack Message-ID: <20171124191005.bn4zchmxlngdhvpv@pd.tnic> References: <20171124172411.19476-1-mingo@kernel.org> <20171124172411.19476-15-mingo@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20171124172411.19476-15-mingo@kernel.org> User-Agent: NeoMutt/20170609 (1.8.3) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Nov 24, 2017 at 06:23:42PM +0100, Ingo Molnar wrote: > From: Andy Lutomirski > > By itself, this is useless. It gives us the ability to run some final > code before exit that cannnot run on the kernel stack. This could > include a CR3 switch a la KAISER or some kernel stack erasing, for > example. (Or even weird things like *changing* which kernel stack > gets used as an ASLR-strengthening mechanism.) > > The SYSRET32 path is not covered yet. It could be in the future or > we could just ignore it and force the slow path if needed. > > Signed-off-by: Andy Lutomirski > Signed-off-by: Thomas Gleixner > Cc: Borislav Petkov > Cc: Brian Gerst > Cc: Dave Hansen > Cc: Josh Poimboeuf > Cc: Linus Torvalds > Cc: Peter Zijlstra > Link: https://lkml.kernel.org/r/d350017000eed20922c3b2711a2d9229dc809256.1511497875.git.luto@kernel.org > Signed-off-by: Ingo Molnar > --- > arch/x86/entry/entry_64.S | 55 +++++++++++++++++++++++++++++++++++++++++++---- > 1 file changed, 51 insertions(+), 4 deletions(-) Nice commenting, future generations will appreciate it! :-) Reviewed-by: Borislav Petkov -- Regards/Gruss, Boris. Good mailing practices for 400: avoid top-posting and trim the reply.