Author: akhaldi
Date: Thu Apr 25 15:54:45 2013
New Revision: 58851
URL:
http://svn.reactos.org/svn/reactos?rev=58851&view=rev
Log:
[NTOSKRNL]
* Make sure that BaseAddress is at 64-k boundary in NtMapViewOfSection(). Fixes a couple
NtMapViewOfSection tests.
* Brought to you by Zhan Jianyu (aka larmbr) with review and improvement by Timo.
CORE-7118 #resolve #comment A slightly improved fix was committed in r58851. Thanks ;)
Modified:
trunk/reactos/ntoskrnl/mm/ARM3/section.c
Modified: trunk/reactos/ntoskrnl/mm/ARM3/section.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/ARM3/section.c…
==============================================================================
--- trunk/reactos/ntoskrnl/mm/ARM3/section.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/mm/ARM3/section.c [iso-8859-1] Thu Apr 25 15:54:45 2013
@@ -3040,6 +3040,13 @@
return STATUS_INVALID_PAGE_PROTECTION;
}
+ /* Check for non-allocation-granularity-aligned BaseAddress */
+ if (BaseAddress && (*BaseAddress != ALIGN_DOWN_POINTER_BY(*BaseAddress,
MM_VIRTMEM_GRANULARITY)))
+ {
+ DPRINT("BaseAddress is not at 64-kilobyte address boundary.");
+ return STATUS_MAPPED_ALIGNMENT;
+ }
+
/* Now convert the protection mask into desired section access mask */
DesiredAccess = MmMakeSectionAccess[ProtectionMask & 0x7];