Commit a6aa62a0 authored by Nick Piggin's avatar Nick Piggin Committed by Linus Torvalds
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: default avatarNick Piggin <>
Reviewed-by: default avatarJohannes Weiner <>
Cc: Mel Gorman <>
Signed-off-by: default avatarAndrew Morton <>
Signed-off-by: default avatarLinus Torvalds <>
parent c61284e9
......@@ -298,7 +298,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)
if (page_mapping(page) == mapping)
mapping_set_error(mapping, error);
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment