linux/fs/ntfs3
Moon Hee Lee 039ddf353c fs/ntfs3: reject index allocation if $BITMAP is empty but blocks exist
[ Upstream commit 0dc7117da8 ]

Index allocation requires at least one bit in the $BITMAP attribute to
track usage of index entries. If the bitmap is empty while index blocks
are already present, this reflects on-disk corruption.

syzbot triggered this condition using a malformed NTFS image. During a
rename() operation involving a long filename (which spans multiple
index entries), the empty bitmap allowed the name to be added without
valid tracking. Subsequent deletion of the original entry failed with
-ENOENT, due to unexpected index state.

Reject such cases by verifying that the bitmap is not empty when index
blocks exist.

Reported-by: syzbot+b0373017f711c06ada64@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=b0373017f711c06ada64
Fixes: d99208b919 ("fs/ntfs3: cancle set bad inode after removing name fails")
Tested-by: syzbot+b0373017f711c06ada64@syzkaller.appspotmail.com
Signed-off-by: Moon Hee Lee <moonhee.lee.ca@gmail.com>
Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
History 2025-10-15 12:03:55 +02:00
..
lib Changes for 6.12-rc3 2024-10-08 10:53:06 -07:00
attrib.c fs/ntfs3: remove ability to change compression on mounted volume 2025-05-19 11:17:33 +02:00
attrlist.c fs/ntfs3: Remove unused al_delete_le 2024-10-01 12:19:05 +03:00
bitfunc.c fs/ntfs3: Add ntfs_bitmap_weight_le function and refactoring 2022-11-14 19:50:42 +03:00
bitmap.c fs/ntfs3: Accumulated refactoring changes 2024-11-01 11:19:53 +03:00
debug.h fs/ntfs3. Add forward declarations for structs to debug.h 2021-09-13 19:41:43 +03:00
dir.c fs/ntfs3: Add sanity check for file name 2025-06-23 19:23:03 +02:00
file.c vfs-6.17-rc1.mmap_prepare 2025-07-28 13:43:25 -07:00
frecord.c fs/ntfs3: Exclude call make_bad_inode for live nodes. 2025-07-07 14:35:46 +02:00
fslog.c fs/ntfs3: Fix handling of InitializeFileRecordSegment 2025-05-16 16:26:07 +02:00
fsntfs.c fs/ntfs3: Exclude call make_bad_inode for live nodes. 2025-07-07 14:35:46 +02:00
index.c fs/ntfs3: reject index allocation if $BITMAP is empty but blocks exist 2025-10-15 12:03:55 +02:00
inode.c vfs-6.17-rc1.misc 2025-07-28 11:22:56 -07:00
Kconfig ntfs3: serve as alias for the legacy ntfs driver 2024-04-16 10:45:26 +02:00
lznt.c fs/ntfs3: Check if more than chunk-size bytes are written 2024-09-03 16:58:39 +03:00
Makefile fs/ntfs3: Add Kconfig, Makefile and doc 2021-08-13 07:56:37 -07:00
namei.c fs/ntfs3: Exclude call make_bad_inode for live nodes. 2025-07-07 14:35:46 +02:00
ntfs.h fs/ntfs3: fix symlinks cannot be handled correctly 2025-06-23 19:22:32 +02:00
ntfs_fs.h vfs-6.17-rc1.misc 2025-07-28 11:22:56 -07:00
record.c fs/ntfs3: Mark inode as bad as soon as error detected in mi_enum_attr() 2024-12-30 11:37:39 +03:00
run.c fs: ntfs3: Fix integer overflow in run_unpack() 2025-10-15 12:03:55 +02:00
super.c new helper: set_default_d_op() 2025-06-10 22:21:16 -04:00
upcase.c fs/ntfs3: Add option "nocase" 2022-09-30 17:39:47 +03:00
xattr.c fs/ntfs3: Exclude call make_bad_inode for live nodes. 2025-07-07 14:35:46 +02:00