Skip to content
Commit 7ed9e3d9 authored by Si-Wei Liu's avatar Si-Wei Liu Committed by Michael S. Tsirkin
Browse files

vhost-vdpa: fix page pinning leakage in error path



Pinned pages are not properly accounted particularly when
mapping error occurs on IOTLB update. Clean up dangling
pinned pages for the error path. As the inflight pinned
pages, specifically for memory region that strides across
multiple chunks, would need more than one free page for
book keeping and accounting. For simplicity, pin pages
for all memory in the IOVA range in one go rather than
have multiple pin_user_pages calls to make up the entire
region. This way it's easier to track and account the
pages already mapped, particularly for clean-up in the
error path.

Fixes: 4c8cf318 ("vhost: introduce vDPA-based backend")
Signed-off-by: default avatarSi-Wei Liu <si-wei.liu@oracle.com>
Link: https://lore.kernel.org/r/1601701330-16837-3-git-send-email-si-wei.liu@oracle.com


Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
parent 1477c8ae
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment