| Bug in Filter Manager's FltIsDirectory |
|
|
In XP the implementation of FltIsDirectory is buggy. This document describes the issue and an opensource fix which pacthes filtermanager with a working solution.
FltIsDirectory() is used find out whether a file object is for a directory or a file. Unfortuately in Windows XP the filter manager communicates directly with the next lowest driver to estblish this information Thus, any minifilter which does file object shadowing will cause NTFS to crash, if a minifilter above it issues FltIsDirectory. In dumps that I have seen, the filter "cmdguard.sys" is often the unfortunate victim. Let me emphasise that I believe that that filter is entirely innocent of that crash.
A typical dump has Ntfs!NtfsDecodeFileObject at the top of the stack, then fltmgr!FltIsDirectory below it somewhere.
Ntfs!NtfsDecodeFileObject+0x37
As far as I am aware there is no hotfix available for this, although I'd be happy to hear otherwise. This is somewhat frustrating given the pressure that the MS Developers have put on people to go down the shadow file object route.
The fix would be to get FltIsFilter to obey the filter hierarchy, and example might be:
NTSTATUS
//
//
//
The only technique I have found to make this work is to patch filter manager 'in situ'. The best way to achieve this is as a separate non unloadable driver, this allows one to use the "trampoline" to patch the code in a crash proof manner. If one needs to make the code unloadable one has to patch and unpatch and it is this last operation which can be problematic.
I have made my code available open source under the Apache 2 license at http://steadingsoftware.com/PatchFltMgr/PatchFltMgr.ZIP. Please feel free to contact me at rdw _at_ steadingsoftware _dot_ come if you need further assistance. |


