Skip to content
This repository was archived by the owner on Nov 8, 2023. It is now read-only.

Commit f975b38

Browse files
Quentin PerretTreehugger Robot
authored andcommitted
ANDROID: KVM: arm64: Always check state from host_ack_unshare()
Similar to how we failed to cross-check the state from the completer's PoV on the hyp_ack_unshare() path, we fail to do so from host_ack_unshare(). This shouldn't cause problems in practice as this can only be called on the guest_unshare_host() path, and guest currently don't have the ability to share their pages with anybody other than the host. But this again is rather fragile, so let's simply do the proper check -- it isn't very costly thanks to the hyp_vmemmap optimisation. Bug: 381409114 Change-Id: I3770b7db55c579758863e41f50ab30f6a8bb4a0c Signed-off-by: Quentin Perret <[email protected]>
1 parent 4697322 commit f975b38

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

arch/arm64/kvm/hyp/nvhe/mem_protect.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1209,9 +1209,9 @@ static int host_ack_donation(u64 addr,
12091209

12101210
static int host_ack_unshare(const struct pkvm_checked_mem_transition *checked_tx)
12111211
{
1212-
return __host_ack_transition(checked_tx->completer_addr,
1213-
checked_tx->nr_pages * PAGE_SIZE,
1214-
checked_tx->tx, PKVM_PAGE_SHARED_BORROWED);
1212+
return __host_check_page_state_range(checked_tx->completer_addr,
1213+
checked_tx->nr_pages * PAGE_SIZE,
1214+
PKVM_PAGE_SHARED_BORROWED);
12151215
}
12161216

12171217
static int host_complete_share(const struct pkvm_checked_mem_transition *checked_tx,

0 commit comments

Comments
 (0)