ANDROID: KVM: arm64: Check PGD alignment when creating a pVM
Martijn reported a hypervisor crash when providing pKVM with an undersized PGD allocation. Indeed, although the size of the PGD allocation at EL2 is not under host control, a smaller host-side allocation can lead to providing pKVM with a misaligned PGD, which will cause the guest stage-2 init to fail in a bad way. Specifically, guest_s2_zalloc_pages_exact() expects a successful allocation from hyp_alloc_pages(), which can only happen if the pool has been pre-filled with a physically aligned high-order page. In order to guarantee allocation success in this path, check the host-provided PGD alignment early on. Bug: 443668075 Change-Id: I170963edc5721cf368a506bcdc4b2d0cdb462f78 Fixes: ab3b93a3 ("FROMLIST: KVM: arm64: Add infrastructure to create and track pKVM instances at EL2") Reported-by:Martijn Bogaard <martijnbogaard@google.com> Signed-off-by:
Quentin Perret <qperret@google.com>
Loading
-
mentioned in commit 5968b8b2
-
mentioned in commit 959b7621
-
mentioned in commit 187455ab
-
mentioned in commit 5d940ef6
-
mentioned in commit 2a148e30
-
mentioned in commit 67bac638
-
mentioned in commit ab96a0c7
-
mentioned in commit 5cdaa494
-
mentioned in commit 471511d4
-
mentioned in commit c4a4887c
-
mentioned in commit 096e651e
-
mentioned in commit 8095cc42
Please sign in to comment