]> err.no Git - linux-2.6/commit
[PATCH] Fix hugepage crash on failing mmap()
authorDavid Gibson <david@gibson.dropbear.id.au>
Fri, 5 Aug 2005 18:59:35 +0000 (11:59 -0700)
committerLinus Torvalds <torvalds@g5.osdl.org>
Fri, 5 Aug 2005 19:22:37 +0000 (12:22 -0700)
commitc7546f8f03f5a4fa612605b6be930234d6026860
treee372cdb3856c9585587283c21b5b99a792a1a41d
parente6cb99413da42af413c11a394538ddc8b9d201e1
[PATCH] Fix hugepage crash on failing mmap()

This patch fixes a crash in the hugepage code.  unmap_hugepage_area() was
assuming that (due to prefault) PTEs must exist for all the area in
question.  However, this may not be the case, if mmap() encounters an error
before the prefault and calls unmap_region() to clean up any partial
mapping.

Depending on the hugepage configuration, this crash can be triggered by an
unpriveleged user.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Cc: William Lee Irwin III <wli@holomorphy.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
mm/hugetlb.c