Skip to content

Commit 5df7d05

Browse files
SergeGautherietkreuzer
authored andcommitted
[NTOS:MM] MiMapViewOfDataSection(): ASSERT InheritDisposition value
1 parent 29ca914 commit 5df7d05

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

‎ntoskrnl/mm/ARM3/section.c‎

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1177,6 +1177,9 @@ MiMapViewOfDataSection(
11771177

11781178
DPRINT("Mapping ARM3 data section\n");
11791179

1180+
/* Check for invalid inherit disposition */
1181+
ASSERT((InheritDisposition >= ViewShare) && (InheritDisposition <= ViewUnmap));
1182+
11801183
/* Get the segment for this section */
11811184
Segment = ControlArea->Segment;
11821185

@@ -2553,8 +2556,12 @@ MmMapViewOfArm3Section(
25532556
ULONG ProtectionMask;
25542557
NTSTATUS Status;
25552558
ULONG64 CalculatedViewSize;
2559+
25562560
PAGED_CODE();
25572561

2562+
/* Check for invalid inherit disposition */
2563+
// Let MiMapViewOfDataSection() check InheritDisposition value.
2564+
25582565
/* Get the segment and control area */
25592566
Section = (PSECTION)SectionObject;
25602567
ControlArea = Section->Segment->ControlArea;
@@ -3291,9 +3298,9 @@ NtMapViewOfSection(
32913298
#endif
32923299

32933300
/* Check for invalid inherit disposition */
3294-
if ((InheritDisposition > ViewUnmap) || (InheritDisposition < ViewShare))
3301+
if ((InheritDisposition < ViewShare) || (InheritDisposition > ViewUnmap))
32953302
{
3296-
DPRINT1("Invalid inherit disposition\n");
3303+
DPRINT1("Invalid inherit disposition: %d\n", InheritDisposition);
32973304
return STATUS_INVALID_PARAMETER_8;
32983305
}
32993306

0 commit comments

Comments
 (0)