From 3fe12f1a7c8a7d6beb44c90528bb06243ea757a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herm=C3=A8s=20B=C3=A9lusca-Ma=C3=AFto?= Date: Tue, 11 Jun 2024 22:21:49 +0200 Subject: [PATCH] [NTOS:IO] IopCreateArcNamesDisk(): Fix the ArcName link creation condition check. The bug was introduced in commit 6d0861e9e (r49131). --- ntoskrnl/io/iomgr/arcname.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/ntoskrnl/io/iomgr/arcname.c b/ntoskrnl/io/iomgr/arcname.c index 0066fa3881f..74ed04fe14b 100644 --- a/ntoskrnl/io/iomgr/arcname.c +++ b/ntoskrnl/io/iomgr/arcname.c @@ -703,16 +703,16 @@ IopCreateArcNamesDisk(IN PLOADER_PARAMETER_BLOCK LoaderBlock, ARC_DISK_SIGNATURE, ListEntry); - /* If they match, i.e. - * - There's only one disk for both BIOS and detected/enabled - * - Signatures are matching - * - Checksums are matching - * - This is MBR + /* + * If this is the only MBR disk in the ARC list and detected + * in the device tree, just go ahead and create the ArcName link. + * Otherwise, check whether the signatures and checksums match + * before creating the ArcName link. */ - if (((SingleDisk && DiskCount == 1) || + if ((SingleDisk && (DiskCount == 1) && + (DriveLayout->PartitionStyle == PARTITION_STYLE_MBR)) || (IopVerifyDiskSignature(DriveLayout, ArcDiskSignature, &Signature) && - (ArcDiskSignature->CheckSum + CheckSum == 0))) && - (DriveLayout->PartitionStyle == PARTITION_STYLE_MBR)) + (ArcDiskSignature->CheckSum + CheckSum == 0))) { /* Create device name */ sprintf(Buffer, "\\Device\\Harddisk%lu\\Partition0",