[haiku-commits] haiku: hrev49254 - src/add-ons/kernel/partitioning_systems/gpt

  • From: pulkomandy@xxxxxxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Mon, 8 Jun 2015 04:19:35 +0200 (CEST)

hrev49254 adds 1 changeset to branch 'master'
old head: d2a6418f63f04178dd2ffe332d169ec8b7593087
new head: 0e88b8d50b2230aadbaf2c8acc80f02c188a105d
overview:
http://cgit.haiku-os.org/haiku/log/?qt=range&q=0e88b8d50b22+%5Ed2a6418f63f0

----------------------------------------------------------------------------

0e88b8d50b22: GPT: ignore partitions at offset 0

* This would be a GPT partition pointing to itself, leading to infinite
recursion in the GPT parser calling itself and Haiku would reset
(probably triple fault?).
* Thanks to Puck for discovering this!

[ Adrien Destugues <pulkomandy@xxxxxxxxx> ]

----------------------------------------------------------------------------

Revision: hrev49254
Commit: 0e88b8d50b2230aadbaf2c8acc80f02c188a105d
URL: http://cgit.haiku-os.org/haiku/commit/?id=0e88b8d50b22
Author: Adrien Destugues <pulkomandy@xxxxxxxxx>
Date: Mon Jun 8 01:48:39 2015 UTC

----------------------------------------------------------------------------

1 file changed, 5 insertions(+)
src/add-ons/kernel/partitioning_systems/gpt/efi_gpt.cpp | 5 +++++

----------------------------------------------------------------------------

diff --git a/src/add-ons/kernel/partitioning_systems/gpt/efi_gpt.cpp
b/src/add-ons/kernel/partitioning_systems/gpt/efi_gpt.cpp
index ad8f784..5fc66f2 100644
--- a/src/add-ons/kernel/partitioning_systems/gpt/efi_gpt.cpp
+++ b/src/add-ons/kernel/partitioning_systems/gpt/efi_gpt.cpp
@@ -115,6 +115,11 @@ efi_gpt_scan_partition(int fd, partition_data* partition,
void* _cookie)
continue;
}

+ if (entry.StartBlock() * partition->block_size == 0) {
+ TRACE(("efi_gpt: child partition starts at 0 (recursive
entry)\n"));
+ continue;
+ }
+
partition_data* child = create_child_partition(partition->id,
index++,
partition->offset + entry.StartBlock() *
partition->block_size,
entry.BlockCount() * partition->block_size, -1);


Other related posts:

  • » [haiku-commits] haiku: hrev49254 - src/add-ons/kernel/partitioning_systems/gpt - pulkomandy