Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1578083 > unrolled thread

Re: [PATCH 1/1] Ddrivers: hv: Turn off write permission on the hypercall page

Started byStephen Hemminger <stephen@networkplumber.org>
First post2017-02-10 02:20 +0100
Last post2017-02-10 02:20 +0100
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [PATCH 1/1] Ddrivers: hv: Turn off write permission on the  hypercall page Stephen Hemminger <stephen@networkplumber.org> - 2017-02-10 02:20 +0100

#1578083 — Re: [PATCH 1/1] Ddrivers: hv: Turn off write permission on the hypercall page

FromStephen Hemminger <stephen@networkplumber.org>
Date2017-02-10 02:20 +0100
SubjectRe: [PATCH 1/1] Ddrivers: hv: Turn off write permission on the hypercall page
Message-ID<t982u-5bz-11@gated-at.bofh.it>
On Wed,  8 Feb 2017 18:30:56 -0700
kys@exchange.microsoft.com wrote:

> From: K. Y. Srinivasan <kys@microsoft.com>
> 
> 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 <kys@microsoft.com>
> Cc: <stable@vger.kernel.org>
> ---
>  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 <stephen@networkplumber.org>
Tested-by: Stephen Hemminger <stephen@networkplumber.org>

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web