Hi all,
My file encryption driver is currently suffering a dead-lock problem
when used with Norton AntiVirus 2005 or a service packed Norton 2003.
This problem was not occurring with the original version of Norton
2003, if the scanner is disabled from the tray icon or with other
Anti-Virus products.
My driver is receiving a IRP_MJ_CREATE request for an encrypted file.
During the create processing, a message is passed to my Win32
component (via a completed IOCTL IRP). The Win32 component is then
responsible for decrypting the file encryption key, asking the user to
insert their smartcard, etc. The original create request is held,
pending the completion of the Win32 processing.
During the Win32 processing, the application makes COM calls,
resulting in system dlls being accessed. The thread then appears to
deadlock on the dll file open request, waiting for the original create
request to complete.
It looks as though Norton AntiVirus is sometimes only allowing one
file to be scanned at a time.
Can anyone confirm that Norton AntiVirus imposes such a limitation?
Am I correct in assuming that it should be safe to perform such
processing in a Win32 application?
Norton appears to be swapping the kernel stacks. Does anyone know of a
way to see the kernel stack as it was before Norton swaps the stacks?
I can manually decode the Win32 stack associated with the thread, so I
have some idea of what is being processed, but it would be really
helpful if I could see the original kernel stack.
The only way that I can see to fix this problem is to remove the Win32
callback. However this severely limits the functionality of my
encryption product (no calls to CryptoAPI, no user dialog prompts, no
storage on smartcards or HSMs). Does anyone have any better
suggestions? (Other than not using Norton ![]()
I have checked that my application is not deadlocking itself. Only one
encrypted file is being requested. The file being opened by the RPC
mechanism is rpcss.dll (and this isn’t encrypted). My driver is only
processing a single IRP on a single thread (see the trace below).
Thanks in advance,
Andy Larter
========== This is a dump of the original create request ==========
Its interesting that the request is coming from svchost, not explorer
as I was expecting
THREAD ff826020 Cid 02f0.04a0 Teb: 7ffdc000 Win32Thread: 00000000
WAIT: (Executive) KernelMode Non-Alertable
ff82648c SynchronizationEvent
IRP List:
ff508aa8: (0006,01b4) Flags: 00000884 Mdl: 00000000
ff508c68: (0006,01b4) Flags: 00000884 Mdl: 00000000
Impersonation token: e187f030 (Level Impersonation)
DeviceMap e14ad718
Owning Process ffae72f0 Image: svchost.exe
Wait Start TickCount 20160 Ticks: 2622 (0:00:00:26.257)
Context Switch Count 120
UserTime 00:00:00.0010
KernelTime 00:00:00.0040
Start Address kernel32!BaseThreadStartThunk (0x77e802f4)
Stack Init f636e000 Current f636d198 Base f636e000 Limit f636b000 Call
0
Priority 9 BasePriority 8 PriorityDecrement 0 DecrementCount 16
ChildEBP RetAddr Args to Child
f636d1b0 804ea71c ff826090 ff826020 804ea5a3 nt!KiSwapContext+0x2e
(FPO: [EBP 0xf636d1e4] [0,0,4])
f636d1bc 804ea5a3 00000000 80ef0900 80dcc8d8 nt!KiSwapThread+0x44
(FPO: [0,0,2])
f636d1e4 f91191a2 00000000 00000000 00000000
nt!KeWaitForSingleObject+0x1c0 (FPO: [Non-Fpo])
f636d210 f911b51f 000004d5 ff5c8338 ffa3cd34
FileSafe!CPendingUserJob::WaitForCompletion+0x6d (FPO: [Non-Fpo])
(CONV: thiscall)
f636d268 f9109da3 f636d4a0 f636d338 f636d328
FileSafe!CUserConnectionProcessing::ScheduleDemonTask_OpenFile+0x189
(FPO: [Non-Fpo])
f636d350 f9108c58 ffb026b0 f636d400 f636d4a0
FileSafe!DriverCreateHandler_Open+0x50e (FPO: [Non-Fpo]) (CONV:
stdcall)
f636d4b4 f9118529 ffb026b0 00000000 80ef0900
FileSafe!DriverCreateHandler+0xb47 (FPO: [Non-Fpo]) (CONV: cdecl)
f636d4f0 f911dcbe 00000246 ffb026b0 e188dc90
FileSafe!CIRPContext::CallRoutine+0x7d (FPO: [Non-Fpo]) (CONV:
thiscall)
f636d514 804ec04f 80f1d428 ff508aa8 f636d578
FileSafe!Filter_FSDCreate+0xae (FPO: [Non-Fpo]) (CONV: stdcall)
f636d524 f7a6422b f636d578 f604d500 00000000 nt!IopfCallDriver+0x31
(FPO: [0,0,1])
WARNING: Stack unwind information not available. Following frames may
be wrong.
f636d688 8057069c 80f52620 00000000 ffa54f30
SYMEVENT!SYMEvent_GetVMDataPtr+0x886b
f636d70c 80572d6b 00000000 f636d74c 00000040
nt!ObpLookupObjectName+0x56a (FPO: [Non-Fpo])
f636d760 80574a10 00000000 00000000 f636d800
nt!ObOpenObjectByName+0xe9 (FPO: [Non-Fpo])
f636d7dc 80574ac1 ff504dac 80100180 ff504df0 nt!IopCreateFile+0x407
(FPO: [Non-Fpo])
f636d824 80578f0d ff504dac 80100180 ff504df0 nt!IoCreateFile+0x36
(FPO: [Non-Fpo])
f636d864 804d4e91 ff504dac 80100180 ff504df0 nt!NtCreateFile+0x2e
(FPO: [Non-Fpo])
f636d864 8050b15b ff504dac 80100180 ff504df0 nt!KiSystemService+0xc4
(FPO: [0,0] TrapFrame @ f636d898)
f636d908 f5c5e8b1 ff504dac 80100180 ff504df0 nt!ZwCreateFile+0x11
(FPO: [11,0,0])
f636d958 f5c36253 ff504f88 f5c36040 f636d970 SAVRT+0x2f8b1
e14fa528 e1500580 f7a59480 e21b6f40 f7a59484 SAVRT+0x7253
e14fa528 e1500580 f7a59480 e21b6f40 f7a59484 0xe1500580
f7a5aa00 f7a61750 f7a617f0 f7a5b9c0 f7a61840 0xe1500580
f7a63670 ffffe058 082444f6 56097401 00261be8
SYMEVENT!SYMEvent_GetVMDataPtr+0x5d90
e8f18b56 00000000 00000000 00000000 00000000 0xffffe058
========== This is a dump of the locked thread ==========
THREAD ff508338 Cid 03c4.010c Teb: 7ffd7000 Win32Thread: 00000000
WAIT: (Executive) KernelMode Non-Alertable
ff801d40 Mutant - owning thread ff826020
IRP List:
ff508160: (0006,01b4) Flags: 00000884 Mdl: 00000000
Not impersonating
DeviceMap e14ad718
Owning Process ff6188b8 Image: ASEFDA~1.EXE
Wait Start TickCount 20162 Ticks: 2620 (0:00:00:26.237)
Context Switch Count 1
UserTime 00:00:00.0000
KernelTime 00:00:00.0000
Start Address kernel32!BaseThreadStartThunk (0x77e802f4)
Win32 Start Address ole32!CRpcThreadCache::RpcWorkerThreadEntry
(0x771debfc)
Stack Init f5932000 Current f5931920 Base f5932000 Limit f592f000 Call
0
Priority 8 BasePriority 8 PriorityDecrement 0 DecrementCount 0
ChildEBP RetAddr Args to Child
f5931938 804ea71c ff5083a8 ff508338 804ea5a3 nt!KiSwapContext+0x2e
(FPO: [EBP 0xf593196c] [0,0,4])
f5931944 804ea5a3 e188dc98 ff801d20 00000001 nt!KiSwapThread+0x44
(FPO: [0,0,2])
f593196c f5c39c3d 00000000 00000000 00000000
nt!KeWaitForSingleObject+0x1c0 (FPO: [Non-Fpo])
WARNING: Stack unwind information not available. Following frames may
be wrong.
e14fa528 e1500580 f7a59480 e21b6f40 f7a59484 SAVRT+0xac3d
e14fa528 e1500580 f7a59480 e21b6f40 f7a59484 0xe1500580
f7a5aa00 f7a61750 f7a617f0 f7a5b9c0 f7a61840 0xe1500580
f7a63670 ffffe058 082444f6 56097401 00261be8
SYMEVENT!SYMEvent_GetVMDataPtr+0x5d90
e8f18b56 00000000 00000000 00000000 00000000 0xffffe058