diff options
author | Daniel Jordan <daniel.m.jordan@oracle.com> | 2021-03-24 21:05:52 -0400 |
---|---|---|
committer | Alex Williamson <alex.williamson@redhat.com> | 2021-03-25 12:48:38 -0600 |
commit | 60c988bc154108bd522a21289e389143006a1ff0 (patch) | |
tree | c970b68f92ec70b92e4e882fe2ebfb11ad0a0399 /usr | |
parent | 0d02ec6b3136c73c09e7859f0d0e4e2c4c07b49b (diff) |
vfio/type1: Empty batch for pfnmap pages
When vfio_pin_pages_remote() returns with a partial batch consisting of
a single VM_PFNMAP pfn, a subsequent call will unfortunately try
restoring it from batch->pages, resulting in vfio mapping the wrong page
and unbalancing the page refcount.
Prevent the function from returning with this kind of partial batch to
avoid the issue. There's no explicit check for a VM_PFNMAP pfn because
it's awkward to do so, so infer it from characteristics of the batch
instead. This may result in occasional false positives but keeps the
code simpler.
Fixes: 4d83de6da265 ("vfio/type1: Batch page pinning")
Link: https://lkml.kernel.org/r/20210323133254.33ed9161@omen.home.shazbot.org/
Reported-by: Alex Williamson <alex.williamson@redhat.com>
Suggested-by: Alex Williamson <alex.williamson@redhat.com>
Signed-off-by: Daniel Jordan <daniel.m.jordan@oracle.com>
Message-Id: <20210325010552.185481-1-daniel.m.jordan@oracle.com>
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Diffstat (limited to 'usr')
0 files changed, 0 insertions, 0 deletions