From 7b4084f717395bd88d3f7e21760619570252117e Mon Sep 17 00:00:00 2001 From: Adrien Destugues Date: Tue, 11 Nov 2014 17:13:03 +0100 Subject: [PATCH] reject partitions with negative offset I had a KDL when trying to read an audio CD which apparently uses this as a copy protection scheme. I don't know if this is the right place to do this, the KDL would happen further down when the intel partitionning system or bfs would try to read data from the disk at offset -2048. --- src/system/kernel/disk_device_manager/KDiskDeviceManager.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/system/kernel/disk_device_manager/KDiskDeviceManager.cpp b/src/system/kernel/disk_device_manager/KDiskDeviceManager.cpp index 76b43c91e0..6fb1bf28e0 100644 --- a/src/system/kernel/disk_device_manager/KDiskDeviceManager.cpp +++ b/src/system/kernel/disk_device_manager/KDiskDeviceManager.cpp @@ -1373,6 +1373,10 @@ KDiskDeviceManager::_ScanPartition(KPartition* partition, return B_OK; } + // This happens with some copy protected CDs. Just ignore the partition... + if (partition->Offset() < 0) + return B_BAD_DATA; + DBG( KPath partitionPath; partition->GetPath(&partitionPath);