[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Yqw9dou3qgpAKQkZ@kernel.org>
Date: Fri, 17 Jun 2022 11:38:14 +0300
From: Mike Rapoport <rppt@...nel.org>
To: Marc Zyngier <maz@...nel.org>
Cc: Suzuki K Poulose <suzuki.poulose@....com>,
Alexandru Elisei <alexandru.elisei@....com>,
linux-arm-kernel@...ts.infradead.org,
Catalin Marinas <catalin.marinas@....com>,
Quentin Perret <qperret@...gle.com>,
kvmarm@...ts.cs.columbia.edu, linux-kernel@...r.kernel.org,
James Morse <james.morse@....com>,
Will Deacon <will@...nel.org>, kernel-team@...roid.com
Subject: Re: [PATCH] KVM: arm64: Prevent kmemleak from accessing pKVM memory
On Fri, Jun 17, 2022 at 09:21:31AM +0100, Marc Zyngier wrote:
> On Thu, 16 Jun 2022 16:11:34 +0000, Quentin Perret wrote:
> > Commit a7259df76702 ("memblock: make memblock_find_in_range method
> > private") changed the API using which memory is reserved for the pKVM
> > hypervisor. However, it seems that memblock_phys_alloc() differs
> > from the original API in terms of kmemleak semantics -- the old one
> > excluded the reserved regions from kmemleak scans when the new one
> > doesn't seem to. Unfortunately, when protected KVM is enabled, all
> > kernel accesses to pKVM-private memory result in a fatal exception,
> > which can now happen because of kmemleak scans:
> >
> > [...]
>
> Applied to fixes, thanks!
>
> [1/1] KVM: arm64: Prevent kmemleak from accessing pKVM memory
> commit: 9e5afa8a537f742bccc2cd91bc0bef4b6483ee98
I'd really like to update the changelog to this:
Commit a7259df76702 ("memblock: make memblock_find_in_range method
private") changed the API using which memory is reserved for the pKVM
hypervisor. However, memblock_phys_alloc() differs from the original API in
terms of kmemleak semantics -- the old one didn't report the reserved
regions to kmemleak while the new one does. Unfortunately, when protected
KVM is enabled, all kernel accesses to pKVM-private memory result in a
fatal exception, which can now happen because of kmemleak scans:
$ echo scan > /sys/kernel/debug/kmemleak
[ 34.991354] kvm [304]: nVHE hyp BUG at: [<ffff800008fa3750>] __kvm_nvhe_handle_host_mem_abort+0x270/0x290!
...
Fix this by explicitly excluding the hypervisor's memory pool from
kmemleak like we already do for the hyp BSS.
> Cheers,
>
> M.
> --
> Marc Zyngier <maz@...nel.org>
>
--
Sincerely yours,
Mike.
Powered by blists - more mailing lists