Re: [PATCH] vfio/type1: Unpin zero pages

From: Sean Christopherson
Date: Tue Aug 30 2022 - 01:35:02 EST


On Mon, Aug 29, 2022, Alex Williamson wrote:
> There's currently a reference count leak on the zero page. We increment
> the reference via pin_user_pages_remote(), but the page is later handled
> as an invalid/reserved page, therefore it's not accounted against the
> user and not unpinned by our put_pfn().

Heh, kvm_pfn_to_refcounted_page() all over again. is_zone_device_page() is the
other known case where a PageReserved page is refcounted. But as KVM's comment
calls out, KVM's list was built through trial and error.