Reactos

[NTOS:MM] Add more checks for MEMORY_AREA_OWNED_BY_ARM3

+3 -5
+1 -1
ntoskrnl/cache/section/data.c
··· 720 720 PMM_SECTION_SEGMENT Segment; 721 721 722 722 MemoryArea = MmLocateMemoryAreaByAddress(AddressSpace, BaseAddress); 723 - if (MemoryArea == NULL || MemoryArea->DeleteInProgress) 723 + if (MemoryArea == NULL || MemoryArea->Type == MEMORY_AREA_OWNED_BY_ARM3 || MemoryArea->DeleteInProgress) 724 724 { 725 725 ASSERT(MemoryArea); 726 726 return STATUS_UNSUCCESSFUL;
+2 -4
ntoskrnl/mm/ARM3/virtual.c
··· 1902 1902 1903 1903 /* Find the memory area the specified address belongs to */ 1904 1904 MemoryArea = MmLocateMemoryAreaByAddress(&TargetProcess->Vm, BaseAddress); 1905 - ASSERT(MemoryArea != NULL); 1906 1905 1907 1906 /* Determine information dependent on the memory area type */ 1908 - if (MemoryArea->Type == MEMORY_AREA_SECTION_VIEW) 1907 + if (MemoryArea && MemoryArea->Type == MEMORY_AREA_SECTION_VIEW) 1909 1908 { 1910 1909 Status = MmQuerySectionView(MemoryArea, BaseAddress, &MemoryInfo, &ResultLength); 1911 1910 if (!NT_SUCCESS(Status)) ··· 4914 4913 // Make sure this is an ARM3 section 4915 4914 // 4916 4915 MemoryArea = MmLocateMemoryAreaByAddress(AddressSpace, (PVOID)PAGE_ROUND_DOWN(PBaseAddress)); 4917 - ASSERT(MemoryArea != NULL); 4918 - if (MemoryArea->Type != MEMORY_AREA_OWNED_BY_ARM3) 4916 + if (MemoryArea && MemoryArea->Type != MEMORY_AREA_OWNED_BY_ARM3) 4919 4917 { 4920 4918 DPRINT1("Illegal commit of non-ARM3 section!\n"); 4921 4919 Status = STATUS_ALREADY_COMMITTED;