Skip to content

Commit bdae0cc

Browse files
committed
[NTOSKRNL] Don't call OOM dumper in case we were trying to allocate more than 100 pages.
In such case, we'll consider the caller is bogus and we'll fail in silence. Dedicated to Mark (again!)
1 parent 01fcb02 commit bdae0cc

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

ntoskrnl/mm/ARM3/expool.c

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1810,8 +1810,14 @@ ExAllocatePoolWithTag(IN POOL_TYPE PoolType,
18101810
#if DBG
18111811
//
18121812
// Out of memory, display current consumption
1813+
// Let's consider that if the caller wanted more
1814+
// than a hundred pages, that's a bogus caller
1815+
// and we are not out of memory
18131816
//
1814-
MiDumpPoolConsumers(FALSE, 0, 0, 0);
1817+
if (NumberOfBytes < 100 * PAGE_SIZE)
1818+
{
1819+
MiDumpPoolConsumers(FALSE, 0, 0, 0);
1820+
}
18151821
#endif
18161822

18171823
//
@@ -2143,8 +2149,14 @@ ExAllocatePoolWithTag(IN POOL_TYPE PoolType,
21432149
#if DBG
21442150
//
21452151
// Out of memory, display current consumption
2152+
// Let's consider that if the caller wanted more
2153+
// than a hundred pages, that's a bogus caller
2154+
// and we are not out of memory
21462155
//
2147-
MiDumpPoolConsumers(FALSE, 0, 0, 0);
2156+
if (NumberOfBytes < 100 * PAGE_SIZE)
2157+
{
2158+
MiDumpPoolConsumers(FALSE, 0, 0, 0);
2159+
}
21482160
#endif
21492161

21502162
//

0 commit comments

Comments
 (0)