summaryrefslogtreecommitdiff
path: root/include/mtd/git@git.tavy.me:linux.git
diff options
context:
space:
mode:
authorAlex Williamson <alex.williamson@nvidia.com>2026-03-23 15:56:58 -0600
committerAlex Williamson <alex@shazbot.org>2026-03-26 06:38:27 -0600
commite98137f0a874ab36d0946de4707aa48cb7137d1c (patch)
tree504382a96e77eaf1d4e354c49b00e8aba3f5e5fd /include/mtd/git@git.tavy.me:linux.git
parent6de23f81a5e08be8fbf5e8d7e9febc72a5b5f27f (diff)
vfio/pci: Fix double free in dma-buf feature
The error path through vfio_pci_core_feature_dma_buf() ignores its own advice to only use dma_buf_put() after dma_buf_export(), instead falling through the entire unwind chain. In the unlikely event that we encounter file descriptor exhaustion, this can result in an unbalanced refcount on the vfio device and double free of allocated objects. Avoid this by moving the "put" directly into the error path and return the errno rather than entering the unwind chain. Reported-by: Renato Marziano <renato@marziano.top> Fixes: 5d74781ebc86 ("vfio/pci: Add dma-buf export support for MMIO regions") Cc: stable@vger.kernel.org Acked-by: Leon Romanovsky <leonro@nvidia.com> Signed-off-by: Alex Williamson <alex.williamson@nvidia.com> Link: https://lore.kernel.org/r/20260323215659.2108191-3-alex.williamson@nvidia.com Reviewed-by: Jason Gunthorpe <jgg@nvidia.com> Signed-off-by: Alex Williamson <alex@shazbot.org>
Diffstat (limited to 'include/mtd/git@git.tavy.me:linux.git')
0 files changed, 0 insertions, 0 deletions