提交 a6aa62a0 编写于 作者: N Nick Piggin 提交者: Linus Torvalds

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: NNick Piggin <npiggin@suse.de>
Reviewed-by: NJohannes Weiner <hannes@cmpxchg.org>
Cc: Mel Gorman <mel@csn.ul.ie>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 c61284e9
...@@ -298,7 +298,7 @@ static int may_write_to_queue(struct backing_dev_info *bdi) ...@@ -298,7 +298,7 @@ static int may_write_to_queue(struct backing_dev_info *bdi)
static void handle_write_error(struct address_space *mapping, static void handle_write_error(struct address_space *mapping,
struct page *page, int error) struct page *page, int error)
{ {
lock_page(page); lock_page_nosync(page);
if (page_mapping(page) == mapping) if (page_mapping(page) == mapping)
mapping_set_error(mapping, error); mapping_set_error(mapping, error);
unlock_page(page); unlock_page(page);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册