mirror-linux/drivers/iommu/iommufd
Akhilesh Patil 8fe8a09204 iommufd: viommu: free memory allocated by kvcalloc() using kvfree()
Use kvfree() instead of kfree() to free pages allocated by kvcalloc()
in iommufs_hw_queue_alloc_phys() to fix potential memory corruption.
Ensure the memory is properly freed, as kvcalloc may internally use
vmalloc or kmalloc depending on available memory in the system.

Fixes: 2238ddc2b0 ("iommufd/viommu: Add IOMMUFD_CMD_HW_QUEUE_ALLOC ioctl")
Link: https://patch.msgid.link/r/aJifyVV2PL6WGEs6@bhairav-test.ee.iitb.ac.in
Signed-off-by: Akhilesh Patil <akhilesh@ee.iitb.ac.in>
Reviewed-by: Kevin Tian <kevin.tian@intel.com>
Reviewed-by: Nicolin Chen <nicolinc@nvidia.com>
Reviewed-by: Pranjal Shrivastava <praan@google.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
2025-08-18 11:10:40 -03:00
..
Kconfig iommufd: Move iommufd_sw_msi and related functions to driver.c 2025-03-25 10:18:19 -03:00
Makefile iommufd: Rename fault.c to eventq.c 2025-03-17 14:51:19 -03:00
device.c iommufd: Rename some shortterm-related identifiers 2025-07-18 17:33:08 -03:00
double_span.h
driver.c iommufd/vdevice: Remove struct device reference from struct vdevice 2025-07-18 17:33:08 -03:00
eventq.c iommufd: Apply the new iommufd_object_alloc_ucmd helper 2025-06-19 15:43:30 -03:00
hw_pagetable.c iommufd: Return EOPNOTSUPP for failures due to driver bugs 2025-06-19 15:43:28 -03:00
io_pagetable.c iommufd: Prevent ALIGN() overflow 2025-07-17 11:46:55 -03:00
io_pagetable.h iommufd/access: Bypass access->ops->unmap for internal use 2025-07-11 11:09:22 -03:00
ioas.c iommufd: Add IOMMU_IOAS_CHANGE_PROCESS 2024-11-14 12:57:13 -04:00
iommufd_private.h iommufd: Rename some shortterm-related identifiers 2025-07-18 17:33:08 -03:00
iommufd_test.h iommufd/selftest: Add coverage for the new mmap interface 2025-07-11 14:34:35 -03:00
iova_bitmap.c iommufd: Apply obvious cosmetic fixes 2025-06-19 15:43:27 -03:00
main.c iommufd: Rename some shortterm-related identifiers 2025-07-18 17:33:08 -03:00
pages.c iommufd/access: Bypass access->ops->unmap for internal use 2025-07-11 11:09:22 -03:00
selftest.c iommufd 6.17 merge window pull 2025-07-31 12:43:08 -07:00
vfio_compat.c module: Convert symbol namespace to string literal 2024-12-02 11:34:44 -08:00
viommu.c iommufd: viommu: free memory allocated by kvcalloc() using kvfree() 2025-08-18 11:10:40 -03:00