mirror of
https://github.com/reactos/reactos.git
synced 2025-06-12 10:38:29 +00:00
[NTOSKRNL]
Fix string size to store GPT GUIDs. This was causing a buffer overflow (with ending null char) and thus a stack corruption. The side effect of the stack corruption was that the debug code (display) was looping forever while attempting to read partition table making ntoskrnl unable to boot with a machine where there's a GPT disk. Kernel is now able again to handle GPT disks (and they can be used again in user-land). This was magically hidding before r59923 or by disabling NDEBUG. Lovely Heisenbugs :-). svn path=/trunk/; revision=60003
This commit is contained in:
parent
36f1e2f5d1
commit
bd3ccd4826
1 changed files with 5 additions and 3 deletions
|
@ -86,6 +86,8 @@ typedef struct _MASTER_BOOT_RECORD
|
||||||
#define EFI_HEADER_REVISION_1 0x00010000
|
#define EFI_HEADER_REVISION_1 0x00010000
|
||||||
/* Defines system type for MBR showing that a GPT is following */
|
/* Defines system type for MBR showing that a GPT is following */
|
||||||
#define EFI_PMBR_OSTYPE_EFI 0xEE
|
#define EFI_PMBR_OSTYPE_EFI 0xEE
|
||||||
|
/* Defines size to store a complete GUID + null char */
|
||||||
|
#define EFI_GUID_STRING_SIZE 0x27
|
||||||
|
|
||||||
#define IS_VALID_DISK_INFO(Disk) \
|
#define IS_VALID_DISK_INFO(Disk) \
|
||||||
(Disk) && \
|
(Disk) && \
|
||||||
|
@ -534,7 +536,7 @@ NTAPI
|
||||||
FstubDbgPrintDriveLayoutEx(IN PDRIVE_LAYOUT_INFORMATION_EX DriveLayout)
|
FstubDbgPrintDriveLayoutEx(IN PDRIVE_LAYOUT_INFORMATION_EX DriveLayout)
|
||||||
{
|
{
|
||||||
ULONG i;
|
ULONG i;
|
||||||
CHAR Guid[38];
|
CHAR Guid[EFI_GUID_STRING_SIZE];
|
||||||
PAGED_CODE();
|
PAGED_CODE();
|
||||||
|
|
||||||
DPRINT("FSTUB: DRIVE_LAYOUT_INFORMATION_EX: %p\n", DriveLayout);
|
DPRINT("FSTUB: DRIVE_LAYOUT_INFORMATION_EX: %p\n", DriveLayout);
|
||||||
|
@ -575,7 +577,7 @@ NTAPI
|
||||||
FstubDbgPrintPartitionEx(IN PPARTITION_INFORMATION_EX PartitionEntry,
|
FstubDbgPrintPartitionEx(IN PPARTITION_INFORMATION_EX PartitionEntry,
|
||||||
IN ULONG PartitionNumber)
|
IN ULONG PartitionNumber)
|
||||||
{
|
{
|
||||||
CHAR Guid[38];
|
CHAR Guid[EFI_GUID_STRING_SIZE];
|
||||||
PAGED_CODE();
|
PAGED_CODE();
|
||||||
|
|
||||||
DPRINT("Printing partition %lu\n", PartitionNumber);
|
DPRINT("Printing partition %lu\n", PartitionNumber);
|
||||||
|
@ -614,7 +616,7 @@ NTAPI
|
||||||
FstubDbgPrintSetPartitionEx(IN PSET_PARTITION_INFORMATION_EX PartitionEntry,
|
FstubDbgPrintSetPartitionEx(IN PSET_PARTITION_INFORMATION_EX PartitionEntry,
|
||||||
IN ULONG PartitionNumber)
|
IN ULONG PartitionNumber)
|
||||||
{
|
{
|
||||||
CHAR Guid[38];
|
CHAR Guid[EFI_GUID_STRING_SIZE];
|
||||||
PAGED_CODE();
|
PAGED_CODE();
|
||||||
|
|
||||||
DPRINT("FSTUB: SET_PARTITION_INFORMATION_EX: %p\n", PartitionEntry);
|
DPRINT("FSTUB: SET_PARTITION_INFORMATION_EX: %p\n", PartitionEntry);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue