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]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux