Windows: AFSCleanup move CCb access inside try block
authorJeffrey Altman <jaltman@your-file-system.com>
Fri, 10 May 2013 01:48:16 +0000 (21:48 -0400)
committerJeffrey Altman <jaltman@your-file-system.com>
Sat, 11 May 2013 15:08:54 +0000 (08:08 -0700)
commitc42912d6da6ff7536b1301b4fb7f556513e8692c
tree5720306442dddada7f638dbb735adcb4e2338a73
parentdcae72c87e63b595c4e86cb199ff75332b51506a
Windows: AFSCleanup move CCb access inside try block

A crash dump was examined which showed a deadlock due to the leak
of a SectionObjectResource in a code path in which the holding thread
could not have obtained it.  The FileObject->FsContext2 (Ccb) pointer
referred to invalid memory which may have been due to pool corruption.
The only code path in which the SectionObjectResource is held exclusive
and then the Ccb pointer is used outside of a try-except block is in
AFSCleanup().  Move this reference inside the try-except block just in
case.  If the Ccb is invalid, at least this way AFSRedirLib will catch
the exception and free the SectionObjectResource before continuing.

Change-Id: I08c9baacfc8897ae8d8b551a74976daf7effbcef
Reviewed-on: http://gerrit.openafs.org/9892
Reviewed-by: Peter Scott <pscott@kerneldrivers.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
src/WINNT/afsrdr/kernel/lib/AFSCleanup.cpp