[ros-diffs] [rharabien] 52044: [NTOSKRNL] - Bugcheck if ExFreePoolWithTag is called with wrong tag

rharabien at svn.reactos.org rharabien at svn.reactos.org
Wed Jun 1 18:16:53 UTC 2011


Author: rharabien
Date: Wed Jun  1 18:16:52 2011
New Revision: 52044

URL: http://svn.reactos.org/svn/reactos?rev=52044&view=rev
Log:
[NTOSKRNL]
- Bugcheck if ExFreePoolWithTag is called with wrong tag

Modified:
    trunk/reactos/ntoskrnl/mm/ARM3/expool.c

Modified: trunk/reactos/ntoskrnl/mm/ARM3/expool.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/ARM3/expool.c?rev=52044&r1=52043&r2=52044&view=diff
==============================================================================
--- trunk/reactos/ntoskrnl/mm/ARM3/expool.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/mm/ARM3/expool.c [iso-8859-1] Wed Jun  1 18:16:52 2011
@@ -736,7 +736,7 @@
     //
     // Use a default tag of "None"
     //
-    return ExAllocatePoolWithTag(PoolType, NumberOfBytes, 'enoN');
+    return ExAllocatePoolWithTag(PoolType, NumberOfBytes, TAG_NONE);
 }
 
 /*
@@ -789,6 +789,15 @@
     OldIrql = ExLockPool(PoolDesc);
 
     //
+    // Check block tag
+    //
+    if (TagToFree && TagToFree != Entry->PoolTag)
+    {
+    	DPRINT1("Freeing pool - invalid tag specified: %.4s != %.4s\n", (char*)&TagToFree, (char*)&Entry->PoolTag);
+    	KeBugCheckEx(BAD_POOL_CALLER, 0x0A, (ULONG_PTR)P, Entry->PoolTag, TagToFree);
+    }
+
+    //
     // Check if the next allocation is at the end of the page
     //
     ExpCheckPoolBlocks(Entry);




More information about the Ros-diffs mailing list