From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752408AbdLLTvq (ORCPT ); Tue, 12 Dec 2017 14:51:46 -0500 Received: from mail-it0-f65.google.com ([209.85.214.65]:38154 "EHLO mail-it0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752292AbdLLTvo (ORCPT ); Tue, 12 Dec 2017 14:51:44 -0500 X-Google-Smtp-Source: ACJfBot7302DpDdzvMyaEpCqxAKoLTjpoEoYlB9W6GBdAeVszQU2L6h7ul/GRyoxsxoFW0ftKxIXP8BqZrX2Ezj00qM= MIME-Version: 1.0 In-Reply-To: References: <20171212173221.496222173@linutronix.de> <20171212173334.345422294@linutronix.de> From: Linus Torvalds Date: Tue, 12 Dec 2017 11:51:43 -0800 X-Google-Sender-Auth: bXadLbFOKtr0uQr38llRlnT3jl4 Message-ID: Subject: Re: [patch 13/16] x86/ldt: Introduce LDT write fault handler To: Thomas Gleixner Cc: LKML , "the arch/x86 maintainers" , Andy Lutomirsky , Peter Zijlstra , Dave Hansen , Borislav Petkov , Greg KH , Kees Cook , Hugh Dickins , Brian Gerst , Josh Poimboeuf , Denys Vlasenko , Boris Ostrovsky , Juergen Gross , David Laight , Eduardo Valentin , "Liguori, Anthony" , Will Deacon , linux-mm 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 Tue, Dec 12, 2017 at 11:21 AM, Thomas Gleixner wrote: > > That has nothing to do with the user installed LDT. The kernel does not use > and rely on LDT at all. Sure it does. We end up loading the selector for %gs and %fs, and those selectors end up being connected with whatever user-mode has set up for them. We then set the FS/GS base pointer to a kernel-specific value, but that is _separately_ from the actual accessed bit that is in the selector. So the kernel doesn't care, but the kernel definitely uses them. Linus From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-io0-f200.google.com (mail-io0-f200.google.com [209.85.223.200]) by kanga.kvack.org (Postfix) with ESMTP id 294A56B0038 for ; Tue, 12 Dec 2017 14:51:45 -0500 (EST) Received: by mail-io0-f200.google.com with SMTP id c196so167350ioc.3 for ; Tue, 12 Dec 2017 11:51:45 -0800 (PST) Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id 127sor210843itw.4.2017.12.12.11.51.44 for (Google Transport Security); Tue, 12 Dec 2017 11:51:44 -0800 (PST) MIME-Version: 1.0 In-Reply-To: References: <20171212173221.496222173@linutronix.de> <20171212173334.345422294@linutronix.de> From: Linus Torvalds Date: Tue, 12 Dec 2017 11:51:43 -0800 Message-ID: Subject: Re: [patch 13/16] x86/ldt: Introduce LDT write fault handler Content-Type: text/plain; charset="UTF-8" Sender: owner-linux-mm@kvack.org List-ID: To: Thomas Gleixner Cc: LKML , the arch/x86 maintainers , Andy Lutomirsky , Peter Zijlstra , Dave Hansen , Borislav Petkov , Greg KH , Kees Cook , Hugh Dickins , Brian Gerst , Josh Poimboeuf , Denys Vlasenko , Boris Ostrovsky , Juergen Gross , David Laight , Eduardo Valentin , "Liguori, Anthony" , Will Deacon , linux-mm On Tue, Dec 12, 2017 at 11:21 AM, Thomas Gleixner wrote: > > That has nothing to do with the user installed LDT. The kernel does not use > and rely on LDT at all. Sure it does. We end up loading the selector for %gs and %fs, and those selectors end up being connected with whatever user-mode has set up for them. We then set the FS/GS base pointer to a kernel-specific value, but that is _separately_ from the actual accessed bit that is in the selector. So the kernel doesn't care, but the kernel definitely uses them. Linus -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org