Browse files

mm/vmscan.c: fix mapping use after free

We need lock_page_nosync() here because we have no reference to the
mapping when taking the page lock.

Signed-off-by: Nick Piggin <>
Reviewed-by: Johannes Weiner <>
Cc: Mel Gorman <>
Signed-off-by: Andrew Morton <>
Signed-off-by: Linus Torvalds <>
  • Loading branch information...
1 parent 4b9ea5d commit 435b07fcdaa23f57a87bed3dd8f0a5e6c73013cc Nick Piggin committed with Jul 20, 2010
Showing with 1 addition and 1 deletion.
  1. +1 −1 mm/vmscan.c
@@ -320,7 +320,7 @@ static int may_write_to_queue(struct backing_dev_info *bdi)
static void handle_write_error(struct address_space *mapping,
struct page *page, int error)
- lock_page(page);
+ lock_page_nosync(page);
if (page_mapping(page) == mapping)
mapping_set_error(mapping, error);

0 comments on commit 435b07f

Please sign in to comment.