提交 bcfd7200 编写于 作者: H Hillf Danton 提交者: Cheng Jian

mm/gup: Let __get_user_pages_locked() return -EINTR for fatal signal

mainline inclusion
from mainline-v5.7-rc1
commit ae46d2aa
category: bugfix
bugzilla: 47439
CVE: NA
---------------------------

__get_user_pages_locked() will return 0 instead of -EINTR after commit
4426e945 ("mm/gup: allow VM_FAULT_RETRY for multiple times") which
added extra code to allow gup detect fatal signal faster.

Restore the original -EINTR behavior.

Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Peter Zijlstra <peterz@infradead.org>
Fixes: 4426e945 ("mm/gup: allow VM_FAULT_RETRY for multiple times")
Reported-by: syzbot+3be1a33f04dc782e9fd5@syzkaller.appspotmail.com
Signed-off-by: NHillf Danton <hdanton@sina.com>
Acked-by: NMichal Hocko <mhocko@suse.com>
Signed-off-by: NPeter Xu <peterx@redhat.com>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: NXiongfeng Wang <wangxiongfeng2@huawei.com>
Reviewed-by: NJing Xiangfeng <jingxiangfeng@huawei.com>
Reviewed-by: NKefeng  Wang <wangkefeng.wang@huawei.com>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
Signed-off-by: NCheng Jian <cj.chengjian@huawei.com>
上级 1a397268
......@@ -947,8 +947,11 @@ static __always_inline long __get_user_pages_locked(struct task_struct *tsk,
* start trying again otherwise it can loop forever.
*/
if (fatal_signal_pending(current))
if (fatal_signal_pending(current)) {
if (!pages_done)
pages_done = -EINTR;
break;
}
*locked = 1;
down_read(&mm->mmap_sem);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册