Re: [PATCH] mm: drop mmap_sem before calling balance_dirty_pages() in write fault

From: Matthew Wilcox
Date: Thu Sep 26 2019 - 14:50:26 EST


On Thu, Sep 26, 2019 at 04:49:23PM +0300, Kirill A. Shutemov wrote:
> It happens if the VMA got unmapped under us while we dropped mmap_sem
> and inode got freed.
>
> Pinning the file if we drop mmap_sem fixes the issue.
>
> Signed-off-by: Kirill A. Shutemov <kirill.shutemov@xxxxxxxxxxxxxxx>
> Reported-by: syzbot+03ee87124ee05af991bd@xxxxxxxxxxxxxxxxxxxxxxxxx
> Cc: Hillf Danton <hdanton@xxxxxxxx>
> Cc: Matthew Wilcox <willy@xxxxxxxxxxxxx>
> Cc: Hugh Dickins <hughd@xxxxxxxxxx>

Reviewed-by: Matthew Wilcox (Oracle) <willy@xxxxxxxxxxxxx>