From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf0-f197.google.com (mail-pf0-f197.google.com [209.85.192.197]) by kanga.kvack.org (Postfix) with ESMTP id 561656B027B for ; Fri, 13 Jul 2018 19:25:49 -0400 (EDT) Received: by mail-pf0-f197.google.com with SMTP id a23-v6so9939945pfo.23 for ; Fri, 13 Jul 2018 16:25:49 -0700 (PDT) Received: from mail.kernel.org (mail.kernel.org. [198.145.29.99]) by mx.google.com with ESMTPS id s184-v6si23468090pgb.123.2018.07.13.16.25.48 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 13 Jul 2018 16:25:48 -0700 (PDT) Received: from mail-wm0-f51.google.com (mail-wm0-f51.google.com [74.125.82.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id AA993208E2 for ; Fri, 13 Jul 2018 23:25:47 +0000 (UTC) Received: by mail-wm0-f51.google.com with SMTP id s14-v6so10769019wmc.1 for ; Fri, 13 Jul 2018 16:25:47 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <1531308586-29340-29-git-send-email-joro@8bytes.org> References: <1531308586-29340-1-git-send-email-joro@8bytes.org> <1531308586-29340-29-git-send-email-joro@8bytes.org> From: Andy Lutomirski Date: Fri, 13 Jul 2018 16:25:25 -0700 Message-ID: Subject: Re: [PATCH 28/39] x86/mm/pti: Keep permissions when cloning kernel text in pti_clone_kernel_text() Content-Type: text/plain; charset="UTF-8" Sender: owner-linux-mm@kvack.org List-ID: To: Joerg Roedel Cc: Thomas Gleixner , Ingo Molnar , "H . Peter Anvin" , X86 ML , LKML , Linux-MM , Linus Torvalds , Andy Lutomirski , Dave Hansen , Josh Poimboeuf , Juergen Gross , Peter Zijlstra , Borislav Petkov , Jiri Kosina , Boris Ostrovsky , Brian Gerst , David Laight , Denys Vlasenko , Eduardo Valentin , Greg KH , Will Deacon , "Liguori, Anthony" , Daniel Gruss , Hugh Dickins , Kees Cook , Andrea Arcangeli , Waiman Long , Pavel Machek , "David H . Gutteridge" , Joerg Roedel On Wed, Jul 11, 2018 at 4:29 AM, Joerg Roedel wrote: > From: Joerg Roedel > > Mapping the kernel text area to user-space makes only sense > if it has the same permissions as in the kernel page-table. > If permissions are different this will cause a TLB reload > when using the kernel page-table, which is as good as not > mapping it at all. > > On 64-bit kernels this patch makes no difference, as the > whole range cloned by pti_clone_kernel_text() is mapped RO > anyway. On 32 bit there are writeable mappings in the range, > so just keep the permissions as they are. Reviewed-by: Andy Lutomirski