diff options
| author | Samarth Narang <samarth.colleges@gmail.com> | 2026-10-13 10:10:45 -0700 |
|---|---|---|
| committer | Jason Gunthorpe <jgg@nvidia.com> | 2026-10-14 21:16:13 -0300 |
| commit | a6ec38d74c08ddbe1b7c3936d6d25f346d12c7be (patch) | |
| tree | 0a76bfb26a7ae3d6c5b045abc2ab2e54213e9dfe /scripts/basic/split-include.c | |
| parent | 440ca8a4b69f40088065b9e05ef11373292a254e (diff) | |
| download | linux-next-a6ec38d74c08ddbe1b7c3936d6d25f346d12c7be.tar.gz linux-next-a6ec38d74c08ddbe1b7c3936d6d25f346d12c7be.zip | |
iommufd/iova_bitmap: Fail GET_DIRTY_BITMAP when a bitmap page cannot be pinned
The iova_bitmap_set() function reports dirty IOVAs into a user-provided
bitmap, it does so by pinning the bitmap pages lazily one chunk at a time
as the reported IOVA advances. When advancing to the next chunk fails,
the function simply returns without recording the dirty bits.
if (iova_bitmap_advance_to(bitmap, iova))
return;
So on an IOMMU_HWPT_GET_DIRTY_BITMAP ioctl, if any bitmap chunk past the
first cannot be pinned, the dirty pages in that chunk are cleared in the
page table, not set in the bitmap, and the ioctl will still return
success. This means that the destination VM will observe stale memory.
This patch records the first such error in the iova_bitmap and propagates
it so the ioctl fails instead of silently succeeding.
Fixes: 4a00f9434891 ("iommupt: Add read_and_clear_dirty op")
Signed-off-by: Samarth Narang <samarth.colleges@gmail.com>
Link: https://patch.msgid.link/20261013171045.3104619-1-samarth.colleges@gmail.com
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Diffstat (limited to 'scripts/basic/split-include.c')
0 files changed, 0 insertions, 0 deletions
