diff options
| author | Hongling Zeng <zenghongling@kylinos.cn> | 2026-10-28 16:06:56 +0800 |
|---|---|---|
| committer | Namjae Jeon <linkinjeon@kernel.org> | 2026-10-29 17:50:14 +0900 |
| commit | 564c7753647731d19170914c1c637d3b33d88d3b (patch) | |
| tree | ff9d790bf22cd99bb8244b443aa7dfa8fc2c982f /scripts/Makefile.thinlto | |
| parent | cf24d5d154c73d1ac79d7b73f8b42cf85167c5b8 (diff) | |
| download | linux-next-564c7753647731d19170914c1c637d3b33d88d3b.tar.gz linux-next-564c7753647731d19170914c1c637d3b33d88d3b.zip | |
ntfs: fix a self-deadlock on writes to non-resident named streams
The stream write ioctl holds the stream mapping's invalidate lock
across ntfs_inode_attr_pwrite(), which calls
ntfs_extend_initialized_size() for named streams, and that function
takes the same lock again, before the check that could skip the
extension. A write to a non-resident named stream through
NTFS_IOC_STREAM_WRITE deadlocks on itself.
The ioctl is the only caller that reaches the named stream branch of
ntfs_inode_attr_pwrite(), and it always holds the lock there, so
split off __ntfs_extend_initialized_size(), which expects the caller
to hold the invalidate lock, and call it from that branch. The write
and mmap paths keep taking the lock themselves.
Fixes: 3f11c48d4f94 ("ntfs: add pathname access for named streams")
Signed-off-by: Hongling Zeng <zenghongling@kylinos.cn>
Reviewed-by: Baolin Liu <liubaolin@kylinos.cn>
Reviewed-by: Hyunchul Lee <hyc.lee@gmail.com>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
Diffstat (limited to 'scripts/Makefile.thinlto')
0 files changed, 0 insertions, 0 deletions
