]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
KVM: arm64: Prevent kmemleak from accessing .hyp.data
authorQuentin Perret <qperret@google.com>
Tue, 23 Apr 2024 15:05:20 +0000 (16:05 +0100)
committerMarc Zyngier <maz@kernel.org>
Wed, 1 May 2024 15:48:14 +0000 (16:48 +0100)
We've 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.

Signed-off-by: Quentin Perret <qperret@google.com>
Signed-off-by: Fuad Tabba <tabba@google.com>
Acked-by: Oliver Upton <oliver.upton@linux.dev>
Link: https://lore.kernel.org/r/20240423150538.2103045-13-tabba@google.com
Signed-off-by: Marc Zyngier <maz@kernel.org>
arch/arm64/kvm/pkvm.c

index e2c08443f284479e786751f19e53795420f1689b..85117ea8f351553fcdb18c7c1147ad2043f6545f 100644 (file)
@@ -258,6 +258,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_rodata_start, __hyp_rodata_end - __hyp_rodata_start);
        kmemleak_free_part_phys(hyp_mem_base, hyp_mem_size);
 
        ret = pkvm_drop_host_privileges();