提交 9f98927f 编写于 作者: Z ZhangPeng 提交者: Peng Zhang

userswap: fix BUG_ON in userfaultfd_release()

hulk inclusion
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I6CAIM

--------------------------------

In some features of userfaultfd, vma->vm_userfaultfd_ctx.ctx may be NULL
but VM_USWAP is not cleared. No longer check whether vma->vm_flags has
VM_USWAP. Just remove the flag.
Signed-off-by: NZhangPeng <zhangpeng362@huawei.com>
上级 d8a73976
......@@ -873,12 +873,12 @@ static int userfaultfd_release(struct inode *inode, struct file *file)
prev = NULL;
for (vma = mm->mmap; vma; vma = vma->vm_next) {
userfault_flags = VM_UFFD_MISSING | VM_UFFD_WP;
#ifdef CONFIG_USERSWAP
uswap_release(&userfault_flags);
#endif
cond_resched();
BUG_ON(!!vma->vm_userfaultfd_ctx.ctx ^
!!(vma->vm_flags & userfault_flags));
#ifdef CONFIG_USERSWAP
uswap_release(&userfault_flags);
#endif
if (vma->vm_userfaultfd_ctx.ctx != ctx) {
prev = vma;
continue;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册