From 9c3c0d123bf2306b808262fba1d3a224be9fac96 Mon Sep 17 00:00:00 2001 From: Pierre Schweitzer Date: Sun, 2 Jun 2019 10:48:35 +0200 Subject: [PATCH] [NTOSKRNL] In case IopMountVolume call is a success, return its VPB This fixes an extra (erroneous) reference being set on the VPB. Based on a patch by Vadim Galyant CORE-16080 --- ntoskrnl/io/iomgr/volume.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/ntoskrnl/io/iomgr/volume.c b/ntoskrnl/io/iomgr/volume.c index 6c2e3191e9a..1d1e31e5c0d 100644 --- a/ntoskrnl/io/iomgr/volume.c +++ b/ntoskrnl/io/iomgr/volume.c @@ -123,6 +123,14 @@ IopCheckVpbMounted(IN POPEN_PACKET OpenPacket, *Status = STATUS_WRONG_VOLUME; return NULL; } + /* + * In case IopMountVolume returns a valid VPB + * Then, the volume is mounted, return it + */ + else if (Vpb != NULL) + { + return Vpb; + } /* Re-acquire the lock */ IoAcquireVpbSpinLock(&OldIrql);