From 2246e7887cccd9e3d3524c3079b80b5cecaac433 Mon Sep 17 00:00:00 2001 From: Jeffrey Altman Date: Wed, 2 May 2012 14:32:01 -0400 Subject: [PATCH] Windows: AFSInitializeProcessCB failure stack exhaustion If AFSInitializeProcessCB() fails in AFSProcessCreate() it can lead to a recursive loop of AFSValidateProcessEntry() -> AFSProcessCreate() calls. Only call AFSValidateProcessEntry() if AFSInitializeProcessCB() succeeds. On failure, log an error to the trace log. Change-Id: I67a65bed9a3193a5ce44eb01d30aed15fe9e469d Reviewed-on: http://gerrit.openafs.org/7309 Tested-by: BuildBot Reviewed-by: Chas Williams - CONTRACTOR Reviewed-by: Jeffrey Altman Tested-by: Jeffrey Altman --- .../afsrdr/kernel/fs/AFSProcessSupport.cpp | 20 ++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/src/WINNT/afsrdr/kernel/fs/AFSProcessSupport.cpp b/src/WINNT/afsrdr/kernel/fs/AFSProcessSupport.cpp index 7268d5c072..1f77caf70d 100644 --- a/src/WINNT/afsrdr/kernel/fs/AFSProcessSupport.cpp +++ b/src/WINNT/afsrdr/kernel/fs/AFSProcessSupport.cpp @@ -126,13 +126,23 @@ AFSProcessCreate( IN HANDLE ParentId, pProcessCB->CreatingProcessId = (ULONGLONG)CreatingProcessId; pProcessCB->CreatingThreadId = (ULONGLONG)CreatingThreadId; + + // + // Now assign the AuthGroup ACE + // + + AFSValidateProcessEntry( ProcessId); } + else + { - // - // Now assign the AuthGroup ACE - // - - AFSValidateProcessEntry( ProcessId); + AFSDbgLogMsg( AFS_SUBSYSTEM_PROCESS_PROCESSING, + AFS_TRACE_LEVEL_ERROR, + "AFSProcessCreate Initialization failure for Parent %08lX Process %08lX %08lX\n", + ParentId, + ProcessId, + PsGetCurrentThread()); + } AFSReleaseResource( pDeviceExt->Specific.Control.ProcessTree.TreeLock); }