From 66affbc97f57c49e80debcf447255ba8480a994e Mon Sep 17 00:00:00 2001 From: Quentin Perret Date: Tue, 14 Jun 2022 09:18:32 +0000 Subject: [PATCH] ANDROID: KVM: arm64: Prevent kmemleak from accessing .hyp.data We've recently added a .data section for the hypervisor, which kmemleak is eager to parse. This clearly doesn't go well, so add the section to kmemleak's block list. Bug: 232768943 Bug: 235903024 Change-Id: Ib1ee0009ce05bf7b0ba5d53fc8ca0429ec592102 Signed-off-by: Quentin Perret [re-merge: Accidentally reverted while cutting android14-5.15] Bug: 275004094 Signed-off-by: Keir Fraser --- arch/arm64/kvm/pkvm.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm64/kvm/pkvm.c b/arch/arm64/kvm/pkvm.c index a51725ab1861..ef988cf124c4 100644 --- a/arch/arm64/kvm/pkvm.c +++ b/arch/arm64/kvm/pkvm.c @@ -506,6 +506,7 @@ static int __init finalize_pkvm(void) * at, which would end badly once inaccessible. */ kmemleak_free_part(__hyp_bss_start, __hyp_bss_end - __hyp_bss_start); + kmemleak_free_part(__hyp_data_start, __hyp_data_end - __hyp_data_start); kmemleak_free_part_phys(hyp_mem_base, hyp_mem_size); ret = pkvm_drop_host_privileges();