]> git.baikalelectronics.ru Git - kernel.git/commit
fs/userfaultfd: Fix maple tree iterator in userfaultfd_unregister()
authorLiam Howlett <liam.howlett@oracle.com>
Mon, 7 Nov 2022 20:11:42 +0000 (20:11 +0000)
committerLinus Torvalds <torvalds@linux-foundation.org>
Mon, 7 Nov 2022 20:58:26 +0000 (12:58 -0800)
commitdcf44601530efec66b74b44b7e81ad68e0272b91
treef4b518e9d6a7734d2a8c30062101ce219b8b37a8
parent9584c7605e62ef5ac6e15bcf85e52c25d3ef24c3
fs/userfaultfd: Fix maple tree iterator in userfaultfd_unregister()

When iterating the VMAs, the maple state needs to be invalidated if the
tree is modified by a split or merge to ensure the maple tree node
contained in the maple state is still valid.  These invalidations were
missed, so add them to the paths which alter the tree.

Reported-by: syzbot+0d2014e4da2ccced5b41@syzkaller.appspotmail.com
Fixes: d92ee617de09 (userfaultfd: use maple tree iterator to iterate VMAs)
Signed-off-by: Liam R. Howlett <Liam.Howlett@oracle.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
fs/userfaultfd.c