linux-yocto/fs/ntfs3
Moon Hee Lee be66551da2 fs/ntfs3: reject index allocation if $BITMAP is empty but blocks exist
[ Upstream commit 0dc7117da8f92dd5fe077d712a756eccbe377d40 ]

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>
2025-10-15 12:00:10 +02:00
..
lib
attrib.c
attrlist.c
bitfunc.c
bitmap.c
debug.h
dir.c fs/ntfs3: Add sanity check for file name 2025-08-20 18:30:21 +02:00
file.c Revert "fs/ntfs3: Replace inode_trylock with inode_lock" 2025-08-15 12:13:32 +02:00
frecord.c fs/ntfs3: cancle set bad inode after removing name fails 2025-08-15 12:13:32 +02:00
fslog.c
fsntfs.c
index.c fs/ntfs3: reject index allocation if $BITMAP is empty but blocks exist 2025-10-15 12:00:10 +02:00
inode.c fs/ntfs3: correctly create symlink for relative path 2025-08-20 18:30:21 +02:00
Kconfig
lznt.c
Makefile
namei.c fs/ntfs3: cancle set bad inode after removing name fails 2025-08-15 12:13:32 +02:00
ntfs_fs.h fs/ntfs3: cancle set bad inode after removing name fails 2025-08-15 12:13:32 +02:00
ntfs.h fs/ntfs3: Prevent integer overflow in hdr_first_de() 2025-04-10 14:39:23 +02:00
record.c
run.c fs: ntfs3: Fix integer overflow in run_unpack() 2025-10-15 12:00:10 +02:00
super.c
upcase.c
xattr.c