Re: [PATCH v9 0/6] KVM: allow mapping non-refcounted pages

From: Christoph Hellwig
Date: Mon Oct 02 2023 - 02:25:45 EST


On Fri, Sep 29, 2023 at 09:06:34AM -0700, Sean Christopherson wrote:
> KVM needs to be aware of non-refcounted struct page memory no matter what; see
> CVE-2021-22543 and, commit f8be156be163 ("KVM: do not allow mapping valid but
> non-reference-counted pages"). I don't think it makes any sense whatsoever to
> remove that code and assume every driver in existence will do the right thing.

Agreed.

>
> With the cleanups done, playing nice with non-refcounted paged instead of outright
> rejecting them is a wash in terms of lines of code, complexity, and ongoing
> maintenance cost.

I tend to strongly disagree with that, though. We can't just let these
non-refcounted pages spread everywhere and instead need to fix their
usage.