From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751867AbdBJBNP (ORCPT ); Thu, 9 Feb 2017 20:13:15 -0500 Received: from mail-pf0-f173.google.com ([209.85.192.173]:32826 "EHLO mail-pf0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751681AbdBJBNL (ORCPT ); Thu, 9 Feb 2017 20:13:11 -0500 Date: Thu, 9 Feb 2017 17:12:01 -0800 From: Stephen Hemminger To: kys@exchange.microsoft.com Cc: kys@microsoft.com, gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org, devel@linuxdriverproject.org, olaf@aepfle.de, apw@canonical.com, vkuznets@redhat.com, jasowang@redhat.com, leann.ogasawara@canonical.com, keescook@google.com, sds@tycho.nsa.gov, Subject: Re: [PATCH 1/1] Ddrivers: hv: Turn off write permission on the hypercall page Message-ID: <20170209112105.3a46d70d@xeon-e3> In-Reply-To: <1486603856-27642-1-git-send-email-kys@exchange.microsoft.com> References: <1486603856-27642-1-git-send-email-kys@exchange.microsoft.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 8 Feb 2017 18:30:56 -0700 kys@exchange.microsoft.com wrote: > From: K. Y. Srinivasan > > The hypercall page only needs to be executable but currently it is setup to > be writable as well. Fix the issue. > > Signed-off-by: K. Y. Srinivasan > Cc: > --- > arch/x86/hyperv/hv_init.c | 2 +- > 1 files changed, 1 insertions(+), 1 deletions(-) > > diff --git a/arch/x86/hyperv/hv_init.c b/arch/x86/hyperv/hv_init.c > index c224b7d..db64baf 100644 > --- a/arch/x86/hyperv/hv_init.c > +++ b/arch/x86/hyperv/hv_init.c > @@ -125,7 +125,7 @@ void hyperv_init(void) > guest_id = generate_guest_id(0, LINUX_VERSION_CODE, 0); > wrmsrl(HV_X64_MSR_GUEST_OS_ID, guest_id); > > - hypercall_pg = __vmalloc(PAGE_SIZE, GFP_KERNEL, PAGE_KERNEL_EXEC); > + hypercall_pg = __vmalloc(PAGE_SIZE, GFP_KERNEL, PAGE_KERNEL_RX); > if (hypercall_pg == NULL) { > wrmsrl(HV_X64_MSR_GUEST_OS_ID, 0); Verified that this fixes the original problem. I don't see the warning anymore and the guest works normally. Reported-by: Stephen Hemminger Tested-by: Stephen Hemminger