[HAL]
authorCameron Gutman <aicommander@gmail.com>
Sun, 17 Aug 2014 01:42:02 +0000 (01:42 +0000)
committerCameron Gutman <aicommander@gmail.com>
Sun, 17 Aug 2014 01:42:02 +0000 (01:42 +0000)
commitef4815c35f93fb5206e20164de29ac11d0d6fdd2
treefb91fe03c16a9b82e71979f71cc99e0ec031bf4e
parent50aa823cdbc3933436e0f984d38c5bb6c52dada8
[HAL]
Fix a catastrophic bug in S/G DMA. There is a subtle difference between the S/G DMA APIs and the old AllocateAdapterChannel API when it comes to having multiple requests in flight. Callers of (Io)AllocateAdapterChannel CANNOT queue another request until the AdapterControlRoutine is called. S/G DMA allows multiple concurrent DMA requests, but ROS was using IoAllocateAdapterChannel in the S/G API. As a result, the wait block stored in the device object was unexpectedly reinitalized and queued again. This results in a leak of the originally queued request context, potentially performing the new DMA operation twice while dropping the old request, and use after free of the context passed to HalpScatterGatherAdapterControl.

svn path=/trunk/; revision=63898
reactos/hal/halx86/generic/dma.c