Author: tkreuzer
Date: Mon May 18 01:51:31 2009
New Revision: 40963
URL:
http://svn.reactos.org/svn/reactos?rev=40963&view=rev
Log:
MmGrowKernelStack: Don't assert, but fail, when the kernel stack can't grow any
more. Fixes a crash with recursive user calls.
See issue #4060 for more details.
Modified:
trunk/reactos/ntoskrnl/mm/procsup.c
Modified: trunk/reactos/ntoskrnl/mm/procsup.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/procsup.c?rev=…
==============================================================================
--- trunk/reactos/ntoskrnl/mm/procsup.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/mm/procsup.c [iso-8859-1] Mon May 18 01:51:31 2009
@@ -259,8 +259,11 @@
PETHREAD Thread = PsGetCurrentThread();
/* Make sure we have reserved space for our grow */
- ASSERT(((PCHAR)Thread->Tcb.StackBase - (PCHAR)Thread->Tcb.StackLimit) <=
- (KERNEL_LARGE_STACK_SIZE + PAGE_SIZE));
+ if (((PCHAR)Thread->Tcb.StackBase - (PCHAR)Thread->Tcb.StackLimit) >
+ (KERNEL_LARGE_STACK_SIZE + PAGE_SIZE))
+ {
+ return STATUS_NO_MEMORY;
+ }
/*
* We'll give you three more pages.