mirror of
https://github.com/reactos/reactos.git
synced 2025-01-07 14:51:00 +00:00
- Hey Arch, did you know MmpDeleteSection can be called for a Section Object before it is fully set up (when ObDereferenceObject is called before all fields are initialized), and it will now crash due to a bogus, nonintialized Segment/ImageSection pointer? Always zero out the whole buffer to prevent this. Fixes the kernel32 loader Winetest.
svn path=/trunk/; revision=41985
This commit is contained in:
parent
3989bd4e3c
commit
29fa9f1dd8
1 changed files with 3 additions and 10 deletions
|
@ -2375,12 +2375,9 @@ MmCreatePageFileSection(PROS_SECTION_OBJECT *SectionObject,
|
||||||
/*
|
/*
|
||||||
* Initialize it
|
* Initialize it
|
||||||
*/
|
*/
|
||||||
Section->Type = 0;
|
RtlZeroMemory(Section, sizeof(ROS_SECTION_OBJECT));
|
||||||
Section->Size = 0;
|
|
||||||
Section->SectionPageProtection = SectionPageProtection;
|
Section->SectionPageProtection = SectionPageProtection;
|
||||||
Section->AllocationAttributes = AllocationAttributes;
|
Section->AllocationAttributes = AllocationAttributes;
|
||||||
Section->Segment = NULL;
|
|
||||||
Section->FileObject = NULL;
|
|
||||||
Section->MaximumSize = MaximumSize;
|
Section->MaximumSize = MaximumSize;
|
||||||
Segment = ExAllocatePoolWithTag(NonPagedPool, sizeof(MM_SECTION_SEGMENT),
|
Segment = ExAllocatePoolWithTag(NonPagedPool, sizeof(MM_SECTION_SEGMENT),
|
||||||
TAG_MM_SECTION_SEGMENT);
|
TAG_MM_SECTION_SEGMENT);
|
||||||
|
@ -2449,11 +2446,9 @@ MmCreateDataFileSection(PROS_SECTION_OBJECT *SectionObject,
|
||||||
/*
|
/*
|
||||||
* Initialize it
|
* Initialize it
|
||||||
*/
|
*/
|
||||||
Section->Type = 0;
|
RtlZeroMemory(Section, sizeof(ROS_SECTION_OBJECT));
|
||||||
Section->Size = 0;
|
|
||||||
Section->SectionPageProtection = SectionPageProtection;
|
Section->SectionPageProtection = SectionPageProtection;
|
||||||
Section->AllocationAttributes = AllocationAttributes;
|
Section->AllocationAttributes = AllocationAttributes;
|
||||||
Section->Segment = NULL;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Check file access required
|
* Check file access required
|
||||||
|
@ -3377,9 +3372,7 @@ MmCreateImageSection(PROS_SECTION_OBJECT *SectionObject,
|
||||||
/*
|
/*
|
||||||
* Initialize it
|
* Initialize it
|
||||||
*/
|
*/
|
||||||
Section->Type = 0;
|
RtlZeroMemory(Section, sizeof(ROS_SECTION_OBJECT));
|
||||||
Section->Size = 0;
|
|
||||||
Section->MaximumSize.QuadPart = 0;
|
|
||||||
Section->SectionPageProtection = SectionPageProtection;
|
Section->SectionPageProtection = SectionPageProtection;
|
||||||
Section->AllocationAttributes = AllocationAttributes;
|
Section->AllocationAttributes = AllocationAttributes;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue