On 6/14/21 6:03 PM, Philippe Mathieu-Daudé wrote: > On 6/11/21 1:46 PM, Philippe Mathieu-Daudé wrote: >> When the NVMe block driver was introduced (see commit bdd6a90a9e5, >> January 2018), Linux VFIO_IOMMU_MAP_DMA ioctl was only returning >> -ENOMEM in case of error. The driver was correctly handling the >> error path to recycle its volatile IOVA mappings. >> >> To fix CVE-2019-3882, Linux commit 492855939bdb ("vfio/type1: Limit >> DMA mappings per container", April 2019) added the -ENOSPC error to >> signal the user exhausted the DMA mappings available for a container. > > Hmm this commit has been added before v5.1-rc4. > > So while this fixes the behavior of v5.1-rc4+ kernels, > older kernels using this fix will have the same problem... > > Should I check uname(2)'s utsname.release[]? Is it reliable?
Not at all. What if somebody runs kernel with that commit backported? I would leave this up to distro maintainers to figure out. They know what kernel patches are backported and thus what qemu patches should be backported too. I'm wondering if there's a way we can help them by letting know (other than mentioning the kernel commit). Michal