mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 21:32:56 +00:00
- Check if a requested fixed address range is valid for the address space.
- This fixes bug #34. svn path=/trunk/; revision=6489
This commit is contained in:
parent
06f5aba298
commit
d8042fe330
1 changed files with 12 additions and 0 deletions
|
@ -519,6 +519,18 @@ NTSTATUS MmCreateMemoryArea(PEPROCESS Process,
|
||||||
{
|
{
|
||||||
tmpLength = (ULONG)*BaseAddress + Length - PAGE_ROUND_DOWN((*BaseAddress));
|
tmpLength = (ULONG)*BaseAddress + Length - PAGE_ROUND_DOWN((*BaseAddress));
|
||||||
(*BaseAddress) = (PVOID)PAGE_ROUND_DOWN((*BaseAddress));
|
(*BaseAddress) = (PVOID)PAGE_ROUND_DOWN((*BaseAddress));
|
||||||
|
|
||||||
|
if (AddressSpace->LowestAddress == KERNEL_BASE &&
|
||||||
|
(*BaseAddress) < (PVOID)KERNEL_BASE)
|
||||||
|
{
|
||||||
|
return STATUS_ACCESS_VIOLATION;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (AddressSpace->LowestAddress < KERNEL_BASE &&
|
||||||
|
(*BaseAddress) + tmpLength > (PVOID)KERNEL_BASE)
|
||||||
|
{
|
||||||
|
return STATUS_ACCESS_VIOLATION;
|
||||||
|
}
|
||||||
if (MmOpenMemoryAreaByRegion(AddressSpace,
|
if (MmOpenMemoryAreaByRegion(AddressSpace,
|
||||||
*BaseAddress,
|
*BaseAddress,
|
||||||
tmpLength)!=NULL)
|
tmpLength)!=NULL)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue