Hello,
I have a mini-filter that detects an infected file (on-access) and attempts to delete it from PostOpCreate. I am experimenting this with standard eicar signature.
When the infected file is detected on the readonly USB stick, the delete call initiated by my filter blocks forever. I am using FltSetInformationFile with FileDispositionInformation to delete the file. The relevant windbg output reveals the following.
Any thoughts on why this may be happening?
0: kd> !thread fffffa80039bc540
THREAD fffffa80039bc540 Cid 0794.0d38 Teb: 000007fffff5e000 Win32Thread: fffff900c06adc20 WAIT: (Executive) KernelMode Alertable
fffffa800414dc48 SynchronizationEvent
IRP List:
fffffa8004129010: (0006,0478) Flags: 00000884 Mdl: 00000000
Not impersonating
DeviceMap fffff8a001107600
Owning Process fffffa80045cfb30 Image: explorer.exe
Attached Process N/A Image: N/A
Wait Start TickCount 4377 Ticks: 1594 (0:00:00:24.906)
Context Switch Count 101 LargeStack
UserTime 00:00:00.000
KernelTime 00:00:00.000
Win32 Start Address SHLWAPI!WrapperThreadProc (0x000007feff07c7d4)
Stack Init fffff88006212db0 Current fffff88006211e30
Base fffff88006213000 Limit fffff8800620b000 Call 0
Priority 10 BasePriority 8 UnusualBoost 0 ForegroundBoost 2 IoPriority 2 PagePriority 2
Child-SP RetAddr : Args to Child : Call Site
fffff88006211e70 fffff800
030d5222 : fffffa80039bc540 fffffa80
039bc540 fffffa8000000000 00000000
00000000 : nt!KiSwapContext+0x7a
fffff88006211fb0 fffff800
030d758f : fffff8000349ac00 fffff800
034fe6c0 fffffa8000000000 fffffa80
04151770 : nt!KiCommitThreadWait+0x1d2
fffff88006212040 fffff800
0336a2be : fffffa8004151700 fffffa80
00000000 fffffa80038d7b00 00000000
00000001 : nt!KeWaitForSingleObject+0x19f
fffff880062120e0 fffff800
0336a247 : fffffa8004151ba0 fffff880
062121c0 fffffa800414dc30 00000000
00000000 : nt!FsRtlCancellableWaitForMultipleObjects+0x5e
fffff88006212140 fffff880
0114a656 : fffffa800414dc48 fffffa80
04151770 fffffa800238d001 fffffa80
042d0010 : nt!FsRtlCancellableWaitForSingleObject+0x27
fffff88006212180 fffff880
0114594a : 0000000000000000 00000000
00000000 fffffa8004488c00 fffffa80
0414dc30 : fltmgr! ?? ::FNODOBFM::string'+0x2b89 fffff880
06212210 fffff8800117bc1e : fffffa80
04489bc0 000000000000001c fffffa80
042d0010 fffffa800414dce0 : fltmgr!FltPerformSynchronousIo+0x2ca fffff880
062122b0 fffff880011b4295 : 00000000
00000000 fffffa80045abac0 fffffa80
0414eb30 fffffa80045abac0 : fltmgr!FltSetInformationFile+0xde fffff880
06212310 fffff880011b441b : 00000000
00000000 fffffa80045aba01 00000000
00000000 fffff88000000000 : MYFILTER!DeleteFileUsingFileObject fffff880
06212350 fffff880011ae7d9 : fffffa80
00000000 fffffa80045abac0 ffffffff
800005f0 fffffa800414eb30 : MYFILTER!DeleteFileUsingPath fffff880
062123f0 fffff88001144242 : 00000000
00000000 fffffa8004129440 00000000
00000000 0000000000000000 : MYFILTER!PostOpCreate+0x645 fffff880
06212530 fffff8800114338b : fffffa80
02350770 fffffa8004129e00 fffffa80
04488c60 fffffa8004488e80 : fltmgr!FltpPerformPostCallbacks+0x392 fffff880
06212600 fffff880011622b9 : fffffa80
04129010 fffffa80042d0010 fffffa80
04129000 fffffa80042d9950 : fltmgr!FltpLegacyProcessingAfterPreCallbacksCompleted+0x39b fffff880
06212690 fffff800033cb947 : 00000000
00000005 fffff800033cb3a0 fffffa80
0383b610 0000000000000000 : fltmgr!FltpCreate+0x2a9 fffff880
06212740 fffff800033c2294 : fffffa80
038d7bd0 0000000000000000 fffffa80
028ccb10 0000000000000001 : nt!IopParseDevice+0x5a7 fffff880
062128d0 fffff800033c6f8d : fffffa80
028ccb10 fffff88006212a30 fffffa80
00000040 fffffa80019349c0 : nt!ObpLookupObjectName+0x585 fffff880
062129d0 fffff800033cda57 : 00000000
000007ff 0000000000000001 fffff8a0
01a2c701 0000000000000000 : nt!ObOpenObjectByName+0x1cd fffff880
06212a80 fffff800033d77e0 : 00000000
02b0ddb8 fffff8a080100080 fffff8a0
012aacd0 0000000002b0ddc8 : nt!IopCreateFile+0x2b7 fffff880
06212b20 fffff800030cd293 : ffffffff
ffffffff 0000000000000001 00000000
02b0d7b0 fffff80000000024 : nt!NtCreateFile+0x78 fffff880
06212bb0 00000000771efc0a : 000007fe
fd424d76 0000000008000000 00000000
80000000 0000000000000000 : nt!KiSystemServiceCopyEnd+0x13 (TrapFrame @ fffff880
06212c20)
0000000002b0dd38 000007fe
fd424d76 : 0000000008000000 00000000
80000000 0000000000000000 00000000
002bc7e0 : ntdll!NtCreateFile+0xa
0000000002b0dd40 00000000
77092aad : 0000000080000000 00000000
80000000 0000ef2400000001 000007fe
fe433aec : KERNELBASE!CreateFileW+0x2cd
0000000002b0dea0 000007fe
fe438572 : 0000000000002000 00000000
00000001 0000000008000000 00000000
00000000 : kernel32!CreateFileWImplementation+0x7d
0000000002b0df00 000007fe
fe43832e : 0000000000000000 000007fe
ff085027 000007fefe701610 000007fe
fe2fc4cc : SHELL32!CFSTransfer::_OpenSrcFileWithRetry+0x222
0000000002b0e010 000007fe
fe436cee : 000007fefe6dc300 00000000
00020206 0000000000000000 00000000
0889d230 : SHELL32!CFSTransfer::OpenItem+0xf1
0000000002b0e0d0 000007fe
fe2fda9e : 0000000000000000 00000000
086e3850 000000008027003f 00000000
0890b080 : SHELL32!CCopyOperation::Do+0x1de
0000000002b0ea50 000007fe
fe2fe3b5 : 00000000086e3850 00000000
086e3850 00000000086e3850 00000000
0889d220 : SHELL32!CCopyWorkItem::_DoOperation+0x42
0000000002b0eac0 000007fe
fe2fee72 : 000000000890b080 00000000
0890b080 000000000890b080 00000000
0890b080 : SHELL32!CCopyWorkItem::_SetupAndPerformOp+0x317
0000000002b0eda0 000007fe
fe2fec0f : 0000000008887a70 00000000
00000000 0000000008887a70 00000000
08887a70 : SHELL32!CCopyWorkItem::ProcessWorkItem+0x28e
0000000002b0f0d0 000007fe
fe2fddd6 : 0000000006b4b8b8 00000000
06b4b8b8 0000000000000000 00000000
00000000 : SHELL32!CRecursiveFolderOperation::Do+0x30c
0000000002b0f170 000007fe
fe2ff61f : fffffffffffffffe 00000000
00000001 00000000087b9630 00000000
088c69d0 : SHELL32!CFileOperation::_EnumRootDo+0x24d
0000000002b0f230 000007fe
fe50f508 : 0000000000000000 00000000
00000000 0000000000000001 00000000
088c69e0 : SHELL32!CFileOperation::PrepareAndDoOperations+0x320
0000000002b0f320 000007fe
fe4d3957 : 0000000000000002 00000000
00000000 0000000000000000 00000000
088ed9a8 : SHELL32!CFileOperation::PerformOperations+0x1e0
0000000002b0f380 000007fe
fe606e3f : 0000000000000000 00000000
06b65ca0 0000000006b65ca0 00000000
06b65ca0 : SHELL32!SHFileOperationEx+0x137
0000000002b0f400 000007fe
fe606b76 : 0000000006b65ca0 00000000
06b65ca0 0000000000000002 00000000
06b65ca0 : SHELL32!CFSDropTargetHelper::_MoveCopyHIDA+0x157
0000000002b0f4a0 000007fe
fe606ccd : 0000000006b65ca0 00000000
06b65ca0 0000000000000000 00000000
00000000 : SHELL32!CFSDropTargetHelper::_Drop+0x316
0000000002b0f770 000007fe
ff07c8ea : 0000000000000000 00000000
00000000 0000000000000000 00000000
00000000 : SHELL32!CFSDropTargetHelper::s_DoDropThreadProc+0x75
0000000002b0f7a0 00000000
7709f56d : 0000000000000000 00000000
00000000 0000000000000000 00000000
00000000 : SHLWAPI!WrapperThreadProc+0x19b
0000000002b0f8a0 00000000
771d2ca1 : 0000000000000000 00000000
00000000 0000000000000000 00000000
00000000 : kernel32!BaseThreadInitThunk+0xd
0000000002b0f8d0 00000000
00000000 : 0000000000000000 00000000
00000000 0000000000000000 00000000
00000000 : ntdll!RtlUserThreadStart+0x1d
0: kd> !irp fffffa8004129010
Irp is active with 13 stacks 13 is current (= 0xfffffa8004129440)
No Mdl: No System Buffer: Thread fffffa80039bc540: Irp stack trace.
cmd flg cl Device File Completion-Context
[0, 0] 0 0 00000000 00000000 00000000-00000000
Args: 00000000 00000000 00000000 00000000
[0, 0] 0 0 00000000 00000000 00000000-00000000
Args: 00000000 00000000 00000000 00000000
[0, 0] 0 0 00000000 00000000 00000000-00000000
Args: 00000000 00000000 00000000 00000000
[0, 0] 0 0 00000000 00000000 00000000-00000000
Args: 00000000 00000000 00000000 00000000
[0, 0] 0 0 00000000 00000000 00000000-00000000
Args: 00000000 00000000 00000000 00000000
[0, 0] 0 0 00000000 00000000 00000000-00000000
Args: 00000000 00000000 00000000 00000000
[0, 0] 0 0 00000000 00000000 00000000-00000000
Args: 00000000 00000000 00000000 00000000
[0, 0] 0 0 00000000 00000000 00000000-00000000
Args: 00000000 00000000 00000000 00000000
[0, 0] 0 0 00000000 00000000 00000000-00000000
Args: 00000000 00000000 00000000 00000000
[0, 0] 0 0 00000000 00000000 00000000-00000000
Args: 00000000 00000000 00000000 00000000
[0, 0] 0 0 00000000 00000000 00000000-00000000
Args: 00000000 00000000 00000000 00000000
[0, 0] 0 0 fffffa80042ec490 00000000 fffff88001144980-fffffa8004129c30
\FileSystem\fastfat fltmgr!FltpSynchronizedOperationCompletion
Args: 00000000 00000000 00000000 00000000
[0, 0] 0 0 fffffa80042d9950 fffffa80046c9c40 00000000-00000000
\FileSystem\FltMgr
Args: fffff88006212870 01000064 00010000 00000000
0: kd> !fileobj fffffa80046c9c40
\eicar.com
Device Object: 0xfffffa80038d7bd0 \Driver\volmgr
Vpb: 0xfffffa8002f58150
Access: Read SharedRead
Flags: 0x284062
Synchronous IO
Sequential Only
Cache Supported
Cleanup Complete
Fast IO Read
Open Cancelled
FsContext: 0xfffff8a001854410 FsContext2: 0xfffff8a0019cbac0
CurrentByteOffset: 0
Cache Data:
Section Object Pointers: fffffa80045b1a90
Shared Cache Map: 00000000
Any clues as to what might be going wrong here?
Thanks.
-Prasad