Commit 74ff6e66 authored by Quentin Perret's avatar Quentin Perret
Browse files

ANDROID: KVM: arm64: Fix ToCToU issue when refilling the hyp memcache



Xiling reports that the hypervisor dereferences the host memcache struct
twice when refilling its own memcache. This allows the host to change its
memcache head after it has been admitted and before it is consumed,
leading to an arbitrary write in hypervisor memory.

Fix this by copying the host memcache on the stack before starting to
refill hence guaranteeing its stability.

Bug: 228435321
Reported-by: default avatarXiling Gong <xiling@google.com>
Signed-off-by: default avatarQuentin Perret <qperret@google.com>
Change-Id: Ib7c5db203e4a4a7f27eb9f0c0083f4b5c726b4d9
parent 8fe46774
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment