lkml.org 
[lkml]   [2024]   [Mar]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
SubjectRe: [syzbot] [mm?] possible deadlock in move_pages
Date
On Tue, 19 Mar 2024 02:52:16 -0700
> syzbot found the following issue on:
>
> HEAD commit: e5eb28f6d1af Merge tag 'mm-nonmm-stable-2024-03-14-09-36' ..
> git tree: upstream
> C reproducer: https://syzkaller.appspot.com/x/repro.c?x=173b7ac9180000

#syz test https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git e5eb28f6d1af

--- x/mm/userfaultfd.c
+++ y/mm/userfaultfd.c
@@ -1442,9 +1442,9 @@ static int uffd_move_lock(struct mm_stru
* See comment in lock_vma() as to why not using
* vma_start_read() here.
*/
- down_read(&(*dst_vmap)->vm_lock->lock);
+ down_read_nested(&(*dst_vmap)->vm_lock->lock, 1);
if (*dst_vmap != *src_vmap)
- down_read(&(*src_vmap)->vm_lock->lock);
+ down_read_nested(&(*src_vmap)->vm_lock->lock, 2);
}
mmap_read_unlock(mm);
return err;
--
\
 
 \ /
  Last update: 2024-05-27 15:55    [W:0.055 / U:1.368 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site