KVM guest: Make pv trampoline code executable
Our PV guest patching code assembles chunks of instructions on the fly when it encounters more complicated instructions to hijack. These instructions need to live in a section that we don't mark as non-executable, as otherwise we fault when jumping there. Right now we put it into the .bss section where it automatically gets marked as non-executable. Add a check to the NX setting function to ensure that we leave these particular pages executable. Signed-off-by: Alexander Graf <agraf@suse.de>
此提交包含在:
@@ -207,6 +207,10 @@ int htab_bolt_mapping(unsigned long vstart, unsigned long vend,
|
||||
if (overlaps_kernel_text(vaddr, vaddr + step))
|
||||
tprot &= ~HPTE_R_N;
|
||||
|
||||
/* Make kvm guest trampolines executable */
|
||||
if (overlaps_kvm_tmp(vaddr, vaddr + step))
|
||||
tprot &= ~HPTE_R_N;
|
||||
|
||||
/*
|
||||
* If relocatable, check if it overlaps interrupt vectors that
|
||||
* are copied down to real 0. For relocatable kernel
|
||||
|
新增問題並參考
封鎖使用者