Skip to content
Commit 0226635c authored by Tetsuo Handa's avatar Tetsuo Handa Committed by Linus Torvalds
Browse files

fs/ntfs3: don't hold ni_lock when calling truncate_setsize()

syzbot is reporting hung task at do_user_addr_fault() [1], for there is
a silent deadlock between PG_locked bit and ni_lock lock.

Since filemap_update_page() calls filemap_read_folio() after calling
folio_trylock() which will set PG_locked bit, ntfs_truncate() must not
call truncate_setsize() which will wait for PG_locked bit to be cleared
when holding ni_lock lock.

Link: https://lore.kernel.org/all/00000000000060d41f05f139aa44@google.com/
Link: https://syzkaller.appspot.com/bug?extid=bed15dbf10294aa4f2ae

 [1]
Reported-by: default avatarsyzbot <syzbot+bed15dbf10294aa4f2ae@syzkaller.appspotmail.com>
Debugged-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
Co-developed-by: default avatarHillf Danton <hdanton@sina.com>
Signed-off-by: default avatarHillf Danton <hdanton@sina.com>
Signed-off-by: default avatarTetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Fixes: 4342306f ("fs/ntfs3: Add file operations and implementation")
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 88603b6d
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment