mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-06 02:50:49 +09:00
ANDROID: KVM: arm64: Relax checks in module_change_host_page_prot
Modules can only relax permissions to RWX. This seems rather arbitrary. Instead, allow any valid permissions to be set, as long as the page is a pristine host page, or already module owned. Bug: 308373293 Change-Id: I905786fad6543f47a00bd9b9f07e17dd660d457c Signed-off-by: Keir Fraser <keirf@google.com>
This commit is contained in:
@@ -2041,15 +2041,12 @@ int module_change_host_page_prot(u64 pfn, enum kvm_pgtable_prot prot)
|
|||||||
page = hyp_phys_to_page(addr);
|
page = hyp_phys_to_page(addr);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Modules can only relax permissions of pages they own, and restrict
|
* Modules can only modify pages they already own, and pristine host
|
||||||
* permissions of pristine pages.
|
* pages.
|
||||||
*/
|
*/
|
||||||
if (prot == KVM_PGTABLE_PROT_RWX) {
|
if (!(page->flags & MODULE_OWNED_PAGE) &&
|
||||||
if (!(page->flags & MODULE_OWNED_PAGE))
|
(host_get_page_state(pte, addr) != PKVM_PAGE_OWNED))
|
||||||
goto unlock;
|
goto unlock;
|
||||||
} else if (host_get_page_state(pte, addr) != PKVM_PAGE_OWNED) {
|
|
||||||
goto unlock;
|
|
||||||
}
|
|
||||||
|
|
||||||
update:
|
update:
|
||||||
if (!prot) {
|
if (!prot) {
|
||||||
|
|||||||
Reference in New Issue
Block a user