xen: execve's error paths don't pin the mm before unpinning
Changes
1 files changed · +4 −1
| File | Status | Add | Del | Content |
|---|---|---|---|---|
| arch/i386/xen/mmu.c | modified | +4 | −1 | View file |
arch/i386/xen/mmu.c
View filediff --git a/arch/i386/xen/mmu.c b/arch/i386/xen/mmu.c
index 4ae038a..874db0c 100644
--- a/arch/i386/xen/mmu.c
+++ b/arch/i386/xen/mmu.c
@@ -559,6 +559,9 @@ void xen_exit_mmap(struct mm_struct *mm)
put_cpu();
spin_lock(&mm->page_table_lock);
- xen_pgd_unpin(mm->pgd);
+
+ /* pgd may not be pinned in the error exit path of execve */
+ if (PagePinned(virt_to_page(mm->pgd)))
+ xen_pgd_unpin(mm->pgd);
spin_unlock(&mm->page_table_lock);
}