Skip to content

Commit 9ecbbe2

Browse files
committed
[NTOSKRNL] Use ExAllocatePoolWithQuotaTag() when allocating SystemBuffer for the IRP
That way, in case the system lacks memory, an exception is thrown and IRP isn't sent to the device with NULL SystemBuffer. CORE-14048
1 parent d01184b commit 9ecbbe2

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

ntoskrnl/io/iomgr/iofunc.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -516,9 +516,9 @@ IopDeviceFsIoControl(IN HANDLE DeviceHandle,
516516
{
517517
/* Allocate the System Buffer */
518518
Irp->AssociatedIrp.SystemBuffer =
519-
ExAllocatePoolWithTag(PoolType,
520-
BufferLength,
521-
TAG_SYS_BUF);
519+
ExAllocatePoolWithQuotaTag(PoolType,
520+
BufferLength,
521+
TAG_SYS_BUF);
522522

523523
/* Check if we got a buffer */
524524
if (InputBuffer)
@@ -563,9 +563,9 @@ IopDeviceFsIoControl(IN HANDLE DeviceHandle,
563563
{
564564
/* Allocate the System Buffer */
565565
Irp->AssociatedIrp.SystemBuffer =
566-
ExAllocatePoolWithTag(PoolType,
567-
InputBufferLength,
568-
TAG_SYS_BUF);
566+
ExAllocatePoolWithQuotaTag(PoolType,
567+
InputBufferLength,
568+
TAG_SYS_BUF);
569569

570570
/* Copy into the System Buffer */
571571
RtlCopyMemory(Irp->AssociatedIrp.SystemBuffer,

0 commit comments

Comments
 (0)