Skip to contentSkip to conversation

hv: Turn off write permission on the hypercall page

PATCH New Stephen Hemminger 1 participant 1 message Mar 10, 2017

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 hv: Turn off write permission on the hypercall page

The hypercall page only needs to be executable but currently it is setup to be writable as well. Fix the issue.

Backport of upstream commit 372b1e91343e to earlier kernels. Tested on 4.9.

---
 drivers/hv/hv.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/hv/hv.c +1 -1
index 60dbd6cb4640..ce2aa14604e2 100644
@@ -220,7 +220,7 @@ int hv_init(void)
 	/* See if the hypercall page is already set */
 	rdmsrl(HV_X64_MSR_HYPERCALL, hypercall_msr.as_uint64);
 
-	virtaddr = __vmalloc(PAGE_SIZE, GFP_KERNEL, PAGE_KERNEL_EXEC);
+	virtaddr = __vmalloc(PAGE_SIZE, GFP_KERNEL, PAGE_KERNEL_RX);
 
 	if (!virtaddr)
 		goto cleanup;
Signature · 1 line
2.11.0