提交 7a36a752 编写于 作者: O Oleg Nesterov 提交者: Linus Torvalds

get_user_pages(): fix possible page leak on oom

get_user_pages() must not return the error when i != 0.  When pages !=
NULL we have i get_page()'ed pages.
Signed-off-by: NOleg Nesterov <oleg@tv-sign.ru>
Acked-by: NNick Piggin <npiggin@suse.de>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 7ca796f4
......@@ -1151,7 +1151,7 @@ int get_user_pages(struct task_struct *tsk, struct mm_struct *mm,
* be processed until returning to user space.
*/
if (unlikely(test_tsk_thread_flag(tsk, TIF_MEMDIE)))
return -ENOMEM;
return i ? i : -ENOMEM;
if (write)
foll_flags |= FOLL_WRITE;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册