Windows: SetFileRenameInfo Do not replace pSrcParentObject
authorJeffrey Altman <jaltman@your-file-system.com>
Thu, 25 Apr 2013 03:34:45 +0000 (23:34 -0400)
committerJeffrey Altman <jaltman@your-file-system.com>
Thu, 25 Apr 2013 17:11:47 +0000 (10:11 -0700)
If pSrcParentObject is replaced by pTargetParentObject then the
reference count obtained by the AFSFindObjectInfo() call at the
start of AFSFileRenameInfo will be released on the wrong object.
This will result in a reference leak on pSrcParentObject and an
undercount on pTargetParentObject.  pTargetParentObject can then
be garbage collected while it is in use.

Change-Id: Id10db257afbd4996a31eb98ad7eca69343297274
Reviewed-on: http://gerrit.openafs.org/9806
Reviewed-by: Peter Scott <pscott@kerneldrivers.com>
Reviewed-by: Rod Widdowson <rdw@steadingsoftware.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

src/WINNT/afsrdr/kernel/lib/AFSFileInfo.cpp

index b7ffcaf..6892b12 100644 (file)
@@ -3244,8 +3244,6 @@ AFSSetRenameInfo( IN PIRP Irp)
 
             SetFlag( pSrcFcb->ObjectInformation->Flags, AFS_OBJECT_FLAGS_PARENT_FID);
 
-            pSrcParentObject = pTargetParentObject;
-
             ulNotificationAction = FILE_ACTION_ADDED;
         }
         else