From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751637AbeAJTyU (ORCPT + 1 other); Wed, 10 Jan 2018 14:54:20 -0500 Received: from mail-io0-f196.google.com ([209.85.223.196]:44062 "EHLO mail-io0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751062AbeAJTyS (ORCPT ); Wed, 10 Jan 2018 14:54:18 -0500 X-Google-Smtp-Source: ACJfBouQuncSphiEgFGyN4cGVoNbREfThG6/e8Kw5w+PRNGo4oUOy3C4cf15mf2lElq+xjxDtvihdpEcCbeQwwn16Ow= MIME-Version: 1.0 In-Reply-To: <1515612500-14505-7-git-send-email-w@1wt.eu> References: <1515612500-14505-1-git-send-email-w@1wt.eu> <1515612500-14505-7-git-send-email-w@1wt.eu> From: Linus Torvalds Date: Wed, 10 Jan 2018 11:54:17 -0800 X-Google-Sender-Auth: XGD66wTfdkvMXELjx1RblfWzO_g Message-ID: Subject: Re: [RFC PATCH v3 6/8] x86/pti: don't mark the user PGD with _PAGE_NX. To: Willy Tarreau Cc: Linux Kernel Mailing List , "the arch/x86 maintainers" , Andy Lutomirski , Borislav Petkov , Brian Gerst , Dave Hansen , Ingo Molnar , Peter Zijlstra , Thomas Gleixner , Josh Poimboeuf , "H. Peter Anvin" , David Woodhouse , Kees Cook Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: On Wed, Jan 10, 2018 at 11:28 AM, Willy Tarreau wrote: > Since we're going to keep running on the same PGD when returning to > userspace for certain performance-critical tasks, we'll need the user > pages to be executable. So this code disables the extra protection > that was added consisting in marking user pages _PAGE_NX so that this > pgd remains usable for userspace. Yeah, no. This is wrong. Sure, SMEP gives the same thing in most cases, but not for older CPU's. So NX is a really nice way to make sure that PTI really does protect against user-space gadgets. We don't break that, and we definitely don't break that just because of some broken notion of "let's make page table isolation per-thread". Linus