Skip to content

Commit 1b98f47

Browse files
committed
Fix a race condition regarding allocating/freeing memory.
1 parent 4edc540 commit 1b98f47

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

ntkrutils.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -869,12 +869,11 @@ static __inline struct page *alloc_page(unsigned int gfp_mask)
869869

870870
static __inline void __free_pages(struct page* page, unsigned int order)
871871
{
872-
ExFreePoolWithTag(page->hva, GVM_POOL_TAG);
873-
874872
raw_spin_lock(&global_page_lock);
875873
pglist[page->pfn] = 0;
876874
raw_spin_unlock(&global_page_lock);
877875

876+
ExFreePoolWithTag(page->hva, GVM_POOL_TAG);
878877
ExFreePoolWithTag(page, GVM_POOL_TAG);
879878
}
880879

0 commit comments

Comments
 (0)