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:ZhangPeng <zhangpeng362@huawei.com>
Loading
Please sign in to comment