]> xenbits.xensource.com Git - pvdrivers/win/xenvif.git/commit
Don't try to __FreePages() with local copy of MDL
authorPaul Durrant <paul.durrant@citrix.com>
Tue, 10 Jan 2017 10:29:53 +0000 (10:29 +0000)
committerPaul Durrant <paul.durrant@citrix.com>
Tue, 10 Jan 2017 11:13:13 +0000 (11:13 +0000)
commite5e64b57a31d374e6294b824052307ce3b1c92ca
tree3f7ba755840b6d613f833dbec9571cb4f85bd540
parentfb31fe8737203ba841036914572316d859569bb9
Don't try to __FreePages() with local copy of MDL

The XENVIF_RECEIVER_PACKET structure contains an embedded MDL so that
multi-fragment packets can be properly chained together. However this
structure should not be passed to __FreePages() as:

a) It appears to create problems with system PTE tracking
b) It results in memory corruption now that __FreePages() calls
   ExFreePool()

This patch therefore extends the packet structure with a pointer to the
original system MDL such that it can be passed to __FreePages() when the
packet destructor is called.

The patch also bypasses some calls to MmGetSystemAddressForMdlSafe() since
we can ASSERT that the MDL is already mapped to a system address.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
src/xenvif/receiver.c