From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753014AbdKTUyR (ORCPT ); Mon, 20 Nov 2017 15:54:17 -0500 Received: from Galois.linutronix.de ([146.0.238.70]:60301 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752881AbdKTUyQ (ORCPT ); Mon, 20 Nov 2017 15:54:16 -0500 Date: Mon, 20 Nov 2017 21:54:13 +0100 (CET) From: Thomas Gleixner To: Andy Lutomirski cc: Dave Hansen , "linux-kernel@vger.kernel.org" , "linux-mm@kvack.org" , moritz.lipp@iaik.tugraz.at, Daniel Gruss , michael.schwarz@iaik.tugraz.at, richard.fellner@student.tugraz.at, Linus Torvalds , Kees Cook , Hugh Dickins , X86 ML Subject: Re: [PATCH 17/30] x86, kaiser: map debug IDT tables In-Reply-To: Message-ID: References: <20171110193058.BECA7D88@viggo.jf.intel.com> <20171110193138.1185728D@viggo.jf.intel.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 On Mon, 20 Nov 2017, Andy Lutomirski wrote: > On Fri, Nov 10, 2017 at 11:31 AM, Dave Hansen > wrote: > > > > From: Dave Hansen > > > > The IDT is another structure which the CPU references via a > > virtual address. It also obviously needs these to handle an > > interrupt in userspace, so these need to be mapped into the user > > copy of the page tables. > > Why would the debug IDT ever be used in user mode? IIRC it's a total > turd related to avoiding crap nesting inside NMI. Or am I wrong? No. It's called from the TRACE_IRQS macros in the ASM entry code and from do_nmi(). > If it *is* used in user mode, then we have a bug and it should be in > the IDT to avoid address leaks just like the normal IDT. It's not so this can go away. Good catch. Thanks, tglx