From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 53C2CC2BABC for ; Tue, 7 Apr 2020 07:38:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 24782206F5 for ; Tue, 7 Apr 2020 07:38:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727104AbgDGHif (ORCPT ); Tue, 7 Apr 2020 03:38:35 -0400 Received: from verein.lst.de ([213.95.11.211]:36825 "EHLO verein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726393AbgDGHie (ORCPT ); Tue, 7 Apr 2020 03:38:34 -0400 Received: by verein.lst.de (Postfix, from userid 2407) id D459E68BEB; Tue, 7 Apr 2020 09:38:30 +0200 (CEST) Date: Tue, 7 Apr 2020 09:38:30 +0200 From: Christoph Hellwig To: Vitaly Kuznetsov Cc: Christoph Hellwig , x86@kernel.org, linux-hyperv@vger.kernel.org, linux-kernel@vger.kernel.org, "K. Y. Srinivasan" , Stephen Hemminger , Andy Lutomirski , Peter Zijlstra Subject: Re: hv_hypercall_pg page permissios Message-ID: <20200407073830.GA29279@lst.de> References: <20200407065500.GA28490@lst.de> <87v9mblpq6.fsf@vitty.brq.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87v9mblpq6.fsf@vitty.brq.redhat.com> User-Agent: Mutt/1.5.17 (2007-11-01) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Apr 07, 2020 at 09:28:01AM +0200, Vitaly Kuznetsov wrote: > Christoph Hellwig writes: > > > Hi all, > > > > The x86 Hyper-V hypercall page (hv_hypercall_pg) is the only allocation > > in the kernel using __vmalloc with exectutable persmissions, and the > > only user of PAGE_KERNEL_RX. Is there any good reason it needs to > > be readable? Otherwise we could use vmalloc_exec and kill off > > PAGE_KERNEL_RX. Note that before 372b1e91343e6 ("drivers: hv: Turn off > > write permission on the hypercall page") it was even mapped writable.. > > [There is nothing secret in the hypercall page, by reading it you can > figure out if you're running on Intel or AMD (VMCALL/VMMCALL) but it's > likely not the only possible way :-)] > > I see no reason for hv_hypercall_pg to remain readable. I just > smoke-tested Thanks, I have the same in my WIP tree, but just wanted to confirm this makes sense.