mirror of
https://github.com/reactos/reactos.git
synced 2025-08-03 05:55:48 +00:00
[NTOSKRNL] Properly check for address validity in !poolfind
This commit is contained in:
parent
47b48520b5
commit
28193399ee
1 changed files with 22 additions and 34 deletions
|
@ -3163,7 +3163,6 @@ ExpKdbgExtPoolFindPagedPool(
|
||||||
ULONG i = 0;
|
ULONG i = 0;
|
||||||
PPOOL_HEADER Entry;
|
PPOOL_HEADER Entry;
|
||||||
PVOID BaseVa;
|
PVOID BaseVa;
|
||||||
PMMPTE PointerPte;
|
|
||||||
PMMPDE PointerPde;
|
PMMPDE PointerPde;
|
||||||
|
|
||||||
KdbpPrint("Searching Paged pool (%p : %p) for Tag: %.4s\n", MmPagedPoolStart, MmPagedPoolEnd, (PCHAR)&Tag);
|
KdbpPrint("Searching Paged pool (%p : %p) for Tag: %.4s\n", MmPagedPoolStart, MmPagedPoolEnd, (PCHAR)&Tag);
|
||||||
|
@ -3192,13 +3191,7 @@ ExpKdbgExtPoolFindPagedPool(
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Check if allocation is valid */
|
/* Check if allocation is valid */
|
||||||
PointerPte = MiAddressToPte(BaseVa);
|
if (MmIsAddressValid(BaseVa))
|
||||||
if ((ULONG_PTR)PointerPte > PTE_TOP)
|
|
||||||
{
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (PointerPte->u.Hard.Valid)
|
|
||||||
{
|
{
|
||||||
for (Entry = BaseVa;
|
for (Entry = BaseVa;
|
||||||
(ULONG_PTR)Entry + sizeof(POOL_HEADER) < (ULONG_PTR)BaseVa + PAGE_SIZE;
|
(ULONG_PTR)Entry + sizeof(POOL_HEADER) < (ULONG_PTR)BaseVa + PAGE_SIZE;
|
||||||
|
@ -3243,7 +3236,6 @@ ExpKdbgExtPoolFindNonPagedPool(
|
||||||
{
|
{
|
||||||
PPOOL_HEADER Entry;
|
PPOOL_HEADER Entry;
|
||||||
PVOID BaseVa;
|
PVOID BaseVa;
|
||||||
PMMPTE PointerPte;
|
|
||||||
|
|
||||||
KdbpPrint("Searching NonPaged pool (%p : %p) for Tag: %.4s\n", MmNonPagedPoolStart, MmNonPagedPoolEnd0, (PCHAR)&Tag);
|
KdbpPrint("Searching NonPaged pool (%p : %p) for Tag: %.4s\n", MmNonPagedPoolStart, MmNonPagedPoolEnd0, (PCHAR)&Tag);
|
||||||
|
|
||||||
|
@ -3261,14 +3253,11 @@ ExpKdbgExtPoolFindNonPagedPool(
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Check if allocation is valid */
|
/* Check if allocation is valid */
|
||||||
PointerPte = MiAddressToPte(BaseVa);
|
if (!MmIsAddressValid(BaseVa))
|
||||||
if ((ULONG_PTR)PointerPte > PTE_TOP)
|
|
||||||
{
|
{
|
||||||
break;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (PointerPte->u.Hard.Valid)
|
|
||||||
{
|
|
||||||
for (Entry = BaseVa;
|
for (Entry = BaseVa;
|
||||||
(ULONG_PTR)Entry + sizeof(POOL_HEADER) < (ULONG_PTR)BaseVa + PAGE_SIZE;
|
(ULONG_PTR)Entry + sizeof(POOL_HEADER) < (ULONG_PTR)BaseVa + PAGE_SIZE;
|
||||||
Entry = (PVOID)((ULONG_PTR)Entry + 8))
|
Entry = (PVOID)((ULONG_PTR)Entry + 8))
|
||||||
|
@ -3297,7 +3286,6 @@ ExpKdbgExtPoolFindNonPagedPool(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
BOOLEAN
|
BOOLEAN
|
||||||
ExpKdbgExtPoolFind(
|
ExpKdbgExtPoolFind(
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue