diff options
| author | Qinyun Tan <qinyuntan@linux.alibaba.com> | 2026-09-02 16:54:14 +0800 |
|---|---|---|
| committer | Jason Gunthorpe <jgg@nvidia.com> | 2026-09-09 13:23:35 -0300 |
| commit | 1d56f4d6db3d2b2c93017a80c4f9c4cfffa9d193 (patch) | |
| tree | e02d87085dd93f64c52a7168fdc46fdee8e2c5bb /tools/perf/scripts/python/event_analyzing_sample.py | |
| parent | cee9395acd8043be0644b25c34bfa86623f2b935 (diff) | |
| download | linux-next-1d56f4d6db3d2b2c93017a80c4f9c4cfffa9d193.tar.gz linux-next-1d56f4d6db3d2b2c93017a80c4f9c4cfffa9d193.zip | |
iommufd/selftest: Return dmabuf fd from IOMMU_TEST_OP_DMABUF_GET again
The selftest helper reads the new dmabuf fd from the ioctl return
value:
*out_fd = ioctl(fd, IOMMU_TEST_CMD, &cmd);
Commit dba4254e216d ("iommufd/selftest: Fix dmabuf leak in
iommufd_test_dmabuf_get()") fixed the dmabuf leak on dma_buf_fd()
failure, but the applied version also changed the success path to
return 0, so userspace no longer receives the fd. Note the patch as
posted on the list returned rc here; the change to return 0 appeared
when it was applied:
https://lore.kernel.org/all/20260707030635.221577-1-seven.yi.lee@gmail.com/
Every test using test_cmd_get_dmabuf() then operates on fd 0 instead
of the dmabuf, and the dmabuf_simple and dmabuf_revoke selftests fail
across all fixtures:
# iommufd.c:1595:dmabuf_simple:Expected -1 (-1) ==
_test_ioctl_ioas_map_file(...) (0)
Keep the dma_buf_put() on failure but return the fd on success.
Fixes: dba4254e216d ("iommufd/selftest: Fix dmabuf leak in iommufd_test_dmabuf_get()")
Signed-off-by: Qinyun Tan <qinyuntan@linux.alibaba.com>
Link: https://patch.msgid.link/20260902085414.549830-1-qinyuntan@linux.alibaba.com
Tested-by: Yi Lai <yi1.lai@intel.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Diffstat (limited to 'tools/perf/scripts/python/event_analyzing_sample.py')
0 files changed, 0 insertions, 0 deletions
