linux-stable/fs/ntfs3
Tetsuo Handa 0226635c30 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: syzbot <syzbot+bed15dbf10294aa4f2ae@syzkaller.appspotmail.com>
Debugged-by: Linus Torvalds <torvalds@linux-foundation.org>
Co-developed-by: Hillf Danton <hdanton@sina.com>
Signed-off-by: Hillf Danton <hdanton@sina.com>
Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Fixes: 4342306f0f ("fs/ntfs3: Add file operations and implementation")
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2023-01-02 10:31:09 -08:00
..
lib
attrib.c
attrlist.c
bitfunc.c
bitmap.c fs/ntfs3: Improve checking of bad clusters 2022-11-14 19:50:48 +03:00
debug.h
dir.c
file.c fs/ntfs3: don't hold ni_lock when calling truncate_setsize() 2023-01-02 10:31:09 -08:00
frecord.c
fslog.c ntfs3 for 6.2 2022-12-21 10:18:17 -08:00
fsntfs.c fs/ntfs3: Use ALIGN kernel macro 2022-11-14 19:50:47 +03:00
index.c
inode.c ntfs3 for 6.2 2022-12-21 10:18:17 -08:00
Kconfig
lznt.c
Makefile
namei.c ntfs3 for 6.2 2022-12-21 10:18:17 -08:00
ntfs.h fs/ntfs3: Fix wrong if in hdr_first_de 2022-11-14 19:50:48 +03:00
ntfs_fs.h ntfs3 for 6.2 2022-12-21 10:18:17 -08:00
record.c fs/ntfs3: Make if more readable 2022-11-14 19:50:49 +03:00
run.c fs/ntfs3: Improve checking of bad clusters 2022-11-14 19:50:48 +03:00
super.c fs/ntfs3: Improve checking of bad clusters 2022-11-14 19:50:48 +03:00
upcase.c
xattr.c ntfs3 for 6.2 2022-12-21 10:18:17 -08:00