virtio-win / kvm-guest-drivers-windows

Windows paravirtualized drivers for QEMU\KVM
https://www.linux-kvm.org/page/WindowsGuestDrivers
BSD 3-Clause "New" or "Revised" License
1.92k stars 377 forks source link

[viofs] Fix MDL structure memory leak #1022

Closed kostyanf14 closed 5 months ago

kostyanf14 commented 5 months ago

Resolves: https://issues.redhat.com/browse/RHEL-19069 Resolves: https://github.com/virtio-win/kvm-guest-drivers-windows/issues/1004

Remarks from https://learn.microsoft.com/en-us/windows-hardware/drivers/ddi/wdm/nf-wdm-mmallocatepagesformdlex

The caller must use MmFreePagesFromMdl to release the memory pages that are described by an MDL that was created by MmAllocatePagesForMdlEx. After calling MmFreePagesFromMdl, the caller must also call ExFreePool to release the memory that is allocated for the MDL structure.

ybendito commented 5 months ago

@YanVugenfirer NOTE: I see that virtio-fs is not iommu-compatible, it allocates physical pages not using Virtio WDF lib Somehow it was missed or the driver was not in the tree when we've moved everything to iommu compatibility.

YanVugenfirer commented 5 months ago

It was not in a tree.

There is an open issue on it.

YanVugenfirer commented 5 months ago

@YanVugenfirer NOTE: I see that virtio-fs is not iommu-compatible, it allocates physical pages not using Virtio WDF lib Somehow it was missed or the driver was not in the tree when we've moved everything to iommu compatibility.

https://issues.redhat.com/browse/RHEL-11405