mirror of
https://github.com/winfsp/winfsp.git
synced 2025-04-22 08:23:05 -05:00
sys: FspPropagateTopFlags: check TopLevelIrp not completed
Add a check to verify that the TopLevelIrp has not been completed. This became necessary because on recent Windows kernels, IRP's can have "IRP extensions", which are freed when an IRP is completed. This can trigger a recursive CLOSE with a top-level IRP that has been completed, which can bugcheck the system. Case in point: the new (Win11) NtCopyFileChunk creates IRP's with COPY_INFORMATION attached. Upon completion of such an IRP the SourceFileObject is freed, which results in a recursive IRP_MJ_CLOSE with a completed top-level IRP, which would lead to a BSOD.
This commit is contained in:
parent
6fb72555d3
commit
a482183149
@ -324,7 +324,9 @@ VOID FspPropagateTopFlags(PIRP Irp, PIRP TopLevelIrp)
|
|||||||
FspFileNodeAcquireMain :
|
FspFileNodeAcquireMain :
|
||||||
FspFileNodeAcquireFull);
|
FspFileNodeAcquireFull);
|
||||||
}
|
}
|
||||||
else if ((PIRP)MM_SYSTEM_RANGE_START <= TopLevelIrp && IO_TYPE_IRP == TopLevelIrp->Type)
|
else if ((PIRP)MM_SYSTEM_RANGE_START <= TopLevelIrp &&
|
||||||
|
IO_TYPE_IRP == TopLevelIrp->Type &&
|
||||||
|
TopLevelIrp->CurrentLocation <= TopLevelIrp->StackCount)
|
||||||
{
|
{
|
||||||
PFILE_OBJECT FileObject = IoGetCurrentIrpStackLocation(Irp)->FileObject;
|
PFILE_OBJECT FileObject = IoGetCurrentIrpStackLocation(Irp)->FileObject;
|
||||||
PFILE_OBJECT TopLevelFileObject = IoGetCurrentIrpStackLocation(TopLevelIrp)->FileObject;
|
PFILE_OBJECT TopLevelFileObject = IoGetCurrentIrpStackLocation(TopLevelIrp)->FileObject;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user