Re: [PATCH v3 9/15] iommufd: Data structure to provide IOVA to PFN mapping

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Oct 25, 2022 at 03:12:18PM -0300, Jason Gunthorpe wrote:

> +int iopt_unmap_all(struct io_pagetable *iopt, unsigned long *unmapped)
> +{
> +	return iopt_unmap_iova_range(iopt, 0, ULONG_MAX, unmapped);
> +}

syzkaller indirectly noticed that unmap all of an empty IOAS returns
ENOENT, it makes more sense it should succeed:

-       return iopt_unmap_iova_range(iopt, 0, ULONG_MAX, unmapped);
+       int rc;
+
+       rc = iopt_unmap_iova_range(iopt, 0, ULONG_MAX, unmapped);
+       /* If the IOVAs are empty then unmap all succeeds */
+       if (rc == -ENOENT)
+               return 0;
+       return rc;

Plus a selftest to cover it

Jason



[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux