Skip to content

Commit

Permalink
xen: execve's error paths don't pin the mm before unpinning
Browse files Browse the repository at this point in the history
execve's error paths don't activate (and therefore pin) the mm before
calling exit_mmap to free it up, so don't try to unpin unless it is
actually pinned.  This prevents a BUG_ON from triggering.

Signed-off-by: Jeremy Fitzhardinge <jeremy@xensource.com>
Cc: Christian Ostheimer <osth@freesurf.ch>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Jeremy Fitzhardinge authored and Linus Torvalds committed Sep 26, 2007
1 parent e66485d commit df912ea
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion arch/i386/xen/mmu.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

0 comments on commit df912ea

Please sign in to comment.