Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757724AbeAHUxc (ORCPT + 1 other); Mon, 8 Jan 2018 15:53:32 -0500 Received: from Galois.linutronix.de ([146.0.238.70]:50988 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755717AbeAHUxa (ORCPT ); Mon, 8 Jan 2018 15:53:30 -0500 Date: Mon, 8 Jan 2018 21:53:02 +0100 (CET) From: Thomas Gleixner To: Andrea Arcangeli cc: Jon Masters , "Woodhouse, David" , Paolo Bonzini , Alan Cox , Linus Torvalds , Andi Kleen , Greg Kroah-Hartman , Tim Chen , Linux Kernel Mailing List , Dave Hansen , Jeff Law , Nick Clifton Subject: Re: Avoid speculative indirect calls in kernel In-Reply-To: <20180108102805.GK25546@redhat.com> Message-ID: References: <20180104015920.1ad7b9d3@alans-desktop> <1515054014.12987.75.camel@amazon.co.uk> <403e65be-cfd1-fd08-0401-2e26470b63d4@redhat.com> <4dde456c-fd15-e768-8876-5844c8b7c455@redhat.com> <9976a670-a023-ea1f-3f13-ee5253092533@redhat.com> <20180108102805.GK25546@redhat.com> User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: On Mon, 8 Jan 2018, Andrea Arcangeli wrote: > On Fri, Jan 05, 2018 at 10:59:28AM +0100, Thomas Gleixner wrote: > I sent you a better version of the efi_64.c fix from Jiri privately > and you still miss the tboot fix in linux-tip so you still got a boot > failure to fix there. Missed that in the pile ... > This is incremental with > https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git/log/?h=WIP.x86/pti > where the "Unbreak EFI old_memmap" fix is applied. > > I respinned it after doing the more correct fix in this case too (same > as the efi_64.c improvement) while leaving the attribution to the fix > to Dave as he did the hard part. Thanks for resending it. > >From 0c480d1eeabd56379144a4ed6b6fb24f3b84e40e Mon Sep 17 00:00:00 2001 > From: Dave Hansen > Date: Sat, 6 Jan 2018 18:41:14 +0100 > Subject: [PATCH 1/1] x86/kaiser/efi: unbreak tboot > > This is another case similar to what EFI does: create a new set of > page tables, map some code at a low address, and jump to it. PTI > mistakes this low address for userspace and mistakenly marks it > non-executable in an effort to make it unusable for userspace. Undo > the poison to allow execution. > > Signed-off-by: Dave Hansen > Cc: Ning Sun > Cc: Thomas Gleixner > Cc: Ingo Molnar > Cc: "H. Peter Anvin" > Cc: x86@kernel.org > Cc: tboot-devel@lists.sourceforge.net > Cc: linux-kernel@vger.kernel.org > Signed-off-by: Andrea Arcangeli > --- > arch/x86/kernel/tboot.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/arch/x86/kernel/tboot.c b/arch/x86/kernel/tboot.c > index a4eb27918ceb..75869a4b6c41 100644 > --- a/arch/x86/kernel/tboot.c > +++ b/arch/x86/kernel/tboot.c > @@ -127,6 +127,7 @@ static int map_tboot_page(unsigned long vaddr, unsigned long pfn, > p4d = p4d_alloc(&tboot_mm, pgd, vaddr); > if (!p4d) > return -1; > + pgd->pgd &= ~_PAGE_NX; > pud = pud_alloc(&tboot_mm, p4d, vaddr); > if (!pud) > return -1; > > If I can help and assist in any other way let me know. > > Thanks, > Andrea >