From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752573AbdLNToL (ORCPT ); Thu, 14 Dec 2017 14:44:11 -0500 Received: from merlin.infradead.org ([205.233.59.134]:35424 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752023AbdLNToK (ORCPT ); Thu, 14 Dec 2017 14:44:10 -0500 Date: Thu, 14 Dec 2017 20:43:34 +0100 From: Peter Zijlstra To: linux-kernel@vger.kernel.org, tglx@linutronix.de Cc: x86@kernel.org, Linus Torvalds , Andy Lutomirsky , Dave Hansen , Borislav Petkov , Greg KH , keescook@google.com, hughd@google.com, Brian Gerst , Josh Poimboeuf , Denys Vlasenko , Boris Ostrovsky , Juergen Gross , David Laight , Eduardo Valentin , aliguori@amazon.com, Will Deacon , linux-mm@kvack.org, kirill.shutemov@linux.intel.com, dan.j.williams@intel.com Subject: Re: [PATCH v2 06/17] x86/ldt: Do not install LDT for kernel threads Message-ID: <20171214194334.GD3326@worktop> References: <20171214112726.742649793@infradead.org> <20171214113851.398563731@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20171214113851.398563731@infradead.org> User-Agent: Mutt/1.5.22.1 (2013-10-16) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Dec 14, 2017 at 12:27:32PM +0100, Peter Zijlstra wrote: > From: Thomas Gleixner > > Kernel threads can use the mm of a user process temporarily via use_mm(), > but there is no point in installing the LDT which is associated to that mm > for the kernel thread. So thinking about this a bit more; I fear its not correct. Suppose a kthread does use_mm() and we then schedule to a task of that process, we'll not pass through switch_mm() and we'll not install the LDT and bad things happen. Or am I missing something?