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 Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux