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 <qperret@google.com>
[re-merge: Accidentally reverted while cutting android14-5.15]
Bug: 275004094
Signed-off-by: Keir Fraser <keirf@google.com>
This commit is contained in:
Quentin Perret
2022-06-14 09:18:32 +00:00
committed by Keir Fraser
parent bef7cc8154
commit 66affbc97f

View File

@@ -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();