Commit a81fb608 authored by ZhangPeng's avatar ZhangPeng Committed by Ma Wupeng
Browse files

userswap: fix kernel BUG in userfaultfd_release()

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



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

During the unregister process, the vm_flags of userfaultfd
(VM_UFFD_MISSING | VM_UFFD_WP) are cleaned up, and
vma->vm_userfaultfd_ctx.ctx is set to NULL_VM_UFFD_CTX. However,
VM_USWAP is not cleared. If ctx is set to NULL_VM_UFFD_CTX and VM_USWAP
is not cleared, a BUG_ON() will occur in userfaultfd_release().
To fix this bug, clear the VM_USWAP flag in userfaultfd_unregister().

Signed-off-by: default avatarZhangPeng <zhangpeng362@huawei.com>
parent bdc54503
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment