Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753640AbdLHRnk (ORCPT ); Fri, 8 Dec 2017 12:43:40 -0500 Received: from mail.kernel.org ([198.145.29.99]:58318 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753489AbdLHRnO (ORCPT ); Fri, 8 Dec 2017 12:43:14 -0500 DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B7BA3219A4 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=luto@kernel.org X-Google-Smtp-Source: AGs4zMb8q4TBGYe+MqwURZwp1NCGUzi/w6ca2PE3wtiAIFjbytgtpLIp90EitDnoZsls1Kq2NHwHrIHQ2bZh9Dz+yCA= MIME-Version: 1.0 In-Reply-To: References: <48fe5cf1382d6a95c7b1837415882edcc81a9781.1512631324.git.luto@kernel.org> <20171207124347.p7kdj7q4qqs3ivri@pd.tnic> <665F1CA8-D012-4465-B5F7-E81E088847DB@amacapital.net> <20171208073454.dicyefwncsihq7sm@gmail.com> <20171208094400.wqnezwukq5yx4mgq@gmail.com> <20171208113128.hdpeznolztrdzjpf@gmail.com> From: Andy Lutomirski Date: Fri, 8 Dec 2017 09:42:52 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] LDT improvements To: Thomas Gleixner Cc: Andy Lutomirski , Ingo Molnar , Borislav Petkov , X86 ML , "linux-kernel@vger.kernel.org" , Brian Gerst , David Laight , Kees Cook , Peter Zijlstra Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1206 Lines: 26 On Fri, Dec 8, 2017 at 9:37 AM, Thomas Gleixner wrote: > On Fri, 8 Dec 2017, Andy Lutomirski wrote: >> Can we take a step back here? I think there are four vaguely sane >> ways to make the LDT work: >> >> 1. The way it is right now -- in vmalloc space. The only real >> downside is that it requires exposing that part of vmalloc space in >> the user tables, which is a bit gross. >> >> 2. In some fixmap-like space, which is what my patch does, albeit >> buggily. This requires a PGD that we treat as per-mm, not per-cpu, >> but that's not so bad. >> >> 3. In one of the user PGDs but above TASK_SIZE_MAX. This is >> functionally almost identical to #2, except that there's more concern >> about exploits that write past TASK_SIZE_MAX. >> >> 4. In an actual vma. I don't see the benefit of doing this at all -- >> it's just like #2 except way more error prone. Hell, you have to make >> sure that you can't munmap or mremap it, which isn't a consideration >> at all with the other choices. > > Why? You can unmap vdso or uprobe or whatever VMAs and you will simply > die. You get what you asked for. But if you unmap ldt and then map something else at the same VA, you're root.