diff options
| author | 2026-10-31 13:45:34 -0400 | |
|---|---|---|
| committer | 2026-11-02 09:07:00 -0500 | |
| commit | fd1462c96bafe2cb14e88c837b270f8990b717b5 (patch) | |
| tree | 4a4c1ee49e38b02402af7e0e9cd38df68015c0d5 /scripts/Makefile.thinlto | |
| parent | vhost: reject invalid IOTLB update permissions (diff) | |
vhost-vdpa: fix pinned page leak in vhost_vdpa_pa_map() error path
When pin_user_pages() or vhost_vdpa_map() fails, vhost_vdpa_pa_map()
is supposed to unpin the pages pinned after the last successfully
mapped chunk, i.e. the range [map_pfn, last_pfn]. The unpin is guarded
by nchunks, but nchunks is reset to 0 every time a chunk is mapped from
inside the current page list, so a failure after any such boundary
leaves that pending range pinned forever. With physically scattered
memory nearly every page list contains a boundary, so the leak happens
on practically every failed IOTLB update.
The pending range is non-empty exactly when a page has been pinned,
which last_pfn already tells us, so drop nchunks and test last_pfn.
Fixes: ad89653f79f1 ("vhost-vdpa: fix page pinning leakage in error path (rework)")
Cc: stable@vger.kernel.org
Signed-off-by: Tal Zussman <tz2294@columbia.edu>
Reported-by: Linfeng Sun <linfeng.sun.dev@gmail.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Message-ID: <20261031-vhost-vdpa-unpin-v1-1-94ffc9683256@columbia.edu>
Diffstat (limited to 'scripts/Makefile.thinlto')
0 files changed, 0 insertions, 0 deletions
